Authored by 梁志锋

4.7.3

... ... @@ -118,16 +118,20 @@
{{#if cancelOrder}}
<span class="op-item cancel-order">取消订单</span>
{{^}}
{{#if confirmReceived}}
<span class="op-item confirm-received">确认收货</span>
{{#if reBuy}}
<span class="rebuy">再次购买</span>
{{^}}
<a class="op-item{{#if payNow}} pay-now{{/if}}" href="{{href}}" target="_blank">
{{#if payNow}}
立即付款
{{^}}
{{name}}
{{/if}}
</a>
{{#if confirmReceived}}
<span class="op-item confirm-received">确认收货</span>
{{^}}
<a class="op-item{{#if payNow}} pay-now{{/if}}" href="{{href}}" target="_blank">
{{#if payNow}}
立即付款
{{^}}
{{name}}
{{/if}}
</a>
{{/if}}
{{/if}}
{{/if}}
{{/if}}
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

48.3 KB | W: | H:

48.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.64 KB | W: | H:

8.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -130,7 +130,17 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() {
};
choiceOut(dataJSON);
});
// 滚动到第一个选中的商品
function scrollToFirst(){
var $selected = $('.pay-wapper tbody tr').find('.cart-item-check:checked');
var top = 0;
if($selected.length > 0){
$selected = $selected.eq(0);
}
top = $selected.offset().top - 36;
$('html,body').scrollTop(top);
return false;
}
function isCheck(obj, className) {
selectArray = [];
dataJSON = {};
... ... @@ -880,4 +890,5 @@ $payWapper.on('selectstart', function() {
});
$goodsDetail.on('selectstart', function() {
return false;
});
\ No newline at end of file
});
scrollToFirst();
\ No newline at end of file
... ...
... ... @@ -181,7 +181,24 @@ $('.me-orders, .order-detail').on('click', '.cancel-order', function (e) {
active = editOrder($(this).closest('.order, .order-detail').data('id'))
active.show();
newAddress(0);
}).on('click', '.rebuy', function() {
var id = $(this).closest('.order, .order-detail').data('id');
buyAgain(id);
});
//再次购买
function buyAgain(id){
$.ajax({
type: 'post',
url: '/home/orders/reAdd',
data: {orderCode: id}
}).then(function(d) {
if (d.code === 200) {
location.href = '/shopping/cart';
} else {
new dialog.Alert(d.message).show();
}
})
}
function deleteOrder(id, obj) {
// 是否为彻底删除
var isFullyDelete = true;
... ... @@ -551,4 +568,4 @@ function validateForm() {
}
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -275,6 +275,16 @@
border-radius: 4px;
width: 68px;
}
.operation .rebuy{
display: inline-block;
box-sizing: border-box;
width: 68px;
height: 18px;
line-height: 18px;
border-radius: 5px;
text-align: center;
border: 1px solid #000;
}
}
}
... ...
<?php
use Action\AbstractAction;
use LibModels\Wap\Category\FocusData;
/**
* 品牌
*/
class FocusController extends AbstractAction
{
public function indexAction()
{
// 获取关注数据
$gender = $this->get('gender', '1,3');
$focusData = FocusData::getFocusData(0, $gender);
$focus = array();
if ($focusData['code'] == 200) {
$focus = $focusData['data'];
}
echo '<pre>';
var_dump($focus);
exit;
$this->_view->assign('title', 'YOHO!BUY 有货');
$this->_view->display('class', compact('focus'));
}
}
... ... @@ -579,6 +579,10 @@ class OrderModel
$exchangeUrl = Helpers::url('/home/returns/exchangeRequest', array('orderCode' => $orderCode));
//申请退货
$refundUrl = Helpers::url('/home/returns/refundrequest', array('orderCode' => $orderCode));
//再次购买
if ( $isCancel == 'Y') {
$operation[] = array( 'name' => '再次购买', 'reBuy' => true);
}
//立即付款
if ($payStatus == 'N' && $paymentType != 2 && $isCancel == 'N') {
$operation[] = array('payNow' => true, 'href' => $payUrl);
... ... @@ -611,6 +615,8 @@ class OrderModel
if ($status >= 6 && $time < 86400 * $orderRefundLimitTime && $attribute != 3 && $isCancel == 'N') {
$operation[] = array('href' => $refundUrl, 'name' => '申请退货', 'optDis' => $opRefundStatus);
}
return $operation;
}
... ...
... ... @@ -267,6 +267,40 @@ class OrdersController extends WebAction
$this->echoJson($result);
}
/**
* 我的订单——再次购买
*/
public function reAddAction()
{
$result = array('code' => 401, 'message' => '商品加入购物车失败', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
//获取相关参数
$uid = $this->getUid(true);
$orderCode = $this->post('orderCode', '');
if (!$uid || !$orderCode) {
$result = array('code' => 400, 'message' => '缺失参数', 'data' => '');
break;
}
$reAddData = OrderData::reAddData($uid, $orderCode);
if(!isset($reAddData['code']) || $reAddData['code'] != 200){
break;
}
$result = array('code' => 200, 'message' => '商品已重新加入购物车', 'data' => $reAddData['data']);
if (!isset($result['code'])) {
break;
}
}
while (false);
$this->echoJson($result);
}
/**
* 还原订单
... ...