作者 v_bairong06

订单管理完成、直接购买完成,个人中心部分模块搭建

正在显示 30 个修改的文件 包含 1774 行增加358 行删除
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<admintpl file="header" />
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li><a href="{:U('Message/index')}">站内信</a></li>
<li class="active"><a href="{:U('Message/add')}">添加站内信</a></li>
</ul>
<form method="post" class="form-horizontal js-ajax-forms" action="{:U('Message/add_post')}">
<fieldset>
<div class="control-group">
<label class="control-label">标题</label>
<div class="controls">
<input type="text" name="title">
<span class="form-required">*</span>
</div>
</div>
<div class="control-group">
<label class="control-label">描述</label>
<div class="controls">
<textarea name="description" rows="5" cols="30"></textarea>
<span class="form-required">*</span>
</div>
</div>
<div class="control-group">
<label class="control-label">接收人</label>
<div class="controls">
<label><input type="checkbox" class="js-check-all" style="margin:-1px 0 0;" onclick="swapCheck()" data-direction="x" data-checklist="js-check-x">&nbsp;全部</label>
<volist name="userList" id="vo">
<label style="float:left;"><input type="checkbox" class="js-check" style="margin:-1px 0 0;" data-yid="js-check-y" data-xid="js-check-x" title="ID:{$vo.id}" name="userids[]" value="{$vo.id}"/>&nbsp;{$vo.nickname}&nbsp;&nbsp;</label>
</volist>
<span class="form-required">*</span>
</div>
</div>
<div class="control-group">
<label class="control-label">内容</label>
<div class="controls">
<script type="text/plain" id="content" name="content"></script>
</div>
</div>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
<a class="btn" href="{:U('Message/index')}">{:L('BACK')}</a>
</div>
</form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function() {
$(".js-ajax-close-btn").on('click', function(e) {
e.preventDefault();
Wind.use("artDialog", function() {
art.dialog({
id : "question",
icon : "question",
fixed : true,
lock : true,
background : "#CCCCCC",
opacity : 0,
content : "您确定需要关闭当前页面嘛?",
ok : function() {
setCookie("refersh_time", 1);
window.close();
return true;
}
});
});
});
/////---------------------
Wind.use('validate', 'ajaxForm', 'artDialog', function() {
//javascript
//编辑器
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
//增加编辑器验证规则
jQuery.validator.addMethod('editorcontent', function() {
try {
editorcontent.sync();
} catch (err) {
}
return editorcontent.hasContents();
});
var form = $('form.js-ajax-forms');
//ie处理placeholder提交问题
if ($.browser && $.browser.msie) {
form.find('[placeholder]').each(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
});
}
var formloading = false;
//表单验证开始
form.validate({
//是否在获取焦点时验证
onfocusout : false,
//是否在敲击键盘时验证
onkeyup : false,
//当鼠标掉级时验证
onclick : false,
//验证错误
showErrors : function(errorMap, errorArr) {
//errorMap {'name':'错误信息'}
//errorArr [{'message':'错误信息',element:({})}]
try {
$(errorArr[0].element).focus();
art.dialog({
id : 'error',
icon : 'error',
lock : true,
fixed : true,
background : "#CCCCCC",
opacity : 0,
content : errorArr[0].message,
cancelVal : '确定',
cancel : function() {
$(errorArr[0].element).focus();
}
});
} catch (err) {
}
},
//验证规则
rules : {
'title' : {
required : 1
},
'content' : {
editorcontent : true
}
},
//验证未通过提示消息
messages : {
'title' : {
required : '请输入标题'
},
'content' : {
editorcontent : '内容不能为空'
}
},
//给未通过验证的元素加效果,闪烁等
highlight : false,
//是否在获取焦点时验证
onfocusout : false,
//验证通过,提交表单
submitHandler : function(forms) {
if (formloading)
return;
$(forms).ajaxSubmit({
url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
dataType : 'json',
beforeSubmit : function(arr, $form, options) {
formloading = true;
},
success : function(data, statusText, xhr, $form) {
formloading = false;
if (data.status) {
setCookie("refersh_time", 1);
//添加成功
Wind.use("artDialog", function() {
art.dialog({
id : "succeed",
icon : "succeed",
fixed : true,
lock : true,
background : "#CCCCCC",
opacity : 0,
content : data.info,
button : [ {
name : '继续添加?',
callback : function() {
reloadPage(window);
return true;
},
focus : true
}, {
name : '返回列表页',
callback : function() {
location = "{:U('Message/index')}";
return true;
}
} ]
});
});
} else {
artdialog_alert(data.info);
}
}
});
}
});
});
////-------------------------
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<admintpl file="header" />
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li><a href="{:U('Message/index')}">站内信</a></li>
<li><a href="{:U('Message/add')}">添加站内信</a></li>
<li class="active"><a>编辑站内信</a></li>
</ul>
<form method="post" class="form-horizontal js-ajax-forms" action="{:U('Message/edit_post')}">
<fieldset>
<div class="control-group">
<label class="control-label">标题</label>
<div class="controls">
<input type="text" name="title" value="{$title}">
<span class="form-required">*</span>
<input type="hidden" name="id" value="{$id}">
</div>
</div>
<div class="control-group">
<label class="control-label">描述</label>
<div class="controls">
<textarea name="description" rows="5" cols="57">{$description}</textarea>
<span class="form-required">*</span>
</div>
</div>
<div class="control-group">
<label class="control-label">接收人</label>
<div class="controls">
<label><input type="checkbox" class="js-check-all" style="margin:-1px 0 0;" onclick="swapCheck()" data-direction="x" data-checklist="js-check-x">&nbsp;全部</label>
<volist name="userList" id="vo">
<php>
$ids = explode(',',$userids);
$check = in_array($vo['id'], $ids)?'checked':'';
</php>
<label style="float:left;"><input type="checkbox" class="js-check" {$check} style="margin:-1px 0 0;" data-yid="js-check-y" data-xid="js-check-x" title="ID:{$vo.id}" name="userids[]" value="{$vo.id}"/>&nbsp;{$vo.nickname}&nbsp;&nbsp;</label>
</volist>
<span class="form-required">*</span>
</div>
</div>
<div class="control-group">
<label class="control-label">详情</label>
<div class="controls">
<script type="text/plain" id="content" name="content">{$content}</script>
</div>
</div>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
<a class="btn" href="{:U('Message/index')}">{:L('BACK')}</a>
</div>
</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
<script type="text/javascript">
//checkbox 全选/取消全选
var isCheckAll = false;
$(function(){
swapCheck();
})
function swapCheck() {
if (isCheckAll) {
$("input[type='checkbox']").each(function() {
this.checked = false;
});
isCheckAll = false;
} else {
$("input[type='checkbox']").each(function() {
this.checked = true;
});
isCheckAll = true;
}
}
</script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function() {
$(".js-ajax-close-btn").on('click', function(e) {
e.preventDefault();
Wind.use("artDialog", function() {
art.dialog({
id : "question",
icon : "question",
fixed : true,
lock : true,
background : "#CCCCCC",
opacity : 0,
content : "您确定需要关闭当前页面嘛?",
ok : function() {
setCookie("refersh_time", 1);
window.close();
return true;
}
});
});
});
/////---------------------
Wind.use('validate', 'ajaxForm', 'artDialog', function() {
//javascript
//编辑器
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
//增加编辑器验证规则
jQuery.validator.addMethod('editorcontent', function() {
try {
editorcontent.sync();
} catch (err) {
}
;
return editorcontent.hasContents();
});
var form = $('form.js-ajax-forms');
//ie处理placeholder提交问题
if ($.browser && $.browser.msie) {
form.find('[placeholder]').each(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
});
}
//表单验证开始
form.validate({
//是否在获取焦点时验证
onfocusout : false,
//是否在敲击键盘时验证
onkeyup : false,
//当鼠标掉级时验证
onclick : false,
//验证错误
showErrors : function(errorMap, errorArr) {
//errorMap {'name':'错误信息'}
//errorArr [{'message':'错误信息',element:({})}]
try {
$(errorArr[0].element).focus();
art.dialog({
id : 'error',
icon : 'error',
lock : true,
fixed : true,
background : "#CCCCCC",
opacity : 0,
content : errorArr[0].message,
cancelVal : '确定',
cancel : function() {
$(errorArr[0].element).focus();
}
});
} catch (err) {
}
},
//验证规则
rules : {
'title' : {
required : 1
},
'content' : {
editorcontent : true
}
},
//验证未通过提示消息
messages : {
'title' : {
required : '请输入标题'
},
'content' : {
editorcontent : '内容不能为空'
}
},
//给未通过验证的元素加效果,闪烁等
highlight : false,
//是否在获取焦点时验证
onfocusout : false,
//验证通过,提交表单
submitHandler : function(forms) {
$(forms).ajaxSubmit({
url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
dataType : 'json',
beforeSubmit : function(arr, $form, options) {
},
success : function(data, statusText, xhr, $form) {
if (data.status) {
setCookie("refersh_time", 1);
//添加成功
Wind.use("artDialog", function() {
art.dialog({
id : "succeed",
icon : "succeed",
fixed : true,
lock : true,
background : "#CCCCCC",
opacity : 0,
content : data.info,
button : [ {
name : '继续编辑?',
callback : function() {
//reloadPage(window);
return true;
},
focus : true
}, {
name : '返回列表页',
callback : function() {
location = "{:U('Message/index')}";
return true;
}
} ]
});
});
} else {
artdialog_alert(data.info);
}
}
});
}
});
});
////-------------------------
});
</script>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:U('Message/index')}">站内信</a></li>
<li><a href="{:U('Message/add')}">添加站内信</a></li>
</ul>
<form method="post" class="js-ajax-form" action="{:U('Message/listorders')}">
<div class="table-actions">
<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SORT')}</button>
<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Message/toggle',array('display'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Message/toggle',array('hide'=>1))}" data-subcheck="true">{:L('HIDE')}</button>
</div>
<php>$status=array("1"=>L('DISPLAY'),"0"=>L('HIDDEN'));</php>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
<th width="50">{:L('SORT')}</th>
<th width="50">ID</th>
<th>标题</th>
<th>描述</th>
<th>添加时间</th>
<th width="45">{:L('STATUS')}</th>
<th width="120">{:L('ACTIONS')}</th>
</tr>
</thead>
<tbody>
<foreach name="message" item="vo">
<tr>
<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
<td><input name='listorders[{$vo.id}]' class="input input-order mr5" type='text' size='3' value='{$vo.listorder}'></td>
<td>{$vo.id}</td>
<td>{$vo.title}</td>
<td>{$vo.description}</td>
<td>{:date('Y-m-d H:i',$vo['ctime'])}</td>
<td>{$status[$vo['status']]}</td>
<td>
<a href="{:U('Message/edit',array('id'=>$vo['id']))}">{:L('EDIT')}</a>|
<a href="{:U('Message/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
<tfoot>
<tr>
<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
<th width="50">{:L('SORT')}</th>
<th width="50">ID</th>
<th>标题</th>
<th>描述</th>
<th>添加时间</th>
<th width="45">{:L('STATUS')}</th>
<th width="120">{:L('ACTIONS')}</th>
</tr>
</tfoot>
</table>
<div class="table-actions">
<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SORT')}</button>
<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Message/toggle',array('display'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Message/toggle',array('hide'=>1))}" data-subcheck="true">{:L('HIDE')}</button>
</div>
</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">订单列表</a></li>
</ul>
<form class="well form-search" method="post" action="{:U('Order/index')}">
时间:
<input type="text" name="start_time" class="js-datetime" value="{$formget.start_time|default=''}" style="width: 120px;" autocomplete="off">-
<input type="text" class="js-datetime" name="end_time" value="{$formget.end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp; &nbsp;
关键字:
<input type="text" name="keyword" style="width: 200px;" value="{$keyword|default=''}" placeholder="请输入关键字...">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:U('Order/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
<!--<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('Order/delete')}" data-subcheck="true" data-msg="您确定删除吗?">{:L('DELETE')}</button>-->
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<!--<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>-->
<th width="50">ID</th>
<th>用户id</th>
<th>订单号</th>
<th>所在省市</th>
<th>详细地址</th>
<th>收货人</th>
<th>联系电话</th>
<th>订单金额</th>
<th width="100">提交时间</th>
<th>订单状态</th>
<th width="70">操作</th>
</tr>
</thead>
<foreach name="list" item="vo">
<tr>
<!--<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>-->
<td><b>{$vo.id}</b></td>
<td>{$vo.user_id}</td>
<td>{$vo.order_sn}</td>
<td>{$vo.province}{$vo.city}{$vo.region}</td>
<td>{$vo.address}</td>
<td>{$vo.realname}</td>
<td>{$vo.mobile}</td>
<td>{$vo.price_count}</td>
<td>{:date('Y-m-d H:i',$vo['ctime'])}</td>
<td>
<eq name="vo.status" value="1">未付款</eq><eq name="vo.status" value="2">待发货</eq>
<eq name="vo.status" value="3">已发货</eq><eq name="vo.status" value="4">待评价</eq>
<eq name="vo.status" value="5">已完成</eq><eq name="vo.status" value="6">已取消</eq>
</td>
<td>
<a href="{:U('Order/view',array('id'=>$vo['id']))}">查看</a> |
<eq name="vo.status" value="2">
<a href="{:U('Order/send',array('id'=>$vo['id']))}">去发货</a> |
</eq>
<eq name="vo.status" value="1">
<a href="{:U('Order/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">删除</a>
</eq>
</td>
</tr>
</foreach>
<tfoot>
<tr>
<!--<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>-->
<th width="50">ID</th>
<th>用户id</th>
<th>订单号</th>
<th>所在省市</th>
<th>详细地址</th>
<th>收货人</th>
<th>联系电话</th>
<th>订单金额</th>
<th width="100">提交时间</th>
<th>订单状态</th>
<th width="70">操作</th>
</tr>
</tfoot>
</table>
<div class="table-actions">
<!--<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('Order/delete')}" data-subcheck="true" data-msg="你确定删除吗?">{:L('DELETE')}</button>-->
</div>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -12,58 +12,113 @@ use Common\Controller\AdminbaseController;
class MessageController extends AdminbaseController {
function _initialize() {
protected $message_model;
public function _initialize() {
parent::_initialize();
$this->message_model = D("Common/Message");
}
// 获取站内信列表
public function index() {
$this->_lists(array("is_del"=>0));
// 后台站内信列表
public function index(){
$message=$this->message_model->order(array("listorder"=>"ASC"))->select();
$this->assign("message",$message);
$this->display();
}
// 站内信添加
public function add(){
$userList = M('User')->select();
$this->assign('userList', $userList);
$this->display();
}
/**
* 在线调查列表处理方法,根据不同条件显示不同的列表
* @param array $where 查询条件
*/
private function _lists($where=array()){
$start_time = I('request.start_time');
if(!empty($start_time)){
$where['ctime']=array(
array('EGT',$start_time)
);
// 站内信添加提交
public function add_post(){
if(IS_POST){
$_POST['userids'] = implode(',', I('post.userids'));
$_POST['content'] = htmlspecialchars_decode(I('post.content'));
if ($this->message_model->create()!==false) {
if ($this->message_model->add()!==false) {
$this->success("添加成功!", U("Message/index"));
} else {
$this->error("添加失败!");
}
} else {
$this->error($this->message_model->getError());
}
}
}
$end_time = I('request.end_time');
if(!empty($end_time)){
if(empty($where['ctime'])){
$where['ctime']=array();
// 站内信编辑
public function edit(){
$id=I("get.id",0,'intval');
$userList = M('User')->select();
$this->assign('userList', $userList);
$message=$this->message_model->where(array('id'=>$id))->find();
$this->assign($message);
$this->display();
}
// 站内信编辑
public function edit_post(){
if (IS_POST) {
$_POST['userids'] = implode(',', I('post.userids'));
$_POST['content'] = htmlspecialchars_decode(I('post.content'));
if ($this->message_model->create()!==false) {
if ($this->message_model->save()!==false) {
$this->success("保存成功!");
} else {
$this->error("保存失败!");
}
} else {
$this->error($this->message_model->getError());
}
array_push($where['ctime'], array('ELT',$end_time));
}
}
$keyword = I('request.keyword');
if(!empty($keyword)){
$where['name']=array('like',"%$keyword%");
// 站内信排序
public function listorders() {
$status = parent::_listorders($this->message_model);
if ($status) {
$this->success("排序更新成功!");
} else {
$this->error("排序更新失败!");
}
}
$this->message_model
->where($where);
$count = $this->message_model->count();
// 站内信删除
public function delete(){
if(isset($_POST['ids'])){
$page = $this->page($count, 20);
}else{
$id = I("get.id",0,'intval');
if ($this->message_model->where(array('id'=>$id))->save(array('is_del'=>1))!==false) {
$this->success("删除成功!");
} else {
$this->error("删除失败!");
}
}
}
$posts = $this->message_model
->where($where)
->limit($page->firstRow , $page->listRows)
->order("ctime DESC")
->select();
// 站内信显示/隐藏
public function toggle(){
if(isset($_POST['ids']) && $_GET["display"]){
$ids = I('post.ids/a');
if ($this->message_model->where(array('id'=>array('in',$ids)))->save(array('status'=>1))!==false) {
$this->success("显示成功!");
} else {
$this->error("显示失败!");
}
}
$this->assign("page", $page->show('Admin'));
$this->assign("formget",array_merge($_GET,$_POST));
$this->assign("posts",$posts);
if(isset($_POST['ids']) && $_GET["hide"]){
$ids = I('post.ids/a');
if ($this->message_model->where(array('id'=>array('in',$ids)))->save(array('status'=>1))!==false) {
$this->success("隐藏成功!");
} else {
$this->error("隐藏失败!");
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/5/8
* Time: 15:19
*/
namespace Admin\Controller;
use Common\Controller\AdminbaseController;
class OrderController extends AdminbaseController {
protected $order_model;
protected $order_detail_model;
protected $goods_model;
protected $product_model;
function _initialize() {
parent::_initialize();
$this->order_model = D("Common/Order");
$this->order_detail_model = D("Common/OrderDetail");
$this->goods_model = D("Common/Goods");
$this->product_model = D("Common/Product");
}
// 订单列表
public function index() {
$this->assign('list', $this->order_model->getList(I('get.p'), I('post.keyword'), strtotime(I('post.start_time')), strtotime(I('post.end_time'))));
$count = $this->order_model->getCount(I('post.keyword'), strtotime(I('post.start_time')), strtotime(I('post.end_time')));
$page = $this->page($count, C('MAX_PAGE_NUM'));
$this->assign('page', $page->show('Admin'));
$this->assign('formget', I('post.'));
$this->assign('keyword', I('post.keyword'));
$this->display();
}
// 查看
public function view(){
$id = I("get.id",0,'intval');
$info = $this->will_user_apply_model->where(array('id'=>$id, 'is_del'=>0))->find();
$info['images'] = explode(',', $info['images']);
$this->assign($info);
$this->display();
}
//用户认证编辑
public function edit_post(){
if(IS_POST) {
$post = I('post.');
$id = I('post.id');
$user_id = $this->will_user_apply_model->where(array('id'=>$id))->getField('user_id');
if($this->will_user_apply_model->save($post)) {
if(I('post.status') == 2) {
$this->user_model->where(array('id'=>$user_id))->save(array('status'=>2,'join_time'=>time()));
} else {
$this->user_model->where(array('id'=>$user_id))->save(array('status'=>1));
}
$this->success('保存成功');
} else {
$this->error('保存失败');
}
}
}
// 删除
public function delete(){
if(I('get.id')){
$id = I("get.id",0,'intval');
if ($this->will_produce_apply_model->where(array('id'=>$id))->save(array('is_del'=>1,'dtime'=>time())) !==false) {
$this->success("删除成功!");
} else {
$this->error("删除失败!");
}
}
if(I('post.ids')){
$ids = I('post.ids/a');
if (!$this->will_produce_apply_model->where(array('id'=>array('in',$ids)))->save(array('is_del'=>1,'dtime'=>time()))) {
$this->error("删除失败!");
}
$this->success("删除成功!");
}
}
}
\ No newline at end of file
... ...
... ... @@ -16,24 +16,30 @@ class MessageModel extends CommonModel {
protected $_validate = array(
//array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
array('title', 'require', '标题不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('smeta', 'require', '缩略图不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
// array('smeta', 'require', '缩略图不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('userids', 'require', '接收用户不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('description', 'require', '描述不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('content', 'require', '内容不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
);
// 获取站内信列表
public function getList($keyword = null) {
public function getList($user_id = null, $keyword = null) {
$where['is_del'] = 0;
if($keyword) {
$where['title'] = array('like', '%'.$keyword.'%');
}
if($user_id) {
$where['userids'] = array('like', '%'.$user_id.'%');
}
return $this->where($where)->select();
}
// 获取站内信详情
public function getInfo($id) {
public function getInfo($user_id = null) {
$where['is_del'] = 0;
$where['id'] = $id;
if($user_id) {
$where['userids'] = array('like', '%'.$user_id.'%');
}
return $this->where($where)->find();
}
}
\ No newline at end of file
... ...
... ... @@ -29,12 +29,18 @@ class OrderModel extends CommonModel {
);
// 获取订单列表
public function getList($keyword = null) {
public function getList($page_num, $keyword = null, $start_time = null, $end_time = null) {
$perPage = 25;
$where['is_del'] = 0;
if($keyword) {
$where['order_sn'] = array('like', '%'.$keyword.'%');
}
return $this->where($where)->select();
if($start_time && $end_time) {
$where['ctime'] = array('between', array($start_time,$end_time));
}
return $this->where($where)
->page($page_num, $perPage)
->select();
}
// 获取订单列表(前台个人中心)
... ... @@ -73,4 +79,22 @@ class OrderModel extends CommonModel {
$where['status'] = $status;
return $this->where($where)->count();
}
/**
* 获取数据总数
* @author Liuzhen
*/
public function getCount($keyword = null, $start_time = null, $end_time = null) {
$where = array();
if($keyword) {
$where['order_sn'] = array('like', '%'.$keyword.'%');
}
if($start_time && $end_time) {
$where['ctime'] = array('between', array($start_time,$end_time));
}
$where['is_del'] = 0;
$count = $this->where($where)
->count();
return $count;
}
}
\ No newline at end of file
... ...
... ... @@ -26,12 +26,9 @@ class UserAddressModel extends CommonModel {
// 获取用户地址列表
public function getList($user_id) {
$where['a.is_del'] = 0;
$where['a.user_id'] = $user_id;
return $this->field(array('a.*,u.default_addressid'))
->alias('a')
->join('__USER__ as u on a.user_id = u.id')
->where($where)
$where['is_del'] = 0;
$where['user_id'] = $user_id;
return $this->where($where)
->select();
}
... ...
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/5/8
* Time: 19:16
*/
namespace Common\Model;
use Common\Model\CommonModel;
class UserFavoritesModel extends CommonModel {
// 获取用户收藏列表
public function getList($user_id) {
$where['uid'] = $user_id;
return $this->where($where)
->select();
}
// 获取用户收藏详情
public function getInfo($user_id, $goods_id) {
$where['uid'] = $user_id;
$where['object_id'] = $goods_id;
return $this->where($where)->find();
}
}
\ No newline at end of file
... ...
... ... @@ -34,4 +34,10 @@ class UserModel extends CommonModel {
$data['password']=sp_password($data['password']);
}
}
// 获取默认地址ID
public function defaultAddressid($user_id) {
$where['id'] = $user_id;
return $this->where($where)->getField('default_addressid');
}
}
\ No newline at end of file
... ...
... ... @@ -33,7 +33,8 @@ class WillUserApplyModel extends CommonModel {
);
// 获取入会申请列表
public function getList($keyword = null, $start_time = null, $end_time = null) {
public function getList($page_num, $keyword = null, $start_time = null, $end_time = null) {
$perPage = 25;
$where['is_del'] = 0;
if($keyword) {
$where['name'] = array('like', '%'.$keyword.'%');
... ... @@ -41,7 +42,9 @@ class WillUserApplyModel extends CommonModel {
if($start_time && $end_time) {
$where['ctime'] = array('between', array($start_time,$end_time));
}
return $this->where($where)->select();
return $this->where($where)
->page($page_num, $perPage)
->select();
}
// 获取入会申请详情
... ...
... ... @@ -54,7 +54,6 @@ class AdminPostController extends AdminbaseController {
}
}
$_POST['smeta']['thumb'] = sp_asset_relative_url($_POST['smeta']['thumb']);
$_POST['post']['post_modified']=date("Y-m-d H:i:s",time());
$_POST['post']['post_author']=get_current_admin_id();
$article=I("post.post");
... ...
... ... @@ -16,6 +16,7 @@ class GoodsController extends HomebaseController {
protected $goods_model;
protected $goods_brand_model;
protected $product_model;
protected $user_favorites_model;
function _initialize() {
parent::_initialize();
... ... @@ -23,6 +24,7 @@ class GoodsController extends HomebaseController {
$this->goods_model = D("Common/Goods");
$this->goods_brand_model = D("Common/GoodsBrand");
$this->product_model = D("Common/Product");
$this->user_favorites_model = D("Common/UserFavorites");
}
// 商品首页
... ... @@ -56,6 +58,15 @@ class GoodsController extends HomebaseController {
} else {
$this->error('参数错误');
}
$user_id = sp_get_current_userid();
foreach($goodsList as $k=>$v) {
if($user_id) {
$favorite = $this->user_favorites_model->getInfo($user_id, $v['id']);
if ($favorite) {
$goodsList[$k]['is_favorite'] = 1;
}
}
}
$this->assign('list', $goodsList);
$this->display();
}
... ... @@ -64,6 +75,13 @@ class GoodsController extends HomebaseController {
public function detail() {
$id = I('get.id',0,'intval');
$user_id = sp_get_current_userid();
if($user_id) {
$favorite = $this->user_favorites_model->getInfo($user_id,$id);
if($favorite) {
$this->assign('is_favorite',1);
}
}
// 调用最新添加的2个商品
$news = $this->goods_model->where(array('is_del'=>0,'id'=>array('neq',$id)))->order(array('ctime'=>'DESC'))->limit(2)->select();
$info = $this->goods_model->getInfo($id);
... ... @@ -74,6 +92,66 @@ class GoodsController extends HomebaseController {
}
/**
* 修改商品数量
* @param id 商品id
* @param sort 类型(增加/减少)
*/
public function changeNum() {
if(IS_AJAX) {
$id = I('post.id',0,'intval');
$sort = I('post.sort');
$num = I('post.num',0,'intval');
if($sort == 'reduce') {
$num = -1;
}
// 判断传参是否正常
if(!$num) {
$this->ajaxReturn(array('status'=>false,'msg'=>'请输入正确的商品数量'));
}
// 判断购物车及商品数据
$goods_num = $this->goods_model->getInfoNum($id);
if($num>$goods_num) {
$this->ajaxReturn(array('status'=>false,'msg'=>'商品库存不足'));
}
$info['sort'] = $sort;
$info['num'] = $num;
$info['goods_num'] = $goods_num;
$this->ajaxReturn(array('status'=>true,'msg'=>'修改成功','data'=>$info));
} else {
$this->error('非法操作');
}
}
/**
* 立即购买
* @param id 商品id
* @param num 商品数量
*/
public function buy() {
if(IS_AJAX) {
$user_id = sp_get_current_userid();
if(!$user_id) {
$this->ajaxReturn(array('status'=>false,'msg'=>'请先登录'));
}
$id = I('post.id',0,'intval');
$num = I('post.num',0,'intval');
// 判断传参是否正常
if(!$num) {
$this->ajaxReturn(array('status'=>false,'msg'=>'请输入正确的商品数量'));
}
// 判断购物车及商品数据
$goods_num = $this->goods_model->getInfoNum($id);
if($num>$goods_num) {
$this->ajaxReturn(array('status'=>false,'msg'=>'商品库存不足'));
}
$redirect_url = U('User/Cart/confirm',array('id'=>$id,'num'=>$num));
$this->ajaxReturn(array('status'=>true,'msg'=>'成功','data'=>$redirect_url));
} else {
$this->error('非法操作');
}
}
/**
* 加入购物车
*/
public function addCart() {
... ...
... ... @@ -23,6 +23,8 @@ class AddressController extends MemberbaseController {
//地址列表
public function index() {
$list = $this->user_address_model->getList($this->userid);
$default_addressid = $this->user_model->defaultAddressid($this->userid);
$this->assign('default_addressid',$default_addressid);
$this->assign('addressList',$list);
$this->display();
}
... ... @@ -32,6 +34,24 @@ class AddressController extends MemberbaseController {
$this->display();
}
// 添加收货地址
public function addAddress() {
if(IS_AJAX) {
$info = I('post.');
$info['user_id'] = $this->userid;
$info['ctime'] = time();
if(!$this->user_address_model->create($info)) {
$this->ajaxReturn(array('status'=>false,'msg'=>$this->user_address_model->getError(),'data'=>I('post.')));
}
if(!$this->user_address_model->add($info)) {
$this->ajaxReturn(array('status'=>false,'msg'=>'添加失败'));
}
$this->ajaxReturn(array('status'=>true,'msg'=>'添加成功'));
} else {
$this->error('非法操作');
}
}
//编辑地址
public function edit() {
$id = I('get.id',0,'intval');
... ... @@ -41,4 +61,57 @@ class AddressController extends MemberbaseController {
}
$this->display();
}
// 编辑收货地址
public function editAddress() {
if(IS_AJAX) {
$info = I('post.');
$info['user_id'] = $this->userid;
$info['utime'] = time();
if(!$this->user_address_model->create($info)) {
$this->ajaxReturn(array('status'=>false,'msg'=>$this->user_address_model->getError()));
}
if(!$this->user_address_model->save($info)) {
$this->ajaxReturn(array('status'=>false,'msg'=>'修改失败'));
}
$this->ajaxReturn(array('status'=>true,'msg'=>'修改成功'));
} else {
$this->error('非法操作');
}
}
// 修改默认收货地址
public function default_address() {
if(IS_AJAX) {
$id = I('post.id',0,'intval');
$info = $this->user_address_model->getInfo($id);
if(!$info) {
$this->ajaxReturn(array('status'=>false,'msg'=>'地址不存在'));
}
if($info['user_id'] != $this->userid) {
$this->ajaxReturn(array('status'=>false,'msg'=>'地址与用户信息不匹配'));
}
$this->user_model->where(array('id'=>$this->userid))->save(array('default_addressid'=>$id));
$this->ajaxReturn(array('status'=>true,'msg'=>'修改默认地址成功'));
} else {
$this->error('非法操作');
}
}
// 删除收货地址
public function delAddress() {
if(IS_AJAX) {
$id = I('post.id',0,'intval');
if(!$this->user_address_model->where(array('id'=>$id))->delete()) {
$this->ajaxReturn(array('status'=>false,'msg'=>'收货地址删除失败'));
}
$this->ajaxReturn(array('status'=>true,'msg'=>'删除成功'));
} else {
$id = I('get.id',0,'intval');
if(!$this->user_address_model->where(array('id'=>$id,'user_id'=>$this->userid))->delete()) {
$this->error('收货地址删除失败');
}
$this->success('删除成功');
}
}
}
\ No newline at end of file
... ...
... ... @@ -13,6 +13,7 @@ use Common\Controller\MemberbaseController;
class CartController extends MemberbaseController {
protected $cart_model;
protected $user_address_model;
protected $goods_model;
protected $goods_brand_model;
protected $product_model;
... ... @@ -22,6 +23,7 @@ class CartController extends MemberbaseController {
function _initialize() {
parent::_initialize();
$this->cart_model = D("Common/Cart");
$this->user_address_model = D("Common/UserAddress");
$this->goods_model = D("Common/Goods");
$this->goods_brand_model = D("Common/GoodsBrand");
$this->product_model = D("Common/Product");
... ... @@ -136,18 +138,47 @@ class CartController extends MemberbaseController {
*/
public function confirm() {
if(IS_GET) {
$ids = explode(',',I('get.ids'));
$cartList = $this->cart_model->getListConfirmByUser($this->userid,$ids);
if(!$ids || !$cartList) {
$this->error('未选择购买商品或订单已生成');
}
$count_amount = 0;
foreach($cartList as $k=>$v) {
$cartList[$k]['amount'] = $v['goods_price']*$v['num'];
$count_amount += $cartList[$k]['amount'];
if(I('get.id',0,'intval') && I('get.num',0,'intval')) {
$id = I('get.id');
$num = I('get.num');
// 判断购物车及商品数据
$goods_num = $this->goods_model->getInfoNum($id);
if($num>$goods_num) {
$this->error('商品库存不足');
}
$cartList[] = $this->goods_model->getInfo($id);
$count_amount = 0;
foreach($cartList as $k=>$v) {
$cartList[$k]['amount'] = $v['goods_price']*$num;
$cartList[$k]['num'] = $num;
$cartList[$k]['goods_id'] = $v['id'];
$count_amount += $cartList[$k]['amount'];
}
$this->assign('sort',1);
$this->assign('num',$num);
$this->assign('cartList',$cartList);
$this->assign('count_amount', $count_amount);
}elseif(I('get.ids')) {
$ids = explode(',',I('get.ids'));
$cartList = $this->cart_model->getListConfirmByUser($this->userid,$ids);
if(!$ids || !$cartList) {
$this->error('未选择购买商品或订单已生成');
}
$count_amount = 0;
foreach($cartList as $k=>$v) {
$cartList[$k]['amount'] = $v['goods_price']*$v['num'];
$count_amount += $cartList[$k]['amount'];
}
$this->assign('sort',2);
$this->assign('cartList',$cartList);
$this->assign('count_amount', $count_amount);
} else {
$this->error('参数错误');
}
$this->assign('cartList',$cartList);
$this->assign('count_amount', $count_amount);
$addressList = $this->user_address_model->getList($this->userid);
$this->assign('addressList',$addressList);
$default_addressid = $this->user_model->defaultAddressid($this->userid);
$this->assign('default_addressid',$default_addressid);
$this->display();
} else {
$this->error('非法操作');
... ... @@ -162,14 +193,25 @@ class CartController extends MemberbaseController {
public function createOrder() {
if(IS_AJAX) {
$user_id = $info['user_id'] = sp_get_current_userid();
$info['address_id'] = $address_id = I('post.address_id',0,'intval');
$address_id = I('post.address_id',0,'intval');
$addressInfo = $this->user_address_model->getInfo($address_id);
$sort = I('post.sort');
$ids = I('post.ids');
if(!$ids) {
$this->ajaxReturn(array('status'=>false,'msg'=>'参数错误'));
}
$list = $this->cart_model->getListConfirmByUser($user_id,$ids);
if($sort == 1) {
$num = I('post.num');
$goods = $this->goods_model->getInfo($ids[0]);
$goods['goods_id'] = $goods['id'];
$goods['num'] = $num;
$list[0] = $goods;
}
if($sort == 2) {
$list = $this->cart_model->getListConfirmByUser($user_id,$ids);
}
if(!$list) {
$this->ajaxReturn(array('status'=>false,'msg'=>'购物车商品获取失败,请重新购买'));
$this->ajaxReturn(array('status'=>false,'msg'=>'商品获取失败,请重新购买'));
}
$count_amount = 0;
foreach($list as $k=>$v) {
... ... @@ -179,6 +221,12 @@ class CartController extends MemberbaseController {
M('Order')->startTrans();
$order_model = D('Common/Order');
$order_detail_model = D('Common/OrderDetail');
$info['province'] = $addressInfo['province'];
$info['city'] = $addressInfo['city'];
$info['region'] = $addressInfo['region'];
$info['address'] = $addressInfo['address'];
$info['realname'] = $addressInfo['realname'];
$info['mobile'] = $addressInfo['mobile'];
$info['order_sn'] = $detail['order_sn'] = sp_get_order_sn();
$info['status'] = 1;
$info['price_count'] = $count_amount;
... ... @@ -209,10 +257,12 @@ class CartController extends MemberbaseController {
$this->ajaxReturn(array('status'=>false,'msg'=>'添加订单失败'));
}
}
$result = $this->cart_model->where(array('goods_id'=>array('in',$ids),'user_id'=>$user_id))->delete();
if(!$result) {
M('Order')->rollback();
$this->ajaxReturn(array('status'=>false,'msg'=>'删除购物车商品失败'));
if($sort == 2) {
$result = $this->cart_model->where(array('goods_id'=>array('in',$ids),'user_id'=>$user_id))->delete();
if(!$result) {
M('Order')->rollback();
$this->ajaxReturn(array('status'=>false,'msg'=>'删除购物车商品失败'));
}
}
M('Order')->commit();
$redirect_url = U('User/Cart/pay',array('id'=>$order_id));
... ...
... ... @@ -39,14 +39,16 @@ class FavoriteController extends MemberbaseController{
// 用户收藏
public function do_favorite(){
$key=sp_authcode(I('post.key'));
if($key){
$authkey=C("AUTHCODE");
$key=explode(" ", $key);
$authcode=$key[0];
if($authcode==C("AUTHCODE")){
$table=$key[1];
$object_id=$key[2];
// $key=sp_authcode(I('post.key'));
// if($key){
// $authkey=C("AUTHCODE");
// $key=explode(" ", $key);
// $authcode=$key[0];
// if($authcode==C("AUTHCODE")){
// $table=$key[1];
// $object_id=$key[2];
$table='goods';
$object_id=I('post.goods_id');
$post=I("post.");
unset($post['key']);
$post['table']=$table;
... ... @@ -57,22 +59,27 @@ class FavoriteController extends MemberbaseController{
$user_favorites_model=M("UserFavorites");
$find_favorite=$user_favorites_model->where(array('table'=>$table,'object_id'=>$object_id,'uid'=>$uid))->find();
if($find_favorite){
$this->error("亲,您已收藏过啦!");
$result=$user_favorites_model->where(array('object_id'=>$object_id,'uid'=>$uid))->delete();
if($result){
$this->ajaxReturn(array('status'=>true,'msg'=>"取消收藏成功!"));
}else {
$this->ajaxReturn(array('status'=>false,'msg'=>"取消收藏失败!"));
}
}else {
$post['createtime']=time();
$result=$user_favorites_model->add($post);
if($result){
$this->success("收藏成功!");
$this->ajaxReturn(array('status'=>true,'msg'=>"收藏成功!"));
}else {
$this->error("收藏失败!");
$this->ajaxReturn(array('status'=>false,'msg'=>"收藏失败!"));
}
}
}else{
$this->error("非法操作,无合法密钥!");
}
}else{
$this->error("非法操作,无密钥!");
}
// }else{
// $this->error("非法操作,无合法密钥!");
// }
// }else{
// $this->error("非法操作,无密钥!");
// }
}
... ...
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/5/8
* Time: 19:28
*/
namespace User\Controller;
use Common\Controller\MemberbaseController;
class MessageController extends MemberbaseController {
protected $message_model;
protected $message_user_log_model;
function _initialize(){
parent::_initialize();
$this->message_model = D('Common/Message');
$this->message_user_log_model = D('Common/MessageUserLog');
$this->assign('message','active');
}
//站内信列表
public function index() {
$list = $this->message_model->getList($this->userid);
foreach($list as $k=>$v) {
$read = $this->message_user_log_model->check($this->userid,$v['id']);
if($read) {
$unreadList[] = $v;
unset($list[$k]);
}
}
$this->assign('messageList',$list);
$this->assign('unReadMessageList',$unreadList);
$this->display();
}
//站内信详情
public function detail() {
$id = I('get.id',0,'intval');
if(!$id) {
$this->error('参数错误');
}
$info = $this->message_model->getInfo($this->userid);
if(!$info) {
$this->error('未授权查看该站内信');
}
$read = $this->message_user_log_model->check($this->userid,$id);
if(!$read) {
$info['message_id'] = $id;
$info['user_id'] = $this->userid;
$info['rtime'] = time();
$this->message_user_log_model->add($info);
}
$this->assign('messageInfo',$info);
$this->display();
}
}
\ No newline at end of file
... ...
... ... @@ -48,17 +48,21 @@
<div class="hd">
数量:
</div>
<div class="total-number sku-count">
<div class="total-number sku-count" data-id="{$id}">
<input type="button" class="btn-less" />
<input type="text" name="num" class="numberbox" value="1"/>
<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="num" class="numberbox" value="1" data-old="0"/>
<input type="button" class="btn-plus" />
</div>
<div class="ft">
<a href="javascript:;" class="btn-collect"><span>收藏</span></a>
<eq name="is_favorite" value="1">
<a href="javascript:;" class="btn-collect active"><span>已收藏</span></a>
<else/>
<a href="javascript:;" class="btn-collect"><span>收藏</span></a>
</eq>
</div>
</div>
<div class="sku-button">
<a href="javascript:;" class="btn-lg">立即购买</a>
<a href="javascript:;" class="btn-lg btn-buy">立即购买</a>
<a href="javascript:;" class="btn-lg btn-addCart"><span>加入购物车</span></a>
</div>
</div>
... ... @@ -148,6 +152,14 @@
<tc_include file="Public:footer"/>
<!-- js -->
<script>
var param = {
changeNum : "{:U('Portal/Goods/changeNum')}",
buy:"{:U('Portal/Goods/buy')}",
id:"{$id}",
do_favorite:"{:U('User/Favorite/do_favorite')}",
};
</script>
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/jquery.SuperSlide.js"></script>
<script src="__TMPL__Public/assets/js/pcGlasses.js"></script>
... ...
... ... @@ -119,7 +119,11 @@
<div class="coll-des">{$vo.short_name}</div>
<div class="coll-action">
<a href="###" class="btn-addcart">加入购物车</a>
<a href="javascript:;" class="btn-care">收藏</a>
<eq name="vo.is_favorite" value="1">
<a href="javascript:;" class="btn-care active"><span>已收藏</span></a>
<else/>
<a href="javascript:;" class="btn-care"><span>收藏</span></a>
</eq>
</div>
</div>
</div>
... ... @@ -152,6 +156,11 @@
<tc_include file="Public:footer"/>
<!-- js -->
<script>
var param = {
do_favorite:"{:U('User/Favorite/do_favorite')}",
};
</script>
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/shop.js"></script>
<tc_include file="Portal/Goods:script"/>
... ...
... ... @@ -17,5 +17,31 @@ $(function(){
$('.coll-popover').removeClass('show');
$(this).parents('li').remove()
})
$('.table-main').on('click','.m-check',function(){
var id = $(this).parents('.t-table').data('id');
var btn = $(this);
var data = {
id:id
};
$.ajax({
url:param.default_address,
type:"POST",
data:data,
dateType:"json",
success:function (data) {
console.log(data);
if(data.status) {
$('.m-check').prop('checked',false);
btn.prop('checked',true);
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
}
});
});
});
\ No newline at end of file
... ...
$(function(){
//支付
$('.pay-box').click(function(){
var type = $(this).data('id');
var id = $(this).parent().data('id');
$(this).addClass('active').siblings('.pay-box').removeClass('active');
//支付
$('.pay-box').click(function(){
var type = $(this).data('id');
var id = $(this).parent().data('id');
$(this).addClass('active').siblings('.pay-box').removeClass('active');
$.ajax({
url:param.changePay,
type:"POST",
... ... @@ -23,111 +23,152 @@ $(function(){
alert(e);
}
});
});
$('.wechat-radio').change(function(){
if($(this).is(":checked")){
$('.pay-in-weixin').show();
}
});
$('.alipay-radio').change(function(){
if($(this).is(":checked")){
$('.pay-in-weixin').hide();
}
});
//地址
$('.ads-box').click(function(){
$('.ads-box').removeClass('active')
$(this).addClass('active')
});
//全选
$('#checkAll').click(function(event) {
if($(this).hasClass('active')){
$('.cart-list .cart-check').prop('checked',false);
$(this).removeClass('active')
}else{
$('.cart-list .cart-check').prop('checked',true);
$(this).addClass('active')
}
});
});
$('.wechat-radio').change(function(){
if($(this).is(":checked")){
$('.pay-in-weixin').show();
}
});
$('.alipay-radio').change(function(){
if($(this).is(":checked")){
$('.pay-in-weixin').hide();
}
});
//单选
//地址
$('.ads-box').click(function(){
$('.ads-box').removeClass('active')
$(this).addClass('active')
});
//全选
$('#checkAll').click(function(event) {
if($(this).hasClass('active')){
$('.cart-list .cart-check').prop('checked',false);
$(this).removeClass('active')
}else{
$('.cart-list .cart-check').prop('checked',true);
$(this).addClass('active')
}
});
//单选
var length = $('.cart-check').length-1;
$('.cart-check').click(function() {
$(this).toggleClass('chrenActive');
$('.cart-check').click(function() {
$(this).toggleClass('chrenActive');
var chrenLength = $('.chrenActive').length;
if(length==chrenLength){
$('#checkAll').prop('checked',true);
$('#checkAll').addClass('active');
}else{
}else{
$('#checkAll').prop('checked',false);
$('#checkAll').removeClass('active');
}
coin();
});
//数字
$('.total-number').each(function(){
var sort = '';
var t = $(this).find(".numberbox");
}
coin();
});
//数字
$('.total-number').each(function(){
var sort = '';
var t = $(this).find(".numberbox");
var id = $(this).parents('.cart-cell').data('id');
$(this).find(".btn-plus").click(function(){
sort = 'plus';
if (parseInt(t.val())!=1){
$('.btn-less').attr('disabled',false);
}
change(id, sort, 1, $(this));
});
$(this).find(".btn-less").click(function(){
if (parseInt(t.val())<=1){
$(this).siblings(".numberbox").val(1);
} else {
sort = 'reduce';
change(id, sort, 1, $(this));
}
});
});
if(!id) {
id = $(this).data('id');
$(this).find(".btn-plus").click(function(){
var num = parseInt($(this).parent().find(".numberbox").val());
sort = 'plus';
if (parseInt(t.val())!=1){
$('.btn-less').attr('disabled',false);
}
change(id, sort, num+1, $(this));
});
$(this).find(".btn-less").click(function(){
var num = parseInt($(this).parent().find(".numberbox").val());
if (parseInt(t.val())<=1){
$(this).siblings(".numberbox").val(1);
} else {
sort = 'reduce';
change(id, sort, num-1, $(this));
}
});
} else {
$(this).find(".btn-plus").click(function(){
sort = 'plus';
if (parseInt(t.val())!=1){
$('.btn-less').attr('disabled',false);
}
change(id, sort, 1, $(this));
});
$(this).find(".btn-less").click(function(){
if (parseInt(t.val())<=1){
$(this).siblings(".numberbox").val(1);
} else {
sort = 'reduce';
change(id, sort, 1, $(this));
}
});
}
});
// 数量输入框
// 数量输入框(购物车)
$('.p-table-border').on('focus','.numberbox',function(){
var id = $(this).parents('.cart-cell').data('id');
var num = $(this).val();
$(this).data('old',num);
});
// 数量输入框
$('.p-table-border').on('blur','.numberbox',function(){
var id = $(this).parents('.cart-cell').data('id');
// 数量输入框(购物车)
$('.p-table-border').on('blur','.numberbox',function(){
var id = $(this).parents('.cart-cell').data('id');
var num = $(this).val();
if(typeof num == 'undefined' || num<1) {
$(this).val($(this).data('old'));
} else {
change(id, 'change', num, $(this));
}
});
// 数量输入框(商品详情)
$('.itemInfo-wrap').on('focus','.numberbox',function(){
var id = $(this).parent().data('id');
var num = $(this).val();
$(this).data('old',num);
});
// 数量输入框(商品详情)
$('.itemInfo-wrap').on('blur','.numberbox',function(){
var id = $(this).parent().data('id');
var num = $(this).val();
if(typeof num == 'undefined' || num<1) {
if(typeof num == 'undefined' || num<1) {
$(this).val($(this).data('old'));
} else {
change(id, 'change', num, $(this));
}
});
} else {
change(id, 'change', num, $(this));
}
});
// 执行修改数量ajax
function change(id, sort, num, obj) {
// 执行修改数量ajax
function change(id, sort, num, obj) {
var data = {
id:id,
sort:sort,
num:num
};
console.log(data);
$.ajax({
url:param.changeNum,
type:"POST",
data:{
id:id,
sort:sort,
num:num
},
data:data,
dateType:"json",
success:function (data) {
if(data.status) {
if(data.data.sort == 'reduce') {
if(data.data.sort == 'reduce') {
obj.parent().find(".numberbox").val(parseInt(obj.parent().find(".numberbox").val())-1);
}
}
if(data.data.sort == 'plus') {
obj.parent().find(".numberbox").val(parseInt(obj.parent().find(".numberbox").val())+1);
}
obj.parents('.cart-cell').find('.amount').text(data.data.amount);
coin();
obj.parents('.cart-cell').find('.amount').text(data.data.amount);
coin();
} else {
alert(data.msg);
}
... ... @@ -139,11 +180,11 @@ $(function(){
}
// 删除购物车商品
$('#delete').click(function(){
$('#delete').click(function(){
var chrenLength = $('.chrenActive').length;
if(chrenLength == 0) {
if(chrenLength == 0) {
alert('请选择要删除的商品');
} else {
} else {
if(confirm('确认删除所选商品?')) {
var ids = [];
$('.chrenActive').each(function() {
... ... @@ -151,10 +192,10 @@ $(function(){
});
delCartGoods(ids,'delele');
}
}
});
}
});
// 去付款
// 去付款
$('#topay').click(function(){
var btn = $(this);
var chrenLength = $('.chrenActive').length;
... ... @@ -169,14 +210,14 @@ $(function(){
}
});
// 删除购物车商品
function delCartGoods(ids,sort) {
// 删除购物车商品
function delCartGoods(ids,sort) {
$.ajax({
url:param.del,
type:"POST",
data:{
ids:ids,
sort:sort
sort:sort
},
dateType:"json",
success:function (data) {
... ... @@ -194,7 +235,7 @@ $(function(){
alert(e);
}
});
}
}
// 去付款
function handleCart(ids,sort,obj) {
... ... @@ -233,7 +274,7 @@ $(function(){
Coin = 0;
Num = 0;
$(".chrenActive").each(function() {
Num = parseFloat(Num)+parseFloat($(this).parent().find("input[name=num]").val());
Num = parseFloat(Num)+parseFloat($(this).parent().find("input[name=num]").val());
Coin = parseFloat(Coin)+parseFloat($(this).parent().find(".amount").text());
})
$("#choose").html(Num);
... ... @@ -247,14 +288,20 @@ $(function(){
var address_id = $('input[name=address_id]').val();
var ids = [];
$('input[name="ids[]"]').each(function(){
ids.push($(this).val());
ids.push($(this).val());
});
if(!address_id) {
alert('请选择收货地址');
return false;
}
$.ajax({
url:param.createOrder,
type:"POST",
data:{
ids:ids,
address_id:address_id
address_id:address_id,
sort:param.sort,
num:param.num
},
dateType:"json",
beforeSend:function() {
... ... @@ -263,7 +310,7 @@ $(function(){
success:function (data) {
console.log(data);
if(data.status) {
// window.location.href = data.data;
window.location.href = data.data;
} else {
alert(data.msg);
}
... ... @@ -277,23 +324,170 @@ $(function(){
}
});
});
//收藏
$(document).on('click','.btn-collect', function(){
if ($(this).hasClass('active')) {
$(this).removeClass('active');
} else {
$(this).addClass('active');
}
});
//收藏2
$(document).on('click','.btn-care', function(){
if ($(this).hasClass('active')) {
$(this).removeClass('active');
} else {
$(this).addClass('active');
}
});
// 选择收货地址
$('.panel-address').on('click','.ads-box',function(){
$('input[name=address_id]').val($(this).parent('li').data('id'));
});
// 关闭地址弹窗
$('.cha').click(function(){
$('.mask').hide();
});
// 添加新地址
$('.add-address').click(function(){
$('.mask_title').html('添加新地址');
$('.mask').show();
});
// 编辑地址
$('.edit-address').click(function(){
var id = $(this).parents('li').data('id');
$('input[name=realname]').val($(this).parents('li').find('.ads-name').html());
$('input[name=mobile]').val($(this).parents('li').find('.ads-tel').html());
$('select[name=province]').val($(this).parents('li').find('input[name=province]').val());
$('select[name=city]').val($(this).parents('li').find('input[name=city]').val());
$('select[name=region]').val($(this).parents('li').find('input[name=region]').val());
$('input[name=address]').val($(this).parents('li').find('.ads-desc').html());
$('input[name=id]').val(id);
$('.mask_title').html('编辑地址');
$('.mask').show();
});
// 删除地址
$('.del-address').click(function(){
var btn = $(this);
var id = $(this).parents('li').data('id');
if(confirm('确认删除该收货地址?')) {
$.ajax({
url:param.delAddress,
type:"POST",
data:{
id:id
},
dateType:"json",
success:function (data) {
if(data.status) {
btn.parents('li').remove();
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
}
});
}
});
$('.sub').click(function(){
address($(this));
});
// 添加/编辑收货地址
function address(obj) {
var text = obj.text();
var form = $('#handle_address').serialize();
if($('input[name=id]').val() == '') {
url = param.addAddress;
} else {
url = param.editAddress;
}
console.log(form);
$.ajax({
url:url,
type:"POST",
data:form,
dateType:"json",
beforeSend:function() {
obj.text('提交中...').attr('disabled', true);
},
success:function (data) {
if(data.status) {
location.reload();
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
},
complete: function () {
// Handle the complete event
obj.text(text).attr('disabled', false);
}
});
}
// 立即购买
$('.btn-buy').click(function(){
var id = param.id;
var num = $('.numberbox').val();
var data = {
id:id,
num:num
}
$.ajax({
url:param.buy,
type:"POST",
data:data,
dateType:"json",
success:function (data) {
if(data.status) {
window.location.href = data.data;
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
}
});
});
//收藏
$(document).on('click','.btn-collect', function(){
var btn = $(this);
var goods_id = param.id;
favorite(goods_id,btn);
});
//收藏2
$(document).on('click','.btn-care', function(){
var btn = $(this);
var goods_id = btn.parents('li').data('id');
favorite(goods_id,btn);
});
// 收藏/取消收藏处理
function favorite(goods_id,obj) {
var data = {
goods_id:goods_id
};
$.ajax({
url:param.do_favorite,
type:"POST",
data:data,
dateType:"json",
success:function (data) {
console.log(data);
if(data.status) {
if (obj.hasClass('active')) {
obj.find('span').text('收藏');
obj.removeClass('active');
} else {
obj.find('span').text('已收藏');
obj.addClass('active');
}
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
}
});
}
});
\ No newline at end of file
... ...
... ... @@ -14,7 +14,7 @@
<!--mm-container-->
<div class="mm-container">
<div class="main clearfix">
<tc_include file="Public:left"/>
<tc_include file="User:left"/>
<!--main-->
<div class="mm-main">
<!--概况-->
... ...
... ... @@ -28,7 +28,7 @@
<div class="panel-body">
<div class="table-main">
<volist name="addressList" id="vo">
<table class="t-table">
<table class="t-table" data-id="{$vo.id}">
<thead>
<tr>
<th>联系人</th>
... ... @@ -40,67 +40,23 @@
</thead>
<tbody>
<tr>
<td>马经理</td>
<td>13888888888</td>
<td>开远市-东城-龙苑雅居小区东门附近</td>
<td>{$vo.realname}</td>
<td>{$vo.mobile}</td>
<td>{$vo.city}-{$vo.region}-{$vo.address}</td>
<td>
<div class="links-group">
<a href="">编辑</a>
<a href="{:U('User/Address/edit',array('id'=>$vo['id']))}">编辑</a>
<span class="line">|</span>
<a href="">删除</a>
<a href="javascript:if(confirm('确认删除该收货地址?')) location.href = '{:U("User/Address/delAddress",array("id"=>$vo["id"]))}'">删除</a>
</div>
</td>
<td>
<input type="checkbox" class="m-check" />
<input type="checkbox" class="m-check" <eq name="default_addressid" value="$vo['id']">checked</eq> />
</td>
</tr>
</tbody>
</table>
</volist>
<table class="t-table">
<thead>
<tr>
<th>
联系人
</th>
<th>
电话
</th>
<th>
地址
</th>
<th>
操作
</th>
<th>
默认地址
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
马经理
</td>
<td>
13888888888
</td>
<td>
开远市-东城-龙苑雅居小区东门附近
</td>
<td>
<div class="links-group">
<a href="">编辑</a>
<span class="line">|</span>
<a href="">删除</a>
</div>
</td>
<td>
<input type="checkbox" class="m-check" />
</td>
</tr>
</tbody>
</table>
</div>
<div class="mm-form-footer">
<a href="{:U('User/Address/add')}" class="btn-submit">+新建地址</a>
... ... @@ -112,6 +68,11 @@
</div>
<tc_include file="Public:footer"/>
<!-- js -->
<script>
var param = {
default_address : "{:U('User/Address/default_address')}",
}
</script>
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/mm.js"></script>
<tc_include file="Public:script"/>
... ...
... ... @@ -55,7 +55,7 @@
overflow: hidden;
}
#adder_res {
#adderres {
width: 500px;
height: 40px;
margin: 0 auto;
... ... @@ -91,12 +91,12 @@
padding: 13px;
}
#name {
#realname {
width: 221px;
float: left;
}
#tel {
#mobile {
width: 221px;
float: right;
}
... ... @@ -132,6 +132,8 @@
text-align: center;
margin: 0 auto;
margin-top:54px;
display: block;
border: none;
}
.mm-col-4 .mm-select {
-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
... ... @@ -175,34 +177,29 @@
<div class="pay-in-panel">
<div class="hd">选择收货地址</div>
<ul class="panel-address">
<input type="hidden" name="address_id" value=""/>
<li>
<div class="ads-box active">
<div class="ads-header">
<div class="ads-name">马经理</div>
<div class="ads-tel">13888888888</div>
</div>
<div class="ads-desc">天津市和平区气象台路中环公寓29门602</div>
<div class="ads-footer">
<a href="">修改</a> | <a href="">删除</a>
</div>
</div>
</li>
<li>
<div class="ads-box">
<div class="ads-header">
<div class="ads-name">马经理</div>
<div class="ads-tel">13888888888</div>
</div>
<div class="ads-desc">天津市和平区气象台路中环公寓29门602</div>
<div class="ads-footer">
<a href="">修改</a> | <a href="">删除</a>
</div>
</div>
</li>
<input type="hidden" name="address_id" value="{$default_addressid}"/>
<notempty name="addressList">
<volist name="addressList" id="vo">
<li data-id="{$vo.id}">
<input type="hidden" name="province" value="{$vo.province}"/>
<input type="hidden" name="city" value="{$vo.city}"/>
<input type="hidden" name="region" value="{$vo.region}"/>
<div class="ads-box <if condition='$default_addressid eq $vo[id]'>active</if>">
<div class="ads-header">
<div class="ads-name">{$vo.realname}</div>
<div class="ads-tel">{$vo.mobile}</div>
</div>
<div class="ads-desc">{$vo.address}</div>
<div class="ads-footer">
<a href="javascript:;" class="edit-address">修改</a> | <a href="javascript:;" class="del-address">删除</a>
</div>
</div>
</li>
</volist>
</notempty>
<li>
<div class="ads-box">
<a href="" class="add-address">
<a href="javascript:;" class="add-address">
<span>添加新地址</span>
</a>
</div>
... ... @@ -266,46 +263,53 @@
<tc_include file="Public:footer"/>
<div class="mask">
<div class="mask_main">
<div class="cha">
<form action="" method="post" id="handle_address">
<div class="mask_main">
<div class="cha">
</div>
<p class="mask_title">
添加新地址
</p>
<div class="form_group">
<input type="" name="name" id="name" value="" placeholder="联系人" />
<input type="" name="name" id="tel" value="" placeholder="联系电话" />
</div>
<div class="mm-row mm-ads-row" id="city">
<div class="mm-col-4">
<select class="mm-select prov">
<option value=""></option>
</select>
</div>
<div class="mm-col-4">
<select class="mm-select city" disabled="disabled">
<option value=""></option>
</select>
<p class="mask_title">
添加新地址
</p>
<div class="form_group">
<input type="text" name="realname" id="realname" value="" placeholder="联系人" />
<input type="number" name="mobile" id="mobile" value="" placeholder="联系电话" />
</div>
<div class="mm-col-4">
<select class="mm-select dist" disabled="disabled">
<option value=""></option>
</select>
<div class="mm-row mm-ads-row" id="city">
<div class="mm-col-4">
<select name="province" class="mm-select prov">
<option value="天津"></option>
</select>
</div>
<div class="mm-col-4">
<select name="city" class="mm-select city">
<option value="天津"></option>
</select>
</div>
<div class="mm-col-4">
<select name="region" class="mm-select dist">
<option value="静海"></option>
</select>
</div>
</div>
</div>
<input type="" name="adder_res" id="adder_res" value="" placeholder="详细地址" />
<div class="sub">
提交
<input type="text" name="address" id="adderres" value="" placeholder="详细地址" />
<input type="hidden" name="id" value=""/>
<button type="button" class="sub">
提交
</button>
</div>
</div>
</form>
</div>
<!-- js -->
<script>
var param = {
createOrder : "{:U('User/Cart/createOrder')}",
addAddress : "{:U('User/Address/addAddress')}",
editAddress : "{:U('User/Address/editAddress')}",
delAddress : "{:U('User/Address/delAddress')}",
sort : "{$sort}",
num : "{$num}",
};
</script>
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
... ...
... ... @@ -38,7 +38,7 @@
<div class="pay-in-body">
<div class="pay-infos">
订单号:{$orderInfo.order_sn}<br>
收货信息:马经理 13116188888 天津市气象台路中环公寓29-6023<br>
收货信息:{$orderInfo.realname} {$orderInfo.mobile} {$orderInfo.address}<br>
商品名称:
<volist name="orderInfo.goods_list" id="vo">
{$vo.goods_name} ×{$vo.num}<br>
... ...
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>pc个人中心_站内信</title>
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/member.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
<tc_include file="Public:nav"/>
<!--mm-container-->
<div class="mm-container">
<div class="main clearfix">
<!--侧边-->
<tc_include file="User:left"/>
<!--main-->
<div class="mm-main">
<!--概况-->
<div class="panel same-height">
<div class="panel-header">
<div class="panel-title">站内信</div>
<div class="breadcrumb">
您当前的位置:<a href="">个人中心</a> > <a href="">站内信</a>
</div>
</div>
<div class="panel-body panel-msg">
<!--信-->
<div class="site-msg">
<ul>
<li>
<div class="msg-title">这场比赛厉害了,头奖8万你还不来?</div>
<div class="msg-desc">
这场比赛厉害了,头奖8万你还不来?<br />
距腾讯王卡品牌形象创意设计征集大赛结束仅剩6天!<br />
王的形象,由你主宰!这是一场关于“大王”的创意风暴~<br />
创意不限,脑洞不限!<br />
是呆萌可爱还是时尚酷炫全都看你的。<br />
天下英才速来献计,快来画出你心中的大王~
</div>
<div class="msg-footer">
<div class="msg-link">
链接网址:<a href="">http://www.zcool.com.cn/event/wangka/</a>
</div>
<div class="msg-time">2018-2-23 12:23</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/jquery.SuperSlide.js"></script>
<script src="__TMPL__Public/assets/js/mm.js"></script>
<script type="text/javascript">
jQuery(".panel-msg").slide({titCell:".msg-tabs li",mainCell:".site-msg",trigger:"click"});
</script>
</body>
</html>
... ...
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>pc个人中心_站内信</title>
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/member.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
<tc_include file="Public:nav"/>
<!--mm-container-->
<div class="mm-container">
<div class="main clearfix">
<!--侧边-->
<tc_include file="User:left"/>
<!--main-->
<div class="mm-main">
<!--概况-->
<div class="panel same-height">
<div class="panel-header">
<div class="panel-title">站内信</div>
<div class="breadcrumb">
您当前的位置:<a href="">个人中心</a> > <a href="">站内信</a>
</div>
</div>
<div class="panel-body panel-msg">
<ul class="msg-tabs">
<li class="on"><a href="javascript:;">未读</a></li>
<li><a href="javascript:;">已读</a></li>
</ul>
<!--信-->
<div class="site-msg">
<ul>
<li>
<div class="msg-title">这场比赛厉害了,头奖8万你还不来?</div>
<div class="msg-desc">
这场比赛厉害了,头奖8万你还不来?<br />
距腾讯王卡品牌形象创意设计征集大赛结束仅剩6天!<br />
王的形象,由你主宰!这是一场关于“大王”的创意风暴~<br />
创意不限,脑洞不限!<br />
是呆萌可爱还是时尚酷炫全都看你的。<br />
天下英才速来献计,快来画出你心中的大王~
</div>
<div class="msg-footer">
<div class="msg-link">
链接网址:<a href="">http://www.zcool.com.cn/event/wangka/</a>
</div>
<div class="msg-time">2018-2-23 12:23</div>
</div>
</li>
<li>
<div class="msg-title">公告</div>
<div class="msg-desc">
这场比赛厉害了,头奖8万你还不来?<br />
距腾讯王卡品牌形象创意设计征集大赛结束仅剩6天!<br />
王的形象,由你主宰!这是一场关于“大王”的创意风暴~<br />
创意不限,脑洞不限!<br />
是呆萌可爱还是时尚酷炫全都看你的。<br />
天下英才速来献计,快来画出你心中的大王~
</div>
<div class="msg-footer">
<div class="msg-link">
链接网址:<a href="">http://www.zcool.com.cn/event/wangka/</a>
</div>
<div class="msg-time">2018-2-23 12:23</div>
</div>
</li>
</ul>
<ul>
<li>
<div class="msg-title">这场比赛厉害了,头奖8万你还不来?</div>
<div class="msg-desc">
这场比赛厉害了,头奖8万你还不来?<br />
距腾讯王卡品牌形象创意设计征集大赛结束仅剩6天!<br />
王的形象,由你主宰!这是一场关于“大王”的创意风暴~<br />
创意不限,脑洞不限!<br />
是呆萌可爱还是时尚酷炫全都看你的。<br />
天下英才速来献计,快来画出你心中的大王~
</div>
<div class="msg-footer">
<div class="msg-link">
链接网址:<a href="">http://www.zcool.com.cn/event/wangka/</a>
</div>
<div class="msg-time">2018-2-23 12:23</div>
</div>
</li>
<li>
<div class="msg-title">公告</div>
<div class="msg-desc">
这场比赛厉害了,头奖8万你还不来?<br />
距腾讯王卡品牌形象创意设计征集大赛结束仅剩6天!<br />
王的形象,由你主宰!这是一场关于“大王”的创意风暴~<br />
创意不限,脑洞不限!<br />
是呆萌可爱还是时尚酷炫全都看你的。<br />
天下英才速来献计,快来画出你心中的大王~
</div>
<div class="msg-footer">
<div class="msg-link">
链接网址:<a href="">http://www.zcool.com.cn/event/wangka/</a>
</div>
<div class="msg-time">2018-2-23 12:23</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/jquery.SuperSlide.js"></script>
<script src="__TMPL__Public/assets/js/mm.js"></script>
<script type="text/javascript">
jQuery(".panel-msg").slide({titCell:".msg-tabs li",mainCell:".site-msg",trigger:"click"});
</script>
</body>
</html>
... ...
... ... @@ -57,32 +57,6 @@
</div>
</li>
</volist>
<li>
<div class="coll-box">
<a href="" class="coll-pic scale">
<img src="__TMPL__Public/assets/images/demo/collect.jpg" alt="" />
</a>
<div class="coll-intro">
<div class="coll-tit"><a href="">仿真梅花枝桃花树</a></div>
<div class="coll-price">
<span class="normal-price">¥560.00</span>
<span class="h-price">¥1260.00</span>
</div>
<div class="coll-des">遥知不是雪,为有暗香来</div>
<a href="" class="addCart"><span>加入购物车</span></a>
</div>
<!--取消收藏-->
<div class="btn-coll-remove">取消收藏</div>
<!--取消收藏 弹出-->
<div class="coll-popover">
<div class="coll-tips">确定取消收藏?</div>
<div class="coll-button">
<button class="btn-confirm">确定</button>
<button class="btn-cancel">取消</button>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
... ...
... ... @@ -39,7 +39,7 @@
<a href="{:U('User/Apply/index')}" class="mm-nav-item"><img src="__TMPL__Public/assets/images/my_leftmenu_icon8.png"/>我的申请</a>
</li>
<li class="{$message}">
<a href="" class="mm-nav-item"><img src="__TMPL__Public/assets/images/my_leftmenu_icon9.png"/>站内信</a>
<a href="{:U('User/Message/index')}" class="mm-nav-item"><img src="__TMPL__Public/assets/images/my_leftmenu_icon9.png"/>站内信</a>
</li>
<li class="{$policy}">
<a href="" class="mm-nav-item"><img src="__TMPL__Public/assets/images/my_leftmenu_icon10.png"/>退换货</a>
... ...