Showing
1 changed file
with
17 additions
and
44 deletions
@@ -19,52 +19,25 @@ for (i = keyVal.length; i > 0; i--) { | @@ -19,52 +19,25 @@ for (i = keyVal.length; i > 0; i--) { | ||
19 | key = key[0]; | 19 | key = key[0]; |
20 | 20 | ||
21 | //初始化默认参数 | 21 | //初始化默认参数 |
22 | - switch (key) { | ||
23 | - case 'gender': | ||
24 | - opt.gender = val; | ||
25 | - break; | ||
26 | - case 'brand': | ||
27 | - opt.brand = val; | ||
28 | - break; | ||
29 | - case 'sort': | ||
30 | - opt.sort = val; | ||
31 | - break; | ||
32 | - case 'msort': | ||
33 | - opt.msort = val; | ||
34 | - break; | ||
35 | - case 'misort': | ||
36 | - opt.misort = val; | ||
37 | - break; | ||
38 | - case 'color': | ||
39 | - opt.color = val; | ||
40 | - break; | ||
41 | - case 'size': | ||
42 | - opt.size = val; | ||
43 | - break; | ||
44 | - case 'price': | ||
45 | - opt.price = val; | ||
46 | - break; | ||
47 | - case 'discount': | ||
48 | - opt.discount = val; | ||
49 | - break; | ||
50 | - case 'query': | ||
51 | - opt.query = val; | ||
52 | - break; | ||
53 | - case 'style': | ||
54 | - opt.style = val; | ||
55 | - break; | ||
56 | - case 'limit': | ||
57 | - opt.limit = val; | ||
58 | - break; | ||
59 | - case 'channel': | ||
60 | - opt.channel = val; | ||
61 | - break; | ||
62 | - case 'p_d': | ||
63 | - opt.p_d = val; | 22 | + opt[key] = val; |
23 | + | ||
24 | + //discount = p_d,同时需要两个参数 | ||
25 | + if (key === 'discount' || key === 'p_d') { | ||
26 | + opt.discount = val; | ||
27 | + opt.p_d = val; | ||
28 | + } | ||
29 | +} | ||
30 | + | ||
31 | +if (typeof opt.gender === 'undefined') { | ||
32 | + switch (window.cookie('_Channel')) { | ||
33 | + case 'boys': | ||
34 | + opt.gender = '1,3'; | ||
64 | break; | 35 | break; |
65 | - case 'dayLimit': | ||
66 | - opt.dayLimit = val; | 36 | + case 'girls': |
37 | + opt.gender = '2,3'; | ||
67 | break; | 38 | break; |
39 | + default: | ||
40 | + opt.gender = '1,2,3'; | ||
68 | } | 41 | } |
69 | } | 42 | } |
70 | 43 |
-
Please register or login to post a comment