|
@@ -14,7 +14,20 @@ var $ = require('jquery'); |
|
@@ -14,7 +14,20 @@ var $ = require('jquery'); |
14
|
var $num,
|
14
|
var $num,
|
15
|
$chosed,
|
15
|
$chosed,
|
16
|
re = /\d+/,
|
16
|
re = /\d+/,
|
17
|
- leftNum;
|
17
|
+ leftNum,
|
|
|
18
|
+ $colorList = $('.color-list ul>li'),
|
|
|
19
|
+ $sizeList = $('.size-list ul>li'),
|
|
|
20
|
+ firstColorId = $colorList.eq(0).data('id');
|
|
|
21
|
+
|
|
|
22
|
+//初始化购物车面板显示
|
|
|
23
|
+$sizeList.each(function() {
|
|
|
24
|
+ var id = $(this).data('colorid');
|
|
|
25
|
+
|
|
|
26
|
+
|
|
|
27
|
+ if (id === firstColorId) {
|
|
|
28
|
+ $(this).removeClass('hide');
|
|
|
29
|
+ }
|
|
|
30
|
+});
|
18
|
|
31
|
|
19
|
// confirm;
|
32
|
// confirm;
|
20
|
|
33
|
|
|
@@ -39,6 +52,8 @@ var $num, |
|
@@ -39,6 +52,8 @@ var $num, |
39
|
// $num = $('#good-num');
|
52
|
// $num = $('#good-num');
|
40
|
// }
|
53
|
// }
|
41
|
|
54
|
|
|
|
55
|
+
|
|
|
56
|
+
|
42
|
function show() {
|
57
|
function show() {
|
43
|
$('.chose-panel').show();
|
58
|
$('.chose-panel').show();
|
44
|
|
59
|
|
|
@@ -63,12 +78,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
|
@@ -63,12 +78,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
63
|
remove();
|
78
|
remove();
|
64
|
}).on('touchstart', '#chose-btn-sure', function() {
|
79
|
}).on('touchstart', '#chose-btn-sure', function() {
|
65
|
|
80
|
|
66
|
- // var
|
|
|
67
|
- // // goodId,
|
|
|
68
|
- // // skuId,
|
|
|
69
|
- // skcId = $('.color-list li.chosed').data('skcid'),
|
|
|
70
|
- // colorIndex = $('.color-list li.chosed').index(),
|
|
|
71
|
- // skuArray = $('.size-list').data('skustr').split('/');
|
81
|
+ // var productSku,
|
|
|
82
|
+ // buyNumber = $('#good-num') - 0;
|
|
|
83
|
+ // promotionId,
|
|
|
84
|
+ // goodsType,
|
|
|
85
|
+ // isEdit;
|
72
|
|
86
|
|
73
|
// //确定
|
87
|
// //确定
|
74
|
// $chosed = $('.block-list>ul>li.chosed');
|
88
|
// $chosed = $('.block-list>ul>li.chosed');
|
|
@@ -83,7 +97,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
|
@@ -83,7 +97,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { |
83
|
// loading.showLoadingMask();
|
97
|
// loading.showLoadingMask();
|
84
|
// $.ajax({
|
98
|
// $.ajax({
|
85
|
// method: 'POST',
|
99
|
// method: 'POST',
|
86
|
- // url: '/product/detail/xxxx',
|
100
|
+ // url: '/cart/index/add',
|
87
|
// data: {
|
101
|
// data: {
|
88
|
// product_id: productId,
|
102
|
// product_id: productId,
|
89
|
// content: content
|
103
|
// content: content
|