mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-01 03:18:33 +08:00
优化
This commit is contained in:
parent
e9b1a76cab
commit
60868e4afe
@ -387,6 +387,22 @@ class BuyService
|
||||
return self::CartList($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下订单购物车删除
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2018-10-12T00:42:49+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function BuyCartDelete($params = [])
|
||||
{
|
||||
if(isset($params['buy_type']) && $params['buy_type'] == 'cart' && !empty($params['ids']))
|
||||
{
|
||||
M('Cart')->where(['id'=>['in', explode(',', $params['ids'])]])->delete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据购买类型获取商品列表
|
||||
* @author Devil
|
||||
@ -627,8 +643,13 @@ class BuyService
|
||||
$m->rollback();
|
||||
return DataReturn('订单添加失败', -1);
|
||||
}
|
||||
|
||||
// 订单提交成功
|
||||
$m->commit();
|
||||
|
||||
// 删除购物车
|
||||
self::BuyCartDelete($params);
|
||||
|
||||
// 获取订单信息
|
||||
switch($order['status'])
|
||||
{
|
||||
|
@ -141,6 +141,7 @@ ul.address-list, .business-item ul { overflow: hidden; }
|
||||
.pay-confirm em { font-size: 12px; }
|
||||
.pay-confirm .nav-total-price { color: #d2364c; font-weight: 700; }
|
||||
.order-nav { background: #f5f5f5; }
|
||||
.am-footer { padding-bottom: 45px; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ if(!store.enabled)
|
||||
} else {
|
||||
// 选择缓存key
|
||||
var store_address_key = 'store-buy-address-selected-index';
|
||||
var store_use_new_address_status_key = 'store-buy-use-new-address-status-count';
|
||||
var store_logistics_key = 'store-lbuy-ogistics-selected-index';
|
||||
var store_payment_key = 'store-buy-payment-selected-index';
|
||||
}
|
||||
@ -14,6 +15,18 @@ $(function()
|
||||
// 选中处理
|
||||
if(store.enabled)
|
||||
{
|
||||
// 是否使用新地址
|
||||
var store_address_use_status = store.get(store_use_new_address_status_key);
|
||||
if(store_address_use_status !== undefined)
|
||||
{
|
||||
// 如果新的地址大于使用新地址标记数量则使用第一个地址
|
||||
if(store_address_use_status < $('ul.address-list li').length)
|
||||
{
|
||||
store.set(store_address_key, 0);
|
||||
store.set(store_use_new_address_status_key, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
// 地址
|
||||
var store_address_value = store.get(store_address_key);
|
||||
if(store_address_value !== undefined)
|
||||
@ -84,6 +97,9 @@ $(function()
|
||||
|
||||
// 阻止事件冒泡
|
||||
e.stopPropagation();
|
||||
|
||||
// 使用新地址标记
|
||||
store.set(store_use_new_address_status_key, $('ul.address-list li').length);
|
||||
});
|
||||
|
||||
// 阻止事件冒泡
|
||||
|
@ -143,7 +143,7 @@ $(function()
|
||||
function cart_nav_pop()
|
||||
{
|
||||
var scroll = $(document).scrollTop();
|
||||
var location = scroll+$(window).height()-65;
|
||||
var location = scroll+$(window).height()-100;
|
||||
var bottom = ($(window).width() < 640) ? '49px' : '0';
|
||||
if(location < nav_top)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user