mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-01 03:18:33 +08:00
user index
This commit is contained in:
parent
078e2ed43b
commit
1260eca377
@ -71,9 +71,6 @@ class OrderController extends CommonController
|
||||
);
|
||||
$data = OrderService::OrderList($data_params);
|
||||
$this->assign('data_list', $data['data']);
|
||||
|
||||
// 发起支付 - 支付方式
|
||||
$this->assign('buy_payment_list', ResourcesService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]));
|
||||
|
||||
// 支付方式
|
||||
$this->assign('payment_list', ResourcesService::PaymentList());
|
||||
@ -122,6 +119,9 @@ class OrderController extends CommonController
|
||||
$this->assign('buy_payment_list', ResourcesService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]));
|
||||
|
||||
$this->assign('data', $data['data'][0]);
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
$this->display('Detail');
|
||||
} else {
|
||||
$this->assign('msg', L('common_not_data_tips'));
|
||||
|
@ -5,6 +5,7 @@ namespace Home\Controller;
|
||||
use Service\OrderService;
|
||||
use Service\GoodsService;
|
||||
use Service\UserService;
|
||||
use Service\BuyService;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
@ -77,11 +78,12 @@ class UserController extends CommonController
|
||||
$user_order_status = OrderService::OrderStatusStepTotal(['user_type'=>'user', 'user'=>$this->user, 'is_comments'=>1]);
|
||||
$this->assign('user_order_status', $user_order_status['data']);
|
||||
|
||||
// 获取列表
|
||||
// 获取进行中的订单列表
|
||||
$params = array_merge($_POST, $_GET);
|
||||
$params['user'] = $this->user;
|
||||
$params['is_more'] = 1;
|
||||
$params['status'] = [1,2,3];
|
||||
$params['status'] = [1,2,3,4];
|
||||
$params['is_comments'] = 0;
|
||||
$where = OrderService::UserOrderListWhere($params);
|
||||
$order_params = array(
|
||||
'limit_start' => 0,
|
||||
@ -91,6 +93,10 @@ class UserController extends CommonController
|
||||
$order = OrderService::OrderList($order_params);
|
||||
$this->assign('order_list', $order['data']);
|
||||
|
||||
// 获取购物车
|
||||
$cart_list = BuyService::CartList(['user'=>$this->user]);
|
||||
$this->assign('cart_list', $cart_list['data']);
|
||||
|
||||
|
||||
$this->display('Index');
|
||||
}
|
||||
|
@ -164,7 +164,7 @@
|
||||
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius submit-ajax submit-cancel" data-url="{{:U('Home/Order/Cancel')}}" data-id="{{$data.id}}" data-view="reload">取消</button>
|
||||
</if>
|
||||
<if condition="in_array($data['status'], [1])">
|
||||
<button class="am-btn am-btn-primary am-btn-xs am-radius submit-pay" data-id="{{$data.id}}" data-payment-id="{{$data.payment_id}}" data-am-modal="{target: '#order-pay-popup'}">支付</button>
|
||||
<button class="am-btn am-btn-primary am-btn-xs am-radius submit-pay" data-id="{{$data.id}}" data-payment-id="{{$data.payment_id}}" data-am-modal="{target: '#order-pay-popup'}" data-is-auto="<if condition="isset($params['is_pay_auto']) and $params['is_pay_auto'] eq 1">1<else />0</if>">支付</button>
|
||||
</if>
|
||||
<if condition="in_array($data['status'], [3])">
|
||||
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius submit-ajax submit-confirm" data-url="{{:U('Home/Order/Collect')}}" data-id="{{$data.id}}" data-view="reload" data-msg="请仔细确认已收到货物、确认继续吗?">收货</button>
|
||||
|
@ -193,7 +193,7 @@
|
||||
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-ajax submit-cancel" data-url="{{:U('Home/Order/Cancel')}}" data-id="{{$order.id}}" data-view="reload">取消</button>
|
||||
</if>
|
||||
<if condition="in_array($order['status'], [1])">
|
||||
<button class="am-btn am-btn-primary am-btn-xs am-radius am-btn-block submit-pay" data-id="{{$order.id}}" data-payment-id="{{$order.payment_id}}" data-am-modal="{target: '#order-pay-popup'}">支付</button>
|
||||
<a class="am-btn am-btn-primary am-btn-xs am-radius am-btn-block" href="{{:U('Home/Order/Detail', ['id'=>$order['id'], 'is_pay_auto'=>1])}}" target="_blank">支付</a>
|
||||
</if>
|
||||
<if condition="in_array($order['status'], [3])">
|
||||
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block submit-ajax submit-confirm" data-url="{{:U('Home/Order/Collect')}}" data-id="{{$order.id}}" data-view="reload" data-msg="请仔细确认已收到货物、确认继续吗?">收货</button>
|
||||
@ -217,45 +217,6 @@
|
||||
<empty name="data_list">
|
||||
<div class="table-no"><i class="am-icon-warning"></i> {{:L('common_not_data_tips')}}</div>
|
||||
</empty>
|
||||
|
||||
<!-- 支付弹窗 -->
|
||||
<div class="am-popup am-radius" id="order-pay-popup">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">支付</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form pay-form" method="post" action="{{:U('Home/Order/Pay')}}">
|
||||
<!-- 支付方式 -->
|
||||
<div class="business-item">
|
||||
<h3>选择支付</h3>
|
||||
<notempty name="buy_payment_list">
|
||||
<ul class="payment-list" data-type="payment">
|
||||
<foreach name="buy_payment_list" item="payment">
|
||||
<li class="payment-items-{{$payment.id}}" data-value="{{$payment.id}}">
|
||||
<notempty name="payment.logo">
|
||||
<img src="{{$payment.logo}}" />
|
||||
</notempty>
|
||||
<span>{{$payment.name}}</span>
|
||||
<i class="icon-active"></i>
|
||||
</li>
|
||||
</foreach>
|
||||
</ul>
|
||||
</notempty>
|
||||
<empty name="buy_payment_list">
|
||||
<div class="table-no"><i class="am-icon-warning"></i> {{:L('order_payment_not_data_tips')}}</div>
|
||||
</empty>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="id" value="0" />
|
||||
<input type="hidden" name="payment_id" value="0" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">确认支付</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="items">
|
||||
<a href="javascript:;" class="am-icon-camera-retro" data-am-modal="{target:'#user-avatar-popup'}"> 修改头像</a>
|
||||
<a href="{{:U('Home/Personal/SaveInfo')}}" class="am-icon-edit"> 修改资料</a>
|
||||
<a href="{{:U('Home/Personal/Index')}}" class="am-icon-edit"> 修改资料</a>
|
||||
<a href="{{:U('Home/UserAddress/Index')}}" class="am-icon-street-view"> 我的地址</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -105,32 +105,52 @@
|
||||
</ul>
|
||||
</notempty>
|
||||
|
||||
<!-- 聚合内容 -->
|
||||
<div class="am-g various">
|
||||
<!-- 进行中的订单 -->
|
||||
<div class="am-u-md-8">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd"><i></i>交易提醒</div>
|
||||
<div class="am-panel-bd">
|
||||
<div class="am-panel-hd">
|
||||
<i></i>交易提醒
|
||||
<notempty name="order_list">
|
||||
<foreach name="order_list" item="v">
|
||||
<foreach name="v.items" key="key" item="goods">
|
||||
<a class="am-fr more-tips" href="{{:U('Home/Order/Index')}}" target="_blank">
|
||||
更多 <span class="am-icon-angle-double-right"></span>
|
||||
</a>
|
||||
</notempty>
|
||||
</div>
|
||||
<div class="am-panel-bd order-list">
|
||||
<notempty name="order_list">
|
||||
<foreach name="order_list" item="order">
|
||||
<foreach name="order.items" key="key" item="goods">
|
||||
<if condition="$key eq 0">
|
||||
<div class="goods-detail">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<a href="{{:U('Home/Order/Detail', ['id'=>$order['id']])}}" target="_blank">
|
||||
<img src="{{$goods.images}}" />
|
||||
</a>
|
||||
<div class="goods-base">
|
||||
<a href="{{$goods.goods_url}}" target="_blank" class="goods-title ellipsis">{{$goods.title}}</a>
|
||||
<a href="{{:U('Home/Order/Detail', ['id'=>$order['id']])}}" target="_blank" class="goods-title ellipsis">{{$goods.title}}</a>
|
||||
<ul>
|
||||
<li>
|
||||
<span>{{$v.add_time_time}}</span>
|
||||
<span class="order-price">¥{{$v.price}}</span>
|
||||
<if condition="$v['items_count'] gt 1">
|
||||
<span class="items-count">{{$v.items_count}}中商品</span>
|
||||
<span>{{$order.add_time_time}}</span>
|
||||
<span class="line-price">¥{{$order.price}}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>{{$order.status_name}}</span>
|
||||
<if condition="$order['items_count'] gt 1">
|
||||
<span class="items-count">等{{$order.items_count}}种商品</span>
|
||||
</if>
|
||||
</li>
|
||||
<li>{{$v.status_name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<if condition="in_array($order['status'], [1])">
|
||||
<a class="am-btn am-btn-primary am-btn-xs am-radius am-fr order-submit" href="{{:U('Home/Order/Detail', ['id'=>$order['id'], 'is_pay_auto'=>1])}}" target="_blank">支付</a>
|
||||
</if>
|
||||
<if condition="in_array($order['status'], [3])">
|
||||
<button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-fr order-submit submit-ajax submit-confirm" data-url="{{:U('Home/Order/Collect')}}" data-id="{{$order.id}}" data-view="reload" data-msg="请仔细确认已收到货物、确认继续吗?">收货</button>
|
||||
</if>
|
||||
<if condition="in_array($order['status'], [4]) and $order['user_is_comments'] eq 0">
|
||||
<a href="{{:U('Home/Order/Comments', ['id'=>$order['id']])}}" target="_blank" class="am-btn am-btn-warning am-btn-xs am-radius am-fr order-submit">评价</a>
|
||||
</if>
|
||||
</div>
|
||||
</if>
|
||||
</foreach>
|
||||
@ -146,10 +166,39 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<div class="am-u-md-4">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd"><i></i>购物车</div>
|
||||
<div class="am-panel-hd">
|
||||
<i></i>购物车
|
||||
<notempty name="cart_list">
|
||||
<a class="am-fr more-tips" href="{{:U('Home/Cart/Index')}}" target="_blank">
|
||||
更多 <span class="am-icon-angle-double-right"></span>
|
||||
</a>
|
||||
</notempty>
|
||||
</div>
|
||||
<div class="am-panel-bd">
|
||||
<notempty name="cart_list">
|
||||
<foreach name="cart_list" item="goods">
|
||||
<if condition="$key lt 3">
|
||||
<div class="goods-detail">
|
||||
<a href="{{:U('Home/Goods/Index', ['id'=>$goods['goods_id']])}}" target="_blank">
|
||||
<img src="{{$goods.images}}" />
|
||||
</a>
|
||||
<div class="goods-base">
|
||||
<a href="{{:U('Home/Goods/Index', ['id'=>$goods['goods_id']])}}" target="_blank" class="goods-title ellipsis">{{$goods.title}}</a>
|
||||
<ul>
|
||||
<li>
|
||||
<span class="line-price">¥{{$goods.price}}</span>
|
||||
<span>x{{$goods.stock}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</if>
|
||||
</foreach>
|
||||
</notempty>
|
||||
<empty name="cart_list">
|
||||
<div class="table-no">
|
||||
<i class="am-icon-opencart am-icon-lg block"></i>
|
||||
@ -160,6 +209,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 收藏商品 -->
|
||||
<div class="am-u-md-8">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd"><i></i>商品收藏</div>
|
||||
@ -174,6 +225,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 浏览足迹 -->
|
||||
<div class="am-u-md-4">
|
||||
<div class="am-panel am-panel-default">
|
||||
<div class="am-panel-hd"><i></i>我的足迹</div>
|
||||
@ -189,8 +242,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
@ -108,23 +108,4 @@ strong.total-price-content { color: #d2364c; font-size: 16px; }
|
||||
.goods-base { margin-left: 45px; }
|
||||
table.data-list td.row-status { border-left: 1px solid #eee; }
|
||||
table.data-ongoing td.row-status { border-left: 1px solid #fff1f5; }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 支付弹窗
|
||||
*/
|
||||
.business-item h3 { border-bottom: 3px solid #e3e3e3; margin-top:5px; font-size: 14px;font-weight: 700; }
|
||||
.business-item ul { padding: 10px 3px 5px 5px; overflow: hidden; }
|
||||
.business-item ul li { border:1px solid transparent ;overflow: hidden; float: left; cursor: pointer; padding: 5px; border: 1px solid #eee; margin: 0 10px 10px 0; }
|
||||
.business-item ul li img { width: 36px; height: 36px; }
|
||||
.business-item ul li.selected { border-color: #d2364c ; position: relative; }
|
||||
.business-item ul li.selected i.icon-active { position: absolute; width: 10px; height: 10px; font-size: 0; line-height: 0; right: 0px; bottom: 0px; background: url(../Images/sys_item_selected.gif) no-repeat right bottom; }
|
||||
@media only screen and (min-width:640px) {
|
||||
.business-item ul li {width:calc(33% - 5px); }
|
||||
.business-item ul li:nth-child(3n) { margin-right: 0; }
|
||||
}
|
||||
@media only screen and (max-width:640px) {
|
||||
.business-item ul li { width: calc(50% - 5px); }
|
||||
.business-item ul li:nth-child(2n) { margin-right: 0; }
|
||||
}
|
||||
}
|
@ -86,10 +86,13 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
|
||||
}
|
||||
|
||||
.various .am-panel-bd {
|
||||
min-height: 212px;
|
||||
max-height: 212px;
|
||||
min-height: 210px;
|
||||
max-height: 210px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.various .am-panel .more-tips {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -129,12 +132,17 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.goods-detail { position: relative; padding: 5px 0; }
|
||||
.goods-detail:not(:last-child) { border-bottom: 1px solid #eee; }
|
||||
.goods-detail { position: relative; padding: 5px 0; height: 70px; }
|
||||
.goods-detail:not(:last-child) { border-bottom: 1px solid #f5f5f5; }
|
||||
.goods-detail img { width: 60px; height: 60px; }
|
||||
.goods-title { display: block; max-height: 36px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
|
||||
.goods-title:hover { text-decoration: underline; }
|
||||
.goods-base { position: absolute; top: 5px; left: 65px; width: calc(100% - 70px); }
|
||||
.goods-base { position: absolute; top: 5px; left: 65px; width: calc(100% - 65px); }
|
||||
.goods-base ul li span:not(:first-child) { margin-left: 10px; }
|
||||
.goods-base .order-price { color: #d2364c; font-weight: 700; }
|
||||
.goods-base ul li { color: #777; }
|
||||
.goods-base .line-price { color: #d2364c; font-weight: 700; }
|
||||
.goods-base ul li { color: #777; }
|
||||
.goods-detail .order-submit { margin-top: 16px; }
|
||||
.order-list .goods-base { width: calc(100% - 120px); }
|
||||
@media only screen and (max-width:640px) {
|
||||
|
||||
}
|
@ -45,7 +45,6 @@ $(function()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 评价打分
|
||||
*/
|
||||
@ -60,4 +59,10 @@ $(function()
|
||||
$(this).parents('td').find('input.input-rating').val(index+1);
|
||||
});
|
||||
|
||||
// 是否自动开启支付窗口
|
||||
if($('.submit-pay').length > 0 && $('.submit-pay').data('is-auto') == 1)
|
||||
{
|
||||
$('.submit-pay').trigger('click');
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user