|
@@ -5,7 +5,6 @@ |
|
@@ -5,7 +5,6 @@ |
5
|
*/
|
5
|
*/
|
6
|
|
6
|
|
7
|
var $ = require('jquery'),
|
7
|
var $ = require('jquery'),
|
8
|
- lazyLoad = require('yoho.lazyload'),
|
|
|
9
|
Hammer = require('yoho.hammer');
|
8
|
Hammer = require('yoho.hammer');
|
10
|
|
9
|
|
11
|
var chosePanel = require('./chose-panel'),
|
10
|
var chosePanel = require('./chose-panel'),
|
|
@@ -40,9 +39,15 @@ function shouldSelectGift() { |
|
@@ -40,9 +39,15 @@ function shouldSelectGift() { |
40
|
}
|
39
|
}
|
41
|
|
40
|
|
42
|
function shouldLowStocks() {
|
41
|
function shouldLowStocks() {
|
43
|
- var $lowStocks = $('.low-stocks'),
|
42
|
+ var $lowStocks,
|
44
|
result = false;
|
43
|
result = false;
|
45
|
|
44
|
|
|
|
45
|
+ if ('ordinary' === cartType) {
|
|
|
46
|
+ $lowStocks = $('.common .low-stocks');
|
|
|
47
|
+ } else if ('advance' === cartType) {
|
|
|
48
|
+ $lowStocks = $('.presell .low-stocks');
|
|
|
49
|
+ }
|
|
|
50
|
+
|
46
|
if ($lowStocks.length <= 0) {
|
51
|
if ($lowStocks.length <= 0) {
|
47
|
return result;
|
52
|
return result;
|
48
|
}
|
53
|
}
|
|
@@ -73,7 +78,7 @@ function showChooseGifDialog() { |
|
@@ -73,7 +78,7 @@ function showChooseGifDialog() { |
73
|
|
78
|
|
74
|
require('./good');
|
79
|
require('./good');
|
75
|
|
80
|
|
76
|
-lazyLoad($('img.lazy'));
|
81
|
+//lazyLoad($('img.lazy'));
|
77
|
|
82
|
|
78
|
if (typeof window.cookie === 'function' && 'y' === window.cookie('_hasShowCartPresellTip')) {
|
83
|
if (typeof window.cookie === 'function' && 'y' === window.cookie('_hasShowCartPresellTip')) {
|
79
|
$('#presell-tip').removeClass('show').addClass('hide');
|
84
|
$('#presell-tip').removeClass('show').addClass('hide');
|
|
@@ -151,7 +156,7 @@ if ($('.freebie').length > 0) { |
|
@@ -151,7 +156,7 @@ if ($('.freebie').length > 0) { |
151
|
|
156
|
|
152
|
$('.btn-balance').on('touchend', function() {
|
157
|
$('.btn-balance').on('touchend', function() {
|
153
|
if (shouldLowStocks()) {
|
158
|
if (shouldLowStocks()) {
|
154
|
- tip.show('库存不足无法结算');
|
159
|
+ tip.show('所选商品中含有库存不足的商品');
|
155
|
return false;
|
160
|
return false;
|
156
|
}
|
161
|
}
|
157
|
|
162
|
|