目录结构调整
This commit is contained in:
@@ -244,14 +244,9 @@ class Addons extends Admin {
|
||||
public function addhook(){
|
||||
$hooks = model('Hooks');
|
||||
if (IS_POST) {
|
||||
$data = input();
|
||||
if ($data) {
|
||||
$result = $hooks->change($data);
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
$result = $hooks->change();
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
@@ -270,14 +265,9 @@ class Addons extends Admin {
|
||||
public function edithook($id){
|
||||
$hooks = model('Hooks');
|
||||
if (IS_POST) {
|
||||
$data = input('post.');
|
||||
if ($data) {
|
||||
$result = $hooks->change($data);
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
$result = $hooks->change();
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@ class Content extends Admin{
|
||||
$map = $this->buildMap();
|
||||
$field = array_filter($grid_list['fields']);
|
||||
if ($this->modelInfo['extend'] == 1) {
|
||||
$map['model_id'] = $this->modelInfo['id'];
|
||||
array_push($field, 'is_top');
|
||||
}else{
|
||||
unset($map['model_id']);
|
||||
}
|
||||
|
||||
$list = $this->model->where($map)->field($field)->order($order)->paginate(15);
|
||||
@@ -249,21 +250,27 @@ class Content extends Admin{
|
||||
*/
|
||||
protected function buildMap(){
|
||||
$map = array();
|
||||
$keyword = input('get.keyword', '', 'trim');
|
||||
$category = input('get.category', '', 'trim');
|
||||
|
||||
if ($keyword) {
|
||||
$map['title'] = array("LIKE", "%$keyword%");
|
||||
}
|
||||
if ($category){
|
||||
$map['category_id'] = $category;
|
||||
$data = $this->request->get();
|
||||
foreach ($data as $key => $value) {
|
||||
if ($value) {
|
||||
if ($key == 'keyword') {
|
||||
$map['title'] = array("LIKE", "%$value%");
|
||||
}elseif($key == 'category'){
|
||||
$map['category_id'] = $value;
|
||||
}elseif($key == 'create_time'){
|
||||
$map['create_time'] = array('BETWEEN',array(strtotime($value[0]),strtotime($value[1])));
|
||||
}else{
|
||||
$map[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->modelInfo['extend'] == 1) {
|
||||
$category = isset($data['category']) ? $data['category'] : '';
|
||||
$cate_list = parse_field_bind('category', $category, $this->modelInfo['id']);
|
||||
$this->assign('cate_list', $cate_list);
|
||||
}
|
||||
$this->assign($this->request->get());
|
||||
$this->assign($data);
|
||||
return $map;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ class Group extends Admin {
|
||||
|
||||
|
||||
//会员分组首页控制器
|
||||
public function index(){
|
||||
$type = input('get.type','admin','trim');
|
||||
|
||||
public function index($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10);
|
||||
@@ -112,9 +110,7 @@ class Group extends Admin {
|
||||
}
|
||||
|
||||
//权限节点控制器
|
||||
public function access(){
|
||||
$type = input('get.type','admin','trim');
|
||||
|
||||
public function access($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(10);
|
||||
@@ -253,8 +249,7 @@ class Group extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
public function delnode(){
|
||||
$id = input('id','','trim,intval');
|
||||
public function delnode($id){
|
||||
if (!$id) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
|
||||
@@ -118,11 +118,8 @@ class User extends Admin{
|
||||
* del
|
||||
* @author colin <colin@tensent.cn>
|
||||
*/
|
||||
public function del(){
|
||||
$ids = input('post.ids');
|
||||
//多条删除和单条删除
|
||||
empty($ids) ? $ids = input('get.id') : $ids = $ids;
|
||||
$uid = array('IN',is_array($ids) ? implode(',',$ids) : $ids);
|
||||
public function del($id){
|
||||
$uid = array('IN',is_array($id) ? implode(',',$id) : $id);
|
||||
//获取用户信息
|
||||
$find = $this->getUserinfo($uid);
|
||||
model('User')->where(array('uid'=>$uid))->delete();
|
||||
|
||||
@@ -3,6 +3,7 @@ html,body {
|
||||
-webkit-font-smoothing:antialiased;
|
||||
}
|
||||
a.badge{color: #ffffff;}
|
||||
.pt-5{padding-top: 5px;}
|
||||
textarea{resize:none; min-height: 80px;}
|
||||
@media (max-width:419px) {
|
||||
html,body {
|
||||
|
||||
124
application/admin/view/content/book.html
Normal file
124
application/admin/view/content/book.html
Normal file
@@ -0,0 +1,124 @@
|
||||
{extend name="public/base"/}
|
||||
{block name="style"}
|
||||
<!-- datepicker statr -->
|
||||
<link href="__PUBLIC__/plugs/datepicker/css/foundation-datepicker.min.css" rel="stylesheet" type="text/css">
|
||||
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.js"></script>
|
||||
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.zh-CN.js"></script>
|
||||
<!-- datepicker end -->
|
||||
{/block}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>{$meta_title}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{:url('admin/content/add?model_id='.$model_id)}">新 增</a>
|
||||
<button class="btn btn-danger ajax-post confirm" url="{:url('admin/content/del?model_id='.$model_id)}" target-form="ids">删 除</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="row">
|
||||
<form method="get">
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">书名:</div>
|
||||
<input type="text" class="form-control" name="book_name" value="{$book_name|default=''}" placeholder="书名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">发布时间:</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control create_time" name="create_time[]" id="create_time" placeholder="开始时间" value="{$create_time[0]|default=''}" readonly>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control create_time" name="create_time[]" id="create_time" placeholder="结束时间" value="{$create_time[1]|default=''}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">标准类型:</div>
|
||||
<select class="form-control" name="stand_class"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">编号:</div>
|
||||
<input type="text" class="form-control" name="book_no" value="{$book_no|default=''}" placeholder="编号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<button class="btn btn-primary" type="submit">搜索</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="table-responsive clearfix">
|
||||
|
||||
<div class="table-responsive clearfix">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30"><input class="checkbox check-all" type="checkbox"></th>
|
||||
{volist name="grid['grids']" id="item"}
|
||||
<th>{$item['title']}</th>
|
||||
{/volist}
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if condition="empty($list)"}
|
||||
{php}
|
||||
$cow = count($grid['grids'])+2;
|
||||
{/php}
|
||||
<tr>
|
||||
<td colspan="{$cow}" align="center">暂无数据!</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}"></td>
|
||||
{volist name="grid['grids']" id="vo"}
|
||||
{if isset($vo['format'])}
|
||||
<td>{$item[$vo['field'][0]]|$vo['format']}</td>
|
||||
{else/}
|
||||
<td>{$item[$vo['field'][0]]}</td>
|
||||
{/if}
|
||||
{/volist}
|
||||
<td>
|
||||
{if isset($item['status'])}
|
||||
{if $item['status']}
|
||||
<a href="{:url('admin/content/status',array('id'=>$item['id'],'model_id'=>$model_id,'status'=>'0'))}" class="ajax-get">取消审核</a>
|
||||
{else/}
|
||||
<a href="{:url('admin/content/status',array('id'=>$item['id'],'model_id'=>$model_id,'status'=>'1'))}" class="ajax-get">审核</a>
|
||||
{/if}
|
||||
{/if}
|
||||
<a href="{:url('admin/content/edit',array('id'=>$item['id'],'model_id'=>$model_id))}" >编辑</a>
|
||||
<a href="{:url('admin/content/del',array('id'=>$item['id'],'model_id'=>$model_id))}" class="ajax-get confirm">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{$page}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.create_time').fdatepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
pickTime: true
|
||||
});
|
||||
|
||||
$('.height_btn').click(function(){
|
||||
$('.height').show();
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | OneThink [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
/**
|
||||
* 分类模型
|
||||
*/
|
||||
class Book extends Content{
|
||||
|
||||
protected $auto = array('date_last_modify', 'user_last_modify');
|
||||
protected $type = array(
|
||||
'id' => 'integer',
|
||||
'cover_id' => 'integer',
|
||||
'sort' => 'integer'
|
||||
);
|
||||
|
||||
protected function setStatusAttr($value){
|
||||
return 1;
|
||||
}
|
||||
|
||||
protected function setCreateTimeAttr($value){
|
||||
return $value ? strtotime($value) : time();
|
||||
}
|
||||
|
||||
protected function setDateLastModifyAttr($value){
|
||||
return $value ? strtotime($value) : time();
|
||||
}
|
||||
|
||||
protected function setUserLastModifyAttr($value){
|
||||
return session('user_auth.uid');
|
||||
}
|
||||
|
||||
protected function getCreateTimeAttr($value){
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
protected function getDateLastModifyAttr($value){
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
protected function getStandClassTextAttr($value, $data){
|
||||
$text = array(
|
||||
'1' => 'BK ', '2' => 'CN', '3' => 'QT', '4' => 'DB',
|
||||
);
|
||||
return $text[$data['stand_class']];
|
||||
}
|
||||
}
|
||||
@@ -64,19 +64,6 @@ class Hooks extends Base {
|
||||
return $keylist;
|
||||
}
|
||||
|
||||
public function change($data){
|
||||
if (!empty($data)) {
|
||||
if ($data['id']) {
|
||||
$this->save($data,array('id'=>$data['id']));
|
||||
}else{
|
||||
$this->save($data);
|
||||
}
|
||||
}else{
|
||||
$this->error = "非法操作!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function addHooks($addons_name){
|
||||
$addons_class = get_addon_class($addons_name);//获取插件名
|
||||
if(!class_exists($addons_class)){
|
||||
@@ -94,5 +81,5 @@ class Hooks extends Base {
|
||||
return false;
|
||||
}
|
||||
$methods = get_class_methods($addons_class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | OneThink [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
/**
|
||||
* 分类模型
|
||||
*/
|
||||
class Order extends Base{
|
||||
|
||||
protected $auto = array('update_time');
|
||||
protected $insert = array('create_time', 'uid', 'status'=>1, 'order_no');
|
||||
|
||||
protected function setOrderNoAttr($value){
|
||||
return 'SN'.date('YmdHis',time()).rand('1000','9999');
|
||||
}
|
||||
|
||||
protected function setUidAttr($value){
|
||||
return session('user_auth.uid');
|
||||
}
|
||||
|
||||
protected function getPayTypeTextAttr($value, $data){
|
||||
$type = array('wechat'=>'微信支付', 'alipay'=>'支付宝支付');
|
||||
return $type[$data['pay_type']];
|
||||
}
|
||||
protected function getPayStatusTextAttr($value, $data){
|
||||
$type = array(
|
||||
0 => '未付款',
|
||||
1 => '已付款',
|
||||
);
|
||||
return $type[$data['pay_status']];
|
||||
}
|
||||
|
||||
public function product(){
|
||||
return $this->hasMany('OrderProduct', 'order_no', 'order_no');
|
||||
}
|
||||
|
||||
//生成订单
|
||||
public function createOrder($data){
|
||||
$order_id = $this->save($data);
|
||||
foreach ($data['list'] as $key => $value) {
|
||||
$value['order_no'] = $this->data['order_no'];
|
||||
$value['product_id'] = $value['id'];
|
||||
unset($value['id']);
|
||||
$value['create_time'] = time();
|
||||
$value['update_time'] = time();
|
||||
$goods[] = $value;
|
||||
}
|
||||
db('OrderProduct')->insertAll($goods);
|
||||
return $order_id;
|
||||
}
|
||||
}
|
||||
70
application/index/controller/Book.php
Normal file
70
application/index/controller/Book.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\index\controller;
|
||||
use app\common\controller\Fornt;
|
||||
|
||||
class Book extends Fornt{
|
||||
|
||||
public function _initialize(){
|
||||
parent::_initialize();
|
||||
$this->book = model('Book');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$map = $this->search();
|
||||
$order = 'id desc';
|
||||
$list = $this->book->where($map)->order($order)->paginate(10);
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'page' => $list->render()
|
||||
);
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//图书详情
|
||||
public function detail($id = 0){
|
||||
$map['id'] = $id;
|
||||
|
||||
$info = $this->book->where($map)->find();
|
||||
|
||||
$data = array(
|
||||
'info' => $info,
|
||||
);
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//图书搜索条件组织
|
||||
protected function search(){
|
||||
$map = array();
|
||||
$data = $this->request->post();
|
||||
$data['is_show_height'] = 0;
|
||||
if (isset($data['book_name']) && $data['book_name']) {
|
||||
$map['book_name'] = array("LIKE", "%" . $data['book_name'] . "%");
|
||||
}
|
||||
if (isset($data['book_no']) && $data['book_no']) {
|
||||
$map['book_no'] = array("LIKE", "%" . $data['book_no'] . "%");
|
||||
$data['is_show_height'] = 1;
|
||||
}
|
||||
if (isset($data['stand_class']) && $data['stand_class']) {
|
||||
$map['stand_class'] = $data['stand_class'];
|
||||
$data['is_show_height'] = 1;
|
||||
}
|
||||
if (isset($data['create_time'][0]) && isset($data['create_time'][1]) && $data['create_time'][0] && $data['create_time'][1]) {
|
||||
$map['create_time'] = array('BETWEEN',$data['create_time']);
|
||||
$data['is_show_height'] = 1;
|
||||
}
|
||||
|
||||
$this->assign($data);
|
||||
return $map;
|
||||
}
|
||||
}
|
||||
53
application/index/controller/Cart.php
Normal file
53
application/index/controller/Cart.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\index\controller;
|
||||
use app\common\controller\Fornt;
|
||||
|
||||
class Cart extends Fornt{
|
||||
|
||||
public function _initialize(){
|
||||
$this->cart = new \com\Cart();
|
||||
}
|
||||
|
||||
//购物车
|
||||
public function index(){
|
||||
$list = $this->cart->all();
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
);
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//加入购物车
|
||||
public function add($id, $num){
|
||||
if ($num > 0) {
|
||||
$this->cart->addItem($id, $num);
|
||||
}
|
||||
$info['code'] = 1;
|
||||
$info['num'] = $this->cart->getCount();
|
||||
return $info;
|
||||
}
|
||||
|
||||
//加入购物车
|
||||
public function del($id){
|
||||
$this->cart->delItem($id);
|
||||
$info['code'] = 1;
|
||||
$info['data'] = array('num'=>$this->cart->getCount());
|
||||
return $info;
|
||||
}
|
||||
|
||||
//购物车统计
|
||||
public function count(){
|
||||
$data = array('info'=>$this->cart->getCount());
|
||||
echo json_encode($data);
|
||||
}
|
||||
}
|
||||
128
application/user/controller/Order.php
Normal file
128
application/user/controller/Order.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\user\controller;
|
||||
use app\common\controller\User;
|
||||
|
||||
class Order extends User{
|
||||
|
||||
public function _initialize(){
|
||||
parent::_initialize();
|
||||
$this->order = model('Order');
|
||||
$this->cart = new \com\Cart();
|
||||
}
|
||||
|
||||
//会员中心订单首页
|
||||
public function index(){
|
||||
$map['uid'] = session('user_auth.uid');
|
||||
$map['status'] = array('gt',0);
|
||||
|
||||
$rows = array();
|
||||
$list = $this->order->where($map)->order('id desc')->paginate(10);
|
||||
foreach ($list as $key => $value) {
|
||||
$value['product'] = $value->product;
|
||||
$rows[] = $value;
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'list' => $rows,
|
||||
'page' => $list->render()
|
||||
);
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
//订单结算列表
|
||||
public function lists(){
|
||||
$id = input('id', '', 'trim');
|
||||
$order_id = input('order_id', '', 'trim');
|
||||
|
||||
//立即购买,把物品放入购物车
|
||||
if ($id) {
|
||||
$this->cart->addItem($id, 1);
|
||||
}
|
||||
|
||||
if (!$order_id) {
|
||||
$price_count = '0.00';
|
||||
$list = $this->cart->all();
|
||||
foreach ($list as $key => $value) {
|
||||
$price_count += $value['price_count'];
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
'price_count' => $price_count
|
||||
);
|
||||
|
||||
//生成订单
|
||||
$map['id'] = $this->order->createOrder($data);
|
||||
}else{
|
||||
$map['id'] = $order_id;
|
||||
}
|
||||
$order = $this->order->where($map)->find();
|
||||
|
||||
$data = array(
|
||||
'list' => $order->product,
|
||||
'order_id' => $map['id'],
|
||||
'price_count' => $order['price_count']
|
||||
);
|
||||
//订单生成后情况购物车
|
||||
$this->cart->clear();
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function confirm(){
|
||||
$order_id = input('order_id', '', 'trim');
|
||||
$payment = input('payment', '', 'trim');
|
||||
$map['id'] = $order_id;
|
||||
$this->order->where($map)->update(array('pay_type'=>$payment));
|
||||
$info = $this->order->where($map)->find();
|
||||
|
||||
$data = array(
|
||||
'info' => $info
|
||||
);
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单支付
|
||||
* @param int $order_id
|
||||
* @return html
|
||||
*/
|
||||
public function pay($order_id){
|
||||
$info = $this->order->where(array('id'=>$order_id))->find();
|
||||
if ($info['pay_status']) {
|
||||
return $this->success("您已支付!", url('user/order/index'));
|
||||
}
|
||||
$pay = array(
|
||||
'body' => '测试支付',
|
||||
'fee' => $info['price_count'],
|
||||
//'fee' => 0.01,
|
||||
'order_no' => $info['order_no'],
|
||||
'title' => config('web_site_title') . ' - 订单付款',
|
||||
'param' => array('order_id'=>$info['id'])
|
||||
);
|
||||
$data = array('type' => $info['pay_type'], 'pay_data'=>$pay);
|
||||
$data = action('user/pay/index',$data);
|
||||
$data['order_no'] = $info['order_no'];
|
||||
$this->assign($data);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function cancel($order_id){
|
||||
$result = $this->order->where(array('id'=>$order_id))->setField('status',0);
|
||||
if ($result) {
|
||||
return $this->success("已取消!");
|
||||
}else{
|
||||
return $this->error("取消失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
70
application/user/controller/Pay.php
Normal file
70
application/user/controller/Pay.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\user\controller;
|
||||
use app\common\controller\User;
|
||||
|
||||
class Pay extends User{
|
||||
|
||||
public function index($type = 'alipay', $pay_data){
|
||||
$pay = new \com\Pay($type);
|
||||
$pay_data['bank'] = isset($pay_data['bank']) ? $pay_data['bank'] : '';
|
||||
$pay_data['callback'] = url('user/pay/returnback',array('apitype'=>input('apitype', 'alipay', 'trim')));
|
||||
$pay_data['url'] = url('user/pay/returnback',array('apitype'=>input('apitype', 'alipay', 'trim')));
|
||||
$pay_data['param'] = isset($pay_data['param']) ? $pay_data['param'] : '';
|
||||
|
||||
$input = new \com\pay\Input();
|
||||
$input->setBody($pay_data['body'])
|
||||
->setUid(session('user_auth.uid'))
|
||||
->setFee($pay_data['fee']) //支付金额
|
||||
->setOrderNo($pay_data['order_no'])//订单号
|
||||
->setTitle($pay_data['title'])//设置商品名称
|
||||
->setBank($pay_data['bank'])//设置银行
|
||||
->setCallback($pay_data['callback'])/*** 设置支付完成后的后续操作接口 */
|
||||
->setUrl($pay_data['url']) /* 设置支付完成后的跳转地址*/
|
||||
->setParam($pay_data['param']);
|
||||
$data = $pay->pay($input);
|
||||
return $data;
|
||||
}
|
||||
|
||||
//返回
|
||||
public function returnback(){
|
||||
$apitype = input('get.apitype');
|
||||
$method = input('get.method');
|
||||
if (!empty($_POST)) {
|
||||
$result = input('post.');
|
||||
}elseif (!empty($_GET)) {
|
||||
$result = input('get.');;
|
||||
unset($result['method']);
|
||||
unset($result['apitype']);
|
||||
} else {
|
||||
exit('Access Denied');
|
||||
}
|
||||
$pay = new \com\Pay($apitype);
|
||||
$res = $pay->verifyNotify($result);
|
||||
$status = ($result['trade_status'] == 'TRADE_FINISHED' || $result['trade_status'] == 'TRADE_SUCCESS') ? true : false;
|
||||
if ($res && $status) {
|
||||
db('Order')->where(array('order_no'=>$result['out_trade_no']))->update(array('pay_status'=>1));
|
||||
return $this->success("支付成功!", url('user/order/index'));
|
||||
}else{
|
||||
return $this->error("支付失败!");
|
||||
}
|
||||
}
|
||||
|
||||
//异步获取
|
||||
public function notify(){
|
||||
$order_no = input('post.order_no');
|
||||
$pay_status = db('Order')->where(array('order_no'=>$order_no))->value('pay_status');
|
||||
if ($pay_status) {
|
||||
return $this->success("支付成功!", url('user/order/index'));
|
||||
}else{
|
||||
return $this->error("支付失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
12
application/user/lang/zh-cn.php
Normal file
12
application/user/lang/zh-cn.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return array(
|
||||
'find_password' => '您的找回密码确认地址为:{:url}',
|
||||
);
|
||||
140
application/user/view/login/find.html
Normal file
140
application/user/view/login/find.html
Normal file
@@ -0,0 +1,140 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta charset="UTF-8">
|
||||
<title>找回密码</title>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/font-awesome.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css"/>
|
||||
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/member_login.css"/>
|
||||
<script src="__PUBLIC__/js/jquery.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="__PUBLIC__/js/html5shiv.js"></script>
|
||||
<script src="__PUBLIC__/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="header-wrap">
|
||||
<header class="public-head-layout wrapper">
|
||||
<h1 class="site-logo">
|
||||
<a href="{:url('index/index/index')}"><img src="__PUBLIC__/images/logo.png" class="pngFix"></a>
|
||||
</h1>
|
||||
<div class="nc-login-now">
|
||||
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="nc-login-layout">
|
||||
<div class="left-pic"><img src="http://s.dxpd.cn/data/upload/shop/login/1.jpg" border="0"></div>
|
||||
<div class="nc-login">
|
||||
<div class="nc-login-mode">
|
||||
<ul class="tabs-nav">
|
||||
<li><a href="#default" class="tabulous_active">找回密码<i></i></a></li>
|
||||
</ul>
|
||||
<div id="tabs_container" class="tabs-container">
|
||||
<div id="default" class="tabs-content">
|
||||
<form id="login_form" class="nc-login-form" method="post">
|
||||
<dl>
|
||||
<dt>注册邮箱:</dt>
|
||||
<dd>
|
||||
<input type="text" class="text" autocomplete="off" name="email" placeholder="注册邮箱" value="{$email}" id="email" readonly >
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>设置密码:</dt>
|
||||
<dd>
|
||||
<input type="password" id="password" name="password" class="text" placeholder="6-20个大小写英文字母、符号或数字"/>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>确认密码:</dt>
|
||||
<dd>
|
||||
<input type="password" id="repassword" name="repassword" class="text" placeholder="请再次输入密码"/>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="code-div mt15">
|
||||
<dl>
|
||||
<dt>验证码:</dt>
|
||||
<dd>
|
||||
<input type="text" name="verify" autocomplete="off" class="text w80" placeholder="输入验证码" id="verify" size="10" />
|
||||
</dd>
|
||||
</dl>
|
||||
<span><img src="{:url('user/index/verify')}" id="codeimage"/> <a class="makecode" href="javascript:void(0)">看不清,换一张</a></span>
|
||||
</div>
|
||||
<div class="submit-div">
|
||||
<input type="hidden" name="token" value="{$token}">
|
||||
<input type="hidden" name="uid" value="{$uid}">
|
||||
<input type="submit" class="submit" value="登 录">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="footer" class="wrapper">
|
||||
<p><a href="{:url('index/index/index')}">首页</a>
|
||||
| <a href="{:url('user/index/index')}">会员中心</a>
|
||||
</p>
|
||||
Copyright 2015 <a href="http://www.tensent.cn" target="_blank">腾速科技</a> All rights reserved.<br/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<script src="__PUBLIC__/js/messager.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$("form").submit(function(e){
|
||||
e.preventDefault();
|
||||
var self = $(this);
|
||||
$.post(self.attr("action"), self.serialize(), success, "json");
|
||||
|
||||
function success(data){
|
||||
if(data.code){
|
||||
$.messager.show(data.msg, {placement: 'center',type:'success'});
|
||||
setTimeout(function(){
|
||||
window.location.href = data.url;
|
||||
},3000);
|
||||
} else {
|
||||
$.messager.show(data.msg, {placement: 'center',type:'success'});
|
||||
//刷新验证码
|
||||
$(".makecode").click();
|
||||
}
|
||||
}
|
||||
});
|
||||
//初始化选中用户名输入框
|
||||
$("#itemBox").find("input[name=username]").focus();
|
||||
//刷新验证码
|
||||
var verifyimg = $("#codeimage").attr("src");
|
||||
$(".makecode").click(function(){
|
||||
if( verifyimg.indexOf('?')>0){
|
||||
$("#codeimage").attr("src", verifyimg+'&random='+Math.random());
|
||||
}else{
|
||||
$("#codeimage").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
|
||||
}
|
||||
});
|
||||
|
||||
//placeholder兼容性
|
||||
//如果支持
|
||||
function isPlaceholer(){
|
||||
var input = document.createElement('input');
|
||||
return "placeholder" in input;
|
||||
}
|
||||
//如果不支持
|
||||
if(!isPlaceholer()){
|
||||
$(".placeholder_copy").css({display:'block'})
|
||||
$("#itemBox input").keydown(function(){
|
||||
$(this).parents(".item").next(".placeholder_copy").css({display:'none'})
|
||||
})
|
||||
$("#itemBox input").blur(function(){
|
||||
if($(this).val()==""){
|
||||
$(this).parents(".item").next(".placeholder_copy").css({display:'block'});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
126
application/user/view/login/forget.html
Normal file
126
application/user/view/login/forget.html
Normal file
@@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta charset="UTF-8">
|
||||
<title>找回密码</title>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/font-awesome.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css"/>
|
||||
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/member_login.css"/>
|
||||
<script src="__PUBLIC__/js/jquery.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="__PUBLIC__/js/html5shiv.js"></script>
|
||||
<script src="__PUBLIC__/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="header-wrap">
|
||||
<header class="public-head-layout wrapper">
|
||||
<h1 class="site-logo">
|
||||
<a href="{:url('index/index/index')}"><img src="__PUBLIC__/images/logo.png" class="pngFix"></a>
|
||||
</h1>
|
||||
<div class="nc-login-now">
|
||||
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="nc-login-layout">
|
||||
<div class="left-pic"><img src="http://s.dxpd.cn/data/upload/shop/login/1.jpg" border="0"></div>
|
||||
<div class="nc-login">
|
||||
<div class="nc-login-mode">
|
||||
<ul class="tabs-nav">
|
||||
<li><a href="#default" class="tabulous_active">找回密码<i></i></a></li>
|
||||
</ul>
|
||||
<div id="tabs_container" class="tabs-container">
|
||||
<div id="default" class="tabs-content">
|
||||
<form id="login_form" class="nc-login-form" method="post">
|
||||
<dl>
|
||||
<dt>注册邮箱:</dt>
|
||||
<dd>
|
||||
<input type="text" class="text" autocomplete="off" name="email" placeholder="注册邮箱" id="email" >
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="code-div mt15">
|
||||
<dl>
|
||||
<dt>验证码:</dt>
|
||||
<dd>
|
||||
<input type="text" name="verify" autocomplete="off" class="text w80" placeholder="输入验证码" id="verify" size="10" />
|
||||
</dd>
|
||||
</dl>
|
||||
<span><img src="{:url('user/index/verify')}" id="codeimage"/> <a class="makecode" href="javascript:void(0)">看不清,换一张</a></span>
|
||||
</div>
|
||||
<div class="submit-div">
|
||||
<input type="submit" class="submit" value="登 录">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="footer" class="wrapper">
|
||||
<p><a href="{:url('index/index/index')}">首页</a>
|
||||
| <a href="{:url('user/index/index')}">会员中心</a>
|
||||
</p>
|
||||
Copyright 2015 <a href="http://www.tensent.cn" target="_blank">腾速科技</a> All rights reserved.<br/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<script src="__PUBLIC__/js/messager.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$("form").submit(function(e){
|
||||
e.preventDefault();
|
||||
var self = $(this);
|
||||
$.post(self.attr("action"), self.serialize(), success, "json");
|
||||
|
||||
function success(data){
|
||||
if(data.code){
|
||||
$.messager.show(data.msg, {placement: 'center',type:'success'});
|
||||
setTimeout(function(){
|
||||
window.location.href = data.url;
|
||||
},3000);
|
||||
} else {
|
||||
$.messager.show(data.msg, {placement: 'center',type:'success'});
|
||||
//刷新验证码
|
||||
$(".makecode").click();
|
||||
}
|
||||
}
|
||||
});
|
||||
//初始化选中用户名输入框
|
||||
$("#itemBox").find("input[name=username]").focus();
|
||||
//刷新验证码
|
||||
var verifyimg = $("#codeimage").attr("src");
|
||||
$(".makecode").click(function(){
|
||||
if( verifyimg.indexOf('?')>0){
|
||||
$("#codeimage").attr("src", verifyimg+'&random='+Math.random());
|
||||
}else{
|
||||
$("#codeimage").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
|
||||
}
|
||||
});
|
||||
|
||||
//placeholder兼容性
|
||||
//如果支持
|
||||
function isPlaceholer(){
|
||||
var input = document.createElement('input');
|
||||
return "placeholder" in input;
|
||||
}
|
||||
//如果不支持
|
||||
if(!isPlaceholer()){
|
||||
$(".placeholder_copy").css({display:'block'})
|
||||
$("#itemBox input").keydown(function(){
|
||||
$(this).parents(".item").next(".placeholder_copy").css({display:'none'})
|
||||
})
|
||||
$("#itemBox input").blur(function(){
|
||||
if($(this).val()==""){
|
||||
$(this).parents(".item").next(".placeholder_copy").css({display:'block'});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
94
application/user/view/order/confirm.html
Normal file
94
application/user/view/order/confirm.html
Normal file
@@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<title>确认订单信息-会员中心 - Powered by TenSent,Inc.</title>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/font-awesome.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/nanoscroller.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css"/>
|
||||
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/order.css"/>
|
||||
<script src="__PUBLIC__/js/jquery.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="__PUBLIC__/js/html5shiv.js"></script>
|
||||
<script src="__PUBLIC__/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
{block name="style"}{/block}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="logo">
|
||||
<a href="{:url('index/book/index')}"><img src="__PUBLIC__/images/logo.png" alt="确认订单信息-会员中心"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-danger progress-bar-striped" style="width: 25%">
|
||||
<span>1、购物车</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-danger progress-bar-striped" style="width: 25%">
|
||||
<span>2、确认订单信息</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-success progress-bar-striped" style="width: 25%">
|
||||
<span>3、选择支付</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-primary progress-bar-striped" style="width: 25%">
|
||||
<span>4、订购完成</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p class="no-data"><span class="red"><i class="fa fa-edit"></i></span> 订单已成功提交!</p>
|
||||
<form action="{:url('user/order/pay')}" method="post" class="form">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="200" class="text-right">订单编号:</td>
|
||||
<td>{$info['order_no']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="text-right">订单金额:</td>
|
||||
<td>¥{$info['price_count']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="text-right">支付方式:</td>
|
||||
<td>{$info['pay_type_text']}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="pull-right">
|
||||
<input type="hidden" name="order_id" value="{$info['id']}">
|
||||
<input type="hidden" name="pay_type" value="{$info['pay_type']}">
|
||||
<button class="btn btn-danger">立即支付</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<div class="warp">
|
||||
<p>Copyright © 2013-2016 <a href="http://www.tensent.cn" target="_blank">腾速科技</a> 版权所有</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
50
application/user/view/order/index.html
Normal file
50
application/user/view/order/index.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="body"}
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#editpw" data-toggle="tab">我的订单</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="editpw">
|
||||
{volist name="list" id="item"}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
订单号:{$item['order_no']}({$item['create_time']|date='Y-m-d',###})
|
||||
<span class="pull-right">
|
||||
{if $item['pay_status']}
|
||||
已付款
|
||||
{else/}
|
||||
<a href="{:url('user/order/cancel',array('order_id'=>$item['id']))}" class="ajax-get"><i class="fa fa-close"></i> 取消订单</a>
|
||||
<a href="{:url('user/order/lists',array('order_id'=>$item['id']))}" target="_blank" class="text-danger">付款</a>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>图书</th>
|
||||
<th>图书名称</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
{volist name="item['product']" id="product"}
|
||||
<tr>
|
||||
<td width="80">
|
||||
<a href="{:url('index/book/detail', array('id'=>$product['product_id']))}" target="_blank"><img src="{:get_cover($product->book['cover_id'],'path')}" alt="{$product->book['book_name']}" width="60"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{:url('index/book/detail', array('id'=>$product['product_id']))}" target="_blank">{$product->book['book_name']}</a>
|
||||
</td>
|
||||
<td width="120">
|
||||
{if $item['pay_status']}
|
||||
<a href="{:url('user/upload/download',array('order_id'=>$item['id'],'product_id'=>$product['product_id']))}" target="_blank">下载图书</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</div>
|
||||
{/volist}
|
||||
{$page}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
124
application/user/view/order/lists.html
Normal file
124
application/user/view/order/lists.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<title>确认订单信息-会员中心 - Powered by TenSent,Inc.</title>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/font-awesome.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/nanoscroller.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css"/>
|
||||
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/order.css"/>
|
||||
<script src="__PUBLIC__/js/jquery.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="__PUBLIC__/js/html5shiv.js"></script>
|
||||
<script src="__PUBLIC__/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
{block name="style"}{/block}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="logo">
|
||||
<a href="{:url('index/book/index')}"><img src="__PUBLIC__/images/logo.png" alt="确认订单信息-会员中心"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-danger progress-bar-striped" style="width: 25%">
|
||||
<span>1、购物车</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-success progress-bar-striped" style="width: 25%">
|
||||
<span>2、确认订单信息</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-primary progress-bar-striped" style="width: 25%">
|
||||
<span>3、选择支付</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-primary progress-bar-striped" style="width: 25%">
|
||||
<span>4、订购完成</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form action="{:url('user/order/confirm')}" method="post" class="form">
|
||||
<div class="order_title">商品清单</div>
|
||||
{if !empty($list)}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品</th>
|
||||
<th>名称</th>
|
||||
<th>单价</th>
|
||||
<th>数量</th>
|
||||
<th>小计</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td width="90">
|
||||
<a href="{:url('index/book/detail',array('id'=>$item->book['id']))}"><img src="{:get_cover($item->book['cover_id'],'path')}" width="80"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{:url('index/book/detail',array('id'=>$item->book['id']))}">{$item->book['book_name']}</a>
|
||||
</td>
|
||||
<td>¥{$item['price']}</td>
|
||||
<td>{$item['num']}</td>
|
||||
<td>¥{$item['price_count']}</td>
|
||||
<td width="60">
|
||||
<a href="{:url('index/cart/del',array('id'=>$item['id']))}" class="ajax-get confirm"><i class="fa fa-close"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="text-right price_count">
|
||||
<p>应付总额:<span>¥{$price_count}</span></p>
|
||||
</div>
|
||||
|
||||
<div class="order_title">支付方式</div>
|
||||
<div class="clearfix">
|
||||
<ul class="payment-list">
|
||||
<li class="selected">
|
||||
<input type="radio" name="payment" value="alipay" checked="true">
|
||||
<label><b>支付宝支付</b> </label>
|
||||
<div><img src="__PUBLIC__/images/pay/alipay.png" width="180"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<input type="hidden" name="order_id" value="{$order_id}">
|
||||
<button type="submit" class="btn btn-danger">提交订单</button>
|
||||
</div>
|
||||
{else/}
|
||||
<p class="no-data">购物车为空!<a href="{:url('index/book/index')}">去继续选择……</a></p>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<div class="warp">
|
||||
<p>Copyright © 2013-2016 <a href="http://www.tensent.cn" target="_blank">腾速科技</a> 版权所有</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
93
application/user/view/order/pay.html
Normal file
93
application/user/view/order/pay.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<title>确认订单信息-会员中心 - Powered by TenSent,Inc.</title>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/font-awesome.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/nanoscroller.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css"/>
|
||||
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/order.css"/>
|
||||
<script src="__PUBLIC__/js/jquery.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="__PUBLIC__/js/html5shiv.js"></script>
|
||||
<script src="__PUBLIC__/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
{block name="style"}{/block}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="logo">
|
||||
<a href="{:url('index/book/index')}"><img src="__PUBLIC__/images/logo.png" alt="确认订单信息-会员中心"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-danger progress-bar-striped" style="width: 25%">
|
||||
<span>1、购物车</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-danger progress-bar-striped" style="width: 25%">
|
||||
<span>2、确认订单信息</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-danger progress-bar-striped" style="width: 25%">
|
||||
<span>3、选择支付</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-success progress-bar-striped" style="width: 25%">
|
||||
<span>4、订购完成</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p class="no-data"><span class="red"><i class="fa fa-spinner fa-spin fa-fw"></i></span> 等待支付!</p>
|
||||
{$sHtml}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $is_submit}
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
setTimeout(function(){
|
||||
document.forms['paysubmit'].submit();
|
||||
},300);
|
||||
|
||||
setInterval(function(){
|
||||
$.ajax({
|
||||
url : " {:config('base_url')} " + "/user/pay/notify.html",
|
||||
type : 'post',
|
||||
data : {'order_id':"{$order_no}"},
|
||||
success : function(data){
|
||||
if(data.code === 1){
|
||||
window.location
|
||||
}
|
||||
},
|
||||
dataType : 'json'
|
||||
})
|
||||
},10000);
|
||||
})
|
||||
</script>
|
||||
{/if}
|
||||
<div class="footer">
|
||||
<div class="warp">
|
||||
<p>Copyright © 2013-2016 <a href="http://www.tensent.cn" target="_blank">腾速科技</a> 版权所有</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user