Authored by hf

do gulp ge merge css js gzip

Showing 42 changed files with 1439 additions and 447 deletions
@@ -3,6 +3,7 @@ nbproject @@ -3,6 +3,7 @@ nbproject
3 .idea 3 .idea
4 .gitignore 4 .gitignore
5 .gitmodules 5 .gitmodules
6 -#compile/  
7 -#assets/  
8 -script/nginx/logs  
  6 +compile/
  7 +assets/
  8 +script/nginx/logs
  9 +npm-debug.log
  1 +# 开发环境配置说明文档
  2 +
  3 +## 需要的东西
  4 +
  5 +* node/npm
  6 +* compass(compass依赖ruby,需使用gem install compass进行安装)
  7 +* git
  8 +* PHP5.3
  9 +* Nginx
  10 +
  11 +## 步骤
  12 +
  13 +### NODE安装
  14 +
  15 +[node官方](https://nodejs.org/en/)下载后安装即可
  16 +
  17 +### SPM安装
  18 +
  19 +项目使用spm作为前端资源调试、打包的工具,通过npm安装。注意:spm版本统一使用**3.4.1**
  20 +
  21 +`npm install -g spm@3.4.1`
  22 +
  23 +### ruby->compass安装
  24 +
  25 +[ruby官方Downloads](https://www.ruby-lang.org/en/downloads/)下载安装
  26 +
  27 +任务栏打开 `Start Command Prompt With Ruby`,运行 `gem install compass`安装
  28 +
  29 +PS:此步可能由于国外源的问题下载比较慢,可以更换源或者直接copy他人目录
  30 +
  31 +### 安装GIT
  32 +
  33 +[GIT官方](http://git-scm.com/download/)
  34 +
  35 +### GIT账号
  36 +* [git.dev.yoho.cn](git.dev.yoho.cn)注册git账号
  37 +* 将注册的账号告知组长,开放权限
  38 +* 配置git账号给`git config --global user.name "your name"` / `git config --global user.email "your email"`
  39 +* 在GIT BASH中运行`ssh-keygen -t rsa -C "your email"`,将~/.ssh目录下的pubkey的内容copy到git.dev.yoho.cn中的SSH Keys中
  40 +
  41 +### 拉取代码
  42 +* git clone git@git.dev.yoho.cn:web/yohobuy.git
  43 +* git checkout develop
  44 +* git submodule init
  45 +* git submodule update
  46 +
  47 +### PHP和Nginx
  48 +
  49 +如果不想自己搭建和配置,直接copy同桌的目录来就可以了,nginx和php5.3.29。copy后修改nginx配置中的路径就可以了:
  50 +conf/vhosts,nginx注册表文件,restart-nginx.bat, start-nginx.bat, start-php5.3.29.bat
  51 +
  52 +修改完成后可以直接点击start-php5.3.29.bat 和 start-nginx.bat启动PHP和NGINX的服务
  53 +
  54 +### 配置HOSTS
  55 +127.0.0.1 m.dev.yohobuy.com
  56 +127.0.0.1 static.m.dev.yohobuy.com
  57 +
  58 +### 最后一步
  59 +进入yohobuy/static目录,运行npm install 和 spm install安装下依赖, 成功后在当前目录运行`gulp`启动开发环境服务...看看[m.dev.yohobuy.com](m.dev.yohobuy.com)有没有反应?
  60 +
  61 +Done ? 'congratulations' : '看看是不是缺了什么,不能解决的时候再问问其他人看看'
  62 +
  63 +## 其他你需要做的事情
  64 +* js代码风格严格控制,所以请按照[代码规范](http://git.dev.yoho.cn/web/learning-documentation/tree/master/%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91%E7%9B%B8%E5%85%B3/%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83)编码,JS代码采用了pre-commit的hook进行控制,之前需要你安装下[代码检查](http://git.dev.yoho.cn/ued/yoho-fe/tree/master/code-checker)所需要的东西,请了解并执行。
  65 +* GIT使用规范你需要熟读,可以看[git flow](http://git.dev.yoho.cn/web/learning-documentation/wikis/home)[pro git](http://git-scm.com/book/en/v2)
  66 +* 其他开发中使用到的东西(handlebars,sass,seajs,spm等)请参考git库web/learing documentation或者自行google
@@ -10,6 +10,8 @@ class CacheConfig @@ -10,6 +10,8 @@ class CacheConfig
10 /* 公共的数据缓存 */ 10 /* 公共的数据缓存 */
11 const KEY_COMMON_SIDE_NAV = 'key_common_side_nav'; // 公共的侧边栏 11 const KEY_COMMON_SIDE_NAV = 'key_common_side_nav'; // 公共的侧边栏
12 12
  13 + const KEY_CATEGORY_CLASSES_DATA = 'key_category_classes_data'; // 品类数据
  14 +
13 /* 控制器方法中的数据缓存 */ 15 /* 控制器方法中的数据缓存 */
14 const KEY_ACTION_INDEX_INDEX = 'key_action_index_index'; // 频道选择 16 const KEY_ACTION_INDEX_INDEX = 'key_action_index_index'; // 频道选择
15 const KEY_ACTION_BOYS_INDEX = 'key_action_boys_index'; // 男生首页 17 const KEY_ACTION_BOYS_INDEX = 'key_action_boys_index'; // 男生首页
@@ -17,10 +19,16 @@ class CacheConfig @@ -17,10 +19,16 @@ class CacheConfig
17 const KEY_ACTION_KIDS_INDEX = 'key_action_kids_index'; // 潮童首页 19 const KEY_ACTION_KIDS_INDEX = 'key_action_kids_index'; // 潮童首页
18 const KEY_ACTION_LIFESTYLE_INDEX = 'key_action_lifestyle_index'; // 创意生活首页 20 const KEY_ACTION_LIFESTYLE_INDEX = 'key_action_lifestyle_index'; // 创意生活首页
19 21
20 - const KEY_ACTION_PRODUCT_NEWSALE_INDEX = 'key_action_product_newsale_index'; // 新品到着  
21 - const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT = 'key_action_product_newsale_discount'; // 折扣专区  
22 -  
23 const KEY_ACTION_GUANG_PLUSSTAR_INDEX = 'key_action_guang_plusstar_index'; // 国际优选 22 const KEY_ACTION_GUANG_PLUSSTAR_INDEX = 'key_action_guang_plusstar_index'; // 国际优选
24 const KEY_ACTION_GUANG_PLUSSTAR_LIST = 'key_action_guang_plusstar_list'; // 明星原创 23 const KEY_ACTION_GUANG_PLUSSTAR_LIST = 'key_action_guang_plusstar_list'; // 明星原创
25 24
  25 + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS = 'key_action_product_newsale_index_bodys'; // 男生新品到着
  26 + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS = 'key_action_product_newsale_index_girls'; // 女生新品到着
  27 + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_KIDS = 'key_action_product_newsale_index_kids'; // 潮童新品到着
  28 + const KEY_ACTION_PRODUCT_NEWSALE_INDEX_LIFESTYLE = 'key_action_product_newsale_index_lifestyle'; // 创意生活新品到着
  29 + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_BOYS = 'key_action_product_newsale_discount_boys'; // 男生折扣专区
  30 + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS = 'key_action_product_newsale_discount_girls'; // 女生折扣专区
  31 + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS = 'key_action_product_newsale_discount_kids'; // 潮童折扣专区
  32 + const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE = 'key_action_product_newsale_discount_lifestyle'; // 创意生活折扣专区
  33 +
26 } 34 }
@@ -36,7 +36,7 @@ class ClassData @@ -36,7 +36,7 @@ class ClassData
36 * 36 *
37 * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 37 * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
38 * @param integer $brand 品牌Id 38 * @param integer $brand 品牌Id
39 - * @param integer $sort 品类Id 39 + * @param integer $sort 品类查询sort参数
40 * @param integer $color 颜色Id 40 * @param integer $color 颜色Id
41 * @param integer $size 尺码Id 41 * @param integer $size 尺码Id
42 * @param string $price 价格 42 * @param string $price 价格
@@ -40,9 +40,11 @@ class SearchData @@ -40,9 +40,11 @@ class SearchData
40 * @param string $query 查询条件, 默认为null 40 * @param string $query 查询条件, 默认为null
41 * @param string $brand 品牌,默认为null 41 * @param string $brand 品牌,默认为null
42 * @param string $gender 性别,默认为null,"1,3"表示男, "2,3"表示女, "1,2,3"表示全部 42 * @param string $gender 性别,默认为null,"1,3"表示男, "2,3"表示女, "1,2,3"表示全部
  43 + * @param integer $color 颜色id
  44 + * @param integer $size 尺码id
  45 + * @param integer $price 价格
43 * @param string $p_d 折扣,默认为null 46 * @param string $p_d 折扣,默认为null
44 - * @param string $misort 商品分类,默认为null  
45 - * @param string $msort 商品分类,默认为null 47 + * @param string $sort 商品所属品类,默认为null
46 * @param string $order 排序方式,默认为按照时间倒序排列s_t_desc, 48 * @param string $order 排序方式,默认为按照时间倒序排列s_t_desc,
47 * s_t_asc表示按时间正序排列, 49 * s_t_asc表示按时间正序排列,
48 * s_p_asc表示按价格正序排列, 50 * s_p_asc表示按价格正序排列,
@@ -50,10 +52,11 @@ class SearchData @@ -50,10 +52,11 @@ class SearchData
50 * p_d_asc表示按折扣正序排列, 52 * p_d_asc表示按折扣正序排列,
51 * p_d_desc表示按折扣倒序排列 53 * p_d_desc表示按折扣倒序排列
52 * @param integer $page 指定查询是多少页,默认为第一页 54 * @param integer $page 指定查询是多少页,默认为第一页
53 - * @param integer $limit 指定查询多少个,默认是60哥 55 + * @param integer $limit 指定查询多少个,默认是60个
  56 + * @param integer $channel表示哪个频道,1表示男生,2表示女生,3表示潮童,4表示创意生活
54 * @return array 搜索到的数据 57 * @return array 搜索到的数据
55 */ 58 */
56 - public static function searchLiDatas($query = null, $brand = null, $gender = null, $p_d = null, $misort = null, $msort = null, $order = 's_t_desc', $page = 1, $limit = 60) 59 + public static function searchLiDatas($query = null, $brand = null, $gender = null, $color = null, $size = null, $price = null, $p_d = null, $sort = null, $order = 's_t_desc', $page = 1, $limit = 60, $channel = null)
57 { 60 {
58 // 构建必传参数 61 // 构建必传参数
59 $param = Yohobuy::param(); 62 $param = Yohobuy::param();
@@ -61,9 +64,12 @@ class SearchData @@ -61,9 +64,12 @@ class SearchData
61 is_null($query) || $param['query'] = $query; 64 is_null($query) || $param['query'] = $query;
62 is_null($brand) || $param['brand'] = $brand; 65 is_null($brand) || $param['brand'] = $brand;
63 is_null($gender) || $param['gender'] = $gender; 66 is_null($gender) || $param['gender'] = $gender;
  67 + is_null($color) || $param['color'] = $color;
  68 + is_null($size) || $param['size'] = $size;
  69 + is_null($price) || $param['price'] = $price;
64 is_null($p_d) || $param['p_d'] = $p_d; 70 is_null($p_d) || $param['p_d'] = $p_d;
65 - is_null($misort) || $param['misort'] = $misort;  
66 - is_null($msort) || $param['msort'] = $msort; 71 + is_null($sort) || $param['sort'] = $sort;
  72 + is_null($channel) || $param['channel'] = $channel;
67 $param['method'] = 'app.search.li'; 73 $param['method'] = 'app.search.li';
68 $param['order'] = $order; 74 $param['order'] = $order;
69 $param['page'] = $page; 75 $param['page'] = $page;
1 -<?php  
2 -  
3 -namespace Plugin\DataProcess;  
4 -  
5 -/**  
6 - * 分类数据处理类  
7 - */  
8 -class ClassProcess  
9 -{  
10 -  
11 - /**  
12 - * 处理品类数据  
13 - * @param $data  
14 - * @return array 处理之后的品类数据  
15 - */  
16 - public static function getClassData($data)  
17 - {  
18 - $num = 1;  
19 - $classes = array();  
20 -  
21 - foreach ($data as $k => $v){  
22 - $oneClass = array('name'=>$k, 'ca'=>array());  
23 - if($num === 1)  
24 - {  
25 - $oneClass['focus'] = true;  
26 - }  
27 -  
28 - foreach ($v as $val) {  
29 - $item = array();  
30 - $item['name'] = $val['category_name'];  
31 - foreach ($val['sub'] as $value) {  
32 - $subitem = array();  
33 - $subitem['name'] = $value['category_name'];  
34 - $subitem['url'] = $value['category_id'];  
35 -  
36 - $item['sub'][] = $subitem;  
37 - }  
38 -  
39 - $oneClass['ca'][] = $item;  
40 - }  
41 -  
42 - $num++;  
43 - $classes[] = $oneClass;  
44 - }  
45 -  
46 - return $classes;  
47 -  
48 - }  
49 -}  
@@ -91,6 +91,7 @@ class ListProcess @@ -91,6 +91,7 @@ class ListProcess
91 $result = array( 91 $result = array(
92 'title' => '品牌', 92 'title' => '品牌',
93 'name' => '所有品牌', 93 'name' => '所有品牌',
  94 + 'dataType' => 'brand',
94 'subs' => array( 95 'subs' => array(
95 array( 96 array(
96 'chosed' => true, 97 'chosed' => true,
@@ -119,6 +120,7 @@ class ListProcess @@ -119,6 +120,7 @@ class ListProcess
119 $result = array( 120 $result = array(
120 'title' => '颜色', 121 'title' => '颜色',
121 'name' => '所有颜色', 122 'name' => '所有颜色',
  123 + 'dataType' => 'color',
122 'subs' => array( 124 'subs' => array(
123 array( 125 array(
124 'chosed' => true, 126 'chosed' => true,
@@ -144,6 +146,7 @@ class ListProcess @@ -144,6 +146,7 @@ class ListProcess
144 $result = array( 146 $result = array(
145 'title' => '折扣', 147 'title' => '折扣',
146 'name' => '所有商品', 148 'name' => '所有商品',
  149 + 'dataType' => 'discount',
147 'subs' => array( 150 'subs' => array(
148 array( 151 array(
149 'chosed' => true, 152 'chosed' => true,
@@ -169,6 +172,7 @@ class ListProcess @@ -169,6 +172,7 @@ class ListProcess
169 $result = array( 172 $result = array(
170 'title' => '性别', 173 'title' => '性别',
171 'name' => '所有性别', 174 'name' => '所有性别',
  175 + 'dataType' => 'gender',
172 'subs' => array( 176 'subs' => array(
173 array( 177 array(
174 'chosed' => true, 178 'chosed' => true,
@@ -176,11 +180,11 @@ class ListProcess @@ -176,11 +180,11 @@ class ListProcess
176 'name' => '所有性别' 180 'name' => '所有性别'
177 ), 181 ),
178 array( 182 array(
179 - 'dataId' => 1, 183 + 'dataId' => 'boys',
180 'name' => '男' 184 'name' => '男'
181 ), 185 ),
182 array( 186 array(
183 - 'dataId' => 2, 187 + 'dataId' => 'girls',
184 'name' => '女' 188 'name' => '女'
185 ), 189 ),
186 ) 190 )
@@ -194,6 +198,7 @@ class ListProcess @@ -194,6 +198,7 @@ class ListProcess
194 $result = array( 198 $result = array(
195 'title' => '品类', 199 'title' => '品类',
196 'name' => '所有品类', 200 'name' => '所有品类',
  201 + 'dataType' => 'msort',
197 'subs' => array( 202 'subs' => array(
198 array( 203 array(
199 'chosed' => true, 204 'chosed' => true,
@@ -205,10 +210,10 @@ class ListProcess @@ -205,10 +210,10 @@ class ListProcess
205 210
206 foreach ($data as $one) { 211 foreach ($data as $one) {
207 $category = array(); 212 $category = array();
208 - $category['dataId'] = $one['category_id']; 213 + $category['dataId'] = isset($one['relation_parameter']) ? $one['relation_parameter']['sort'] : 0;
209 $category['name'] = $one['category_name']; 214 $category['name'] = $one['category_name'];
210 215
211 - // 子品类 216 + /*// 子品类(目前h5不支持二级)
212 if(isset($one['sub'])) 217 if(isset($one['sub']))
213 { 218 {
214 $category['subs'] = array(); 219 $category['subs'] = array();
@@ -219,7 +224,7 @@ class ListProcess @@ -219,7 +224,7 @@ class ListProcess
219 224
220 $category['subs'][] = $subitem; 225 $category['subs'][] = $subitem;
221 } 226 }
222 - } 227 + }*/
223 228
224 $result['subs'][] = $category; 229 $result['subs'][] = $category;
225 } 230 }
@@ -232,6 +237,7 @@ class ListProcess @@ -232,6 +237,7 @@ class ListProcess
232 $result = array( 237 $result = array(
233 'title' => '价格', 238 'title' => '价格',
234 'name' => '所有价格', 239 'name' => '所有价格',
  240 + 'dataType' => 'price',
235 'subs' => array( 241 'subs' => array(
236 array( 242 array(
237 'chosed' => true, 243 'chosed' => true,
@@ -241,11 +247,12 @@ class ListProcess @@ -241,11 +247,12 @@ class ListProcess
241 ) 247 )
242 ); 248 );
243 249
244 - foreach ($data as $one) { 250 + foreach ($data as $key => $one) {
245 $price = array(); 251 $price = array();
  252 + $price['dataId'] = $key;
246 $price['name'] = $one; 253 $price['name'] = $one;
247 254
248 - $result[] = $price; 255 + $result['subs'][] = $price;
249 } 256 }
250 257
251 return $result; 258 return $result;
@@ -256,6 +263,7 @@ class ListProcess @@ -256,6 +263,7 @@ class ListProcess
256 $result = array( 263 $result = array(
257 'title' => '尺码', 264 'title' => '尺码',
258 'name' => '所有尺码', 265 'name' => '所有尺码',
  266 + 'dataType' => 'size',
259 'subs' => array( 267 'subs' => array(
260 array( 268 array(
261 'chosed' => true, 269 'chosed' => true,
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 namespace Plugin\DataProcess; 3 namespace Plugin\DataProcess;
4 4
  5 +use Plugin\DataProcess\ListProcess;
5 use Plugin\Helpers; 6 use Plugin\Helpers;
6 7
7 /** 8 /**
@@ -22,11 +23,16 @@ class NewSaleProcess @@ -22,11 +23,16 @@ class NewSaleProcess
22 $noTab = true; 23 $noTab = true;
23 $productsLi = array(); 24 $productsLi = array();
24 $tabItem = array(); 25 $tabItem = array();
25 - 26 +
26 foreach ($products as $single) { 27 foreach ($products as $single) {
27 if (empty($single)) { 28 if (empty($single)) {
28 continue; 29 continue;
29 } 30 }
  31 +
  32 + // 处理Filter
  33 + if(isset($single['filter'])) {
  34 + $result['filter'] = ListProcess::getFilterData($single['filter']);
  35 + }
30 36
31 // 处理Tabs 37 // 处理Tabs
32 $noTab = true; 38 $noTab = true;
@@ -35,6 +41,7 @@ class NewSaleProcess @@ -35,6 +41,7 @@ class NewSaleProcess
35 foreach ($single['tabs'] as $key => $one) { 41 foreach ($single['tabs'] as $key => $one) {
36 $tabItem = array(); 42 $tabItem = array();
37 $tabItem['title'] = $one; 43 $tabItem['title'] = $one;
  44 + $tabItem['dataId'] = $key;
38 if ($key === 1) { 45 if ($key === 1) {
39 $tabItem['focus'] = true; 46 $tabItem['focus'] = true;
40 } 47 }
@@ -62,23 +69,4 @@ class NewSaleProcess @@ -62,23 +69,4 @@ class NewSaleProcess
62 return $result; 69 return $result;
63 } 70 }
64 71
65 - /**  
66 - * 筛选出来的商品数据处理  
67 - *  
68 - * @param array $data 筛选出来的原数据  
69 - * @return array 处理之后的数据  
70 - */  
71 - public static function selectData($data)  
72 - {  
73 - $result = array('goods' => array());  
74 -  
75 - if (isset($data['code']) && $data['code'] === 200) {  
76 - foreach ($data['data']['product_list'] as $val) {  
77 - $result['goods'][] = Helpers::formatProduct($val);  
78 - }  
79 - }  
80 -  
81 - return $result;  
82 - }  
83 -  
84 } 72 }
1 -0 info it worked if it ends with ok  
2 -1 verbose cli [ 'node',  
3 -1 verbose cli 'c:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npm\\bin\\npm-cli.js',  
4 -1 verbose cli '--userconfig=C:\\Users\\Administrator\\.cnpmrc',  
5 -1 verbose cli '--disturl=https://npm.taobao.org/mirrors/node',  
6 -1 verbose cli '--cache=C:\\Users\\Administrator\\.cnpm',  
7 -1 verbose cli '--registry=https://registry.npm.taobao.org',  
8 -1 verbose cli '--node-gyp=c:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\pangyp\\bin\\node-gyp.js',  
9 -1 verbose cli 'install',  
10 -1 verbose cli '-d' ]  
11 -2 info using npm@2.13.5  
12 -3 info using node@v0.12.0  
13 -4 verbose readDependencies loading dependencies from d:\YOHO\yohobuy\package.json  
14 -5 error install Couldn't read dependencies  
15 -6 verbose stack Error: ENOENT, open 'd:\YOHO\yohobuy\package.json'  
16 -6 verbose stack at Error (native)  
17 -7 verbose cwd d:\YOHO\yohobuy  
18 -8 error Windows_NT 6.1.7601  
19 -9 error argv "node" "c:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npm\\bin\\npm-cli.js" "--userconfig=C:\\Users\\Administrator\\.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--cache=C:\\Users\\Administrator\\.cnpm" "--registry=https://registry.npm.taobao.org" "--node-gyp=c:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\pangyp\\bin\\node-gyp.js" "install" "-d"  
20 -10 error node v0.12.0  
21 -11 error npm v2.13.5  
22 -12 error path d:\YOHO\yohobuy\package.json  
23 -13 error code ENOPACKAGEJSON  
24 -14 error errno -4058  
25 -15 error package.json ENOENT, open 'd:\YOHO\yohobuy\package.json'  
26 -15 error package.json This is most likely not a problem with npm itself.  
27 -15 error package.json npm can't find a package.json file in your current directory.  
28 -16 verbose exit [ -4058, true ]  
  1 +*.iml
  2 +.idea/
  3 +.ipr
  4 +.iws
  5 +*~
  6 +~*
  7 +*.diff
  8 +*.patch
  9 +*.bak
  10 +.DS_Store
  11 +Thumbs.db
  12 +.project
  13 +.*proj
  14 +.svn/
  15 +*.swp
  16 +*.swo
  17 +*.pyc
  18 +*.pyo
  19 +.build
  20 +node_modules
  21 +_site
  22 +sea-modules
  23 +spm_modules
  24 +.cache
  25 +dist
  26 +coverage
  27 +css/
  28 +.sass-cache/
  29 +script/nginx/logs/
1 -define("index", ["zepto","lazyload","swiper","mlellipsis","index"], function(require, exports, module){ 1 +define("index", ["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"], function(require, exports, module){
2 var yohobuy; 2 var yohobuy;
3 3
4 require("js/common"); 4 require("js/common");
@@ -1045,7 +1045,7 @@ $btnOk.on('touchstart', function() { @@ -1045,7 +1045,7 @@ $btnOk.on('touchstart', function() {
1045 } 1045 }
1046 }); 1046 });
1047 }); 1047 });
1048 -define("js/guang/index", ["zepto","lazyload","swiper","mlellipsis","index"], function(require, exports, module){ 1048 +define("js/guang/index", ["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"], function(require, exports, module){
1049 /** 1049 /**
1050 * 逛打包入口 1050 * 逛打包入口
1051 * @author: xuqi<qi.xu@yoho.cn> 1051 * @author: xuqi<qi.xu@yoho.cn>
@@ -1057,6 +1057,7 @@ require("js/guang/plus-star/detail"); @@ -1057,6 +1057,7 @@ require("js/guang/plus-star/detail");
1057 1057
1058 require("js/guang/home"); 1058 require("js/guang/home");
1059 require("js/guang/list"); 1059 require("js/guang/list");
  1060 +require("js/guang/detail");
1060 }); 1061 });
1061 define("js/guang/plus-star/list", ["zepto","lazyload","swiper","index"], function(require, exports, module){ 1062 define("js/guang/plus-star/list", ["zepto","lazyload","swiper","index"], function(require, exports, module){
1062 /** 1063 /**
@@ -1456,6 +1457,226 @@ $(document).scroll(function() { @@ -1456,6 +1457,226 @@ $(document).scroll(function() {
1456 } 1457 }
1457 }); 1458 });
1458 }); 1459 });
  1460 +define("js/guang/detail", ["zepto","mlellipsis","lazyload","iscroll-probe"], function(require, exports, module){
  1461 +/**
  1462 + * 逛详情页
  1463 + * @author: xuqi<qi.xu@yoho.cn>
  1464 + * @date: 2015/10/13
  1465 + */
  1466 +
  1467 +var $ = require("zepto"),
  1468 + ellipsis = require("mlellipsis"),
  1469 + lazyLoad = require("lazyload"),
  1470 + IScroll = require("iscroll-probe");
  1471 +
  1472 +var $authorIntro = $('.author .intro');
  1473 +
  1474 +var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
  1475 +
  1476 +var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false;
  1477 +
  1478 +//collocation block variable
  1479 +var thumbWidth = 0,
  1480 + $fixedThumbContainer = $(''),
  1481 + $coBlock, $thumbContainer, $thumbs, $prods,
  1482 + scrollToEl;
  1483 +
  1484 +var scrollToEl = document.querySelector('#wrapper .collocation-block');
  1485 +
  1486 +var winW = $(window).width();
  1487 +
  1488 +var myScroll;
  1489 +
  1490 +/**
  1491 + * 计算搭配的箭头的位置
  1492 + * @param $curPos 当前focus的搭配项
  1493 + */
  1494 +function posCollocationArrow($curCo) {
  1495 + var left = $curCo.offset().left,
  1496 + bgPos = -winW + left + (thumbWidth / 2) + 'px';
  1497 +
  1498 + $thumbContainer.css({
  1499 + backgroundPosition: bgPos + ' bottom'
  1500 + });
  1501 +
  1502 + if (isIphone) {
  1503 + $fixedThumbContainer.css({
  1504 + backgroundPosition: bgPos + ' bottom'
  1505 + });
  1506 + }
  1507 +}
  1508 +
  1509 +//搭配thumb的touch事件句柄
  1510 +function thumbTouchEvt(e) {
  1511 + var $curCo = $(e.currentTarget),
  1512 + index = $curCo.index(),
  1513 + $brother, $brotherCo,
  1514 + $curProds;
  1515 +
  1516 + if ($curCo.hasClass('focus')) {
  1517 + return;
  1518 + }
  1519 +
  1520 + $thumbs.filter('.focus').removeClass('focus');
  1521 +
  1522 + if (isIphone) {
  1523 + if ($curCo.closest('.fixed-thumb-container').length > 0) {
  1524 + $brother = $thumbContainer;
  1525 + } else {
  1526 + $brother = $fixedThumbContainer;
  1527 + }
  1528 +
  1529 + $brotherCo = $brother.find('.thumb').eq(index);
  1530 + $fixedThumbContainer.find('.thumb.focus').removeClass('focus');
  1531 + $brotherCo.addClass('focus');
  1532 + }
  1533 +
  1534 + $curCo.addClass('focus');
  1535 +
  1536 + //定位arrow
  1537 + posCollocationArrow($curCo);
  1538 +
  1539 + $prods.not('.hide').addClass('hide');
  1540 + $curProds = $prods.eq(index);
  1541 + $curProds.removeClass('hide');
  1542 +
  1543 + //
  1544 + lazyLoad($curProds.find('.lazy'));
  1545 +
  1546 + if (isIphone) {
  1547 + if (myScroll) {
  1548 + myScroll.scrollToElement(scrollToEl, 400);
  1549 + }
  1550 + } else {
  1551 + $('body').animate({
  1552 + scrollTop: $coBlock.offset().top
  1553 + }, 400);
  1554 + }
  1555 +}
  1556 +
  1557 +if (isIphone) {
  1558 + $('#wrapper').addClass('ios');
  1559 +}
  1560 +
  1561 +ellipsis.init();
  1562 +
  1563 +lazyLoad($('.lazy'));
  1564 +
  1565 +//title mlellipsis
  1566 +$('.info-list .title, .one-good .reco-name').each(function() {
  1567 + this.mlellipsis(2);
  1568 +});
  1569 +
  1570 +//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
  1571 +if (parseInt($authorIntro.offset().left, 10) === parseInt($authorIntro.css('margin-left'), 10)) {
  1572 + $authorIntro.css('padding-top', 0);
  1573 +}
  1574 +
  1575 +//有搭配模块,iphone使用iscroll初始化滚动并有固定的搭配栏,其他的没有
  1576 +if (hasCollocationBlock) {
  1577 + $coBlock = $('.collocation-block');
  1578 + $thumbContainer = $coBlock.children('.thumb-container');
  1579 + $thumbs = $thumbContainer.find('li');
  1580 + $prods = $coBlock.find('.prod');
  1581 +
  1582 + thumbWidth = $thumbs.width();
  1583 +
  1584 + if (isIphone) {
  1585 + $fixedThumbContainer = $('#wrapper')
  1586 + .after($thumbContainer.clone().addClass('fixed-thumb-container fixed-bottom'))
  1587 + .next('.thumb-container');
  1588 +
  1589 + //load img of fixed thumb container
  1590 + lazyLoad($fixedThumbContainer.find('.lazy'), {
  1591 + event: 'sporty'
  1592 + });
  1593 + }
  1594 +
  1595 + //Init Arrow Position
  1596 + posCollocationArrow($thumbs.filter('.focus'));
  1597 +
  1598 + $thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
  1599 +
  1600 + if (isIphone) {
  1601 + $fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
  1602 + }
  1603 +}
  1604 +
  1605 +// 初始化iscroll
  1606 +window.onload = function() {
  1607 + var $scroller = $('#scroller');
  1608 +
  1609 + var winH, tcH, cbH, cbTop, fixedThumbDom;
  1610 +
  1611 + if (!isIphone) {
  1612 + return;
  1613 + }
  1614 +
  1615 + myScroll = new IScroll('#wrapper', {
  1616 + probeType: 3,
  1617 + mouseWheel: true,
  1618 + click: true
  1619 + });
  1620 +
  1621 + document.addEventListener('touchmove', function (e) {
  1622 + e.preventDefault();
  1623 + }, false);
  1624 +
  1625 + if (!hasCollocationBlock) {
  1626 + myScroll.on('scroll', function() {
  1627 + $scroller.trigger('scroll');
  1628 + });
  1629 + return;
  1630 + }
  1631 +
  1632 + winH = $(window).height();
  1633 + fixedThumbDom = $fixedThumbContainer[0];
  1634 +
  1635 + tcH = $thumbContainer.height();
  1636 + cbH = $coBlock.height();
  1637 + cbTop = $coBlock.offset().top;
  1638 +
  1639 + myScroll.on('scroll', function() {
  1640 + var sTop = -this.y;
  1641 + var classList = fixedThumbDom.className;
  1642 +
  1643 + if (sTop <= cbTop - winH + tcH) {
  1644 + if (classList.indexOf('fixed-bottom') === -1) {
  1645 + $fixedThumbContainer
  1646 + .addClass('fixed-bottom')
  1647 + .removeClass('hide');
  1648 + }
  1649 + } else if (sTop <= cbTop) {
  1650 + if (classList.indexOf('hide') === -1) {
  1651 + $fixedThumbContainer
  1652 + .addClass('hide')
  1653 + .removeClass('fixed-bottom fixed-top');
  1654 + }
  1655 + } else if (sTop <= cbTop + cbH - tcH) {
  1656 + if (classList.indexOf('fixed-top') === -1) {
  1657 + $fixedThumbContainer
  1658 + .addClass('fixed-top')
  1659 + .removeClass('hide absolute')
  1660 + .css('top', '');
  1661 + }
  1662 + } else if (sTop <= cbTop + cbH) {
  1663 + if (classList.indexOf('absolute') === -1) {
  1664 + $fixedThumbContainer
  1665 + .addClass('absolute')
  1666 + .removeClass('fixed-top hide');
  1667 + }
  1668 + fixedThumbDom.style.top = cbTop + cbH - tcH - sTop + 'px';
  1669 + } else if (sTop > cbTop + cbH) {
  1670 + if (classList.indexOf('hide') === -1) {
  1671 + $fixedThumbContainer
  1672 + .addClass('hide')
  1673 + .removeClass('absolute');
  1674 + }
  1675 + }
  1676 + $scroller.trigger('scroll');
  1677 + });
  1678 +};
  1679 +});
1459 define("js/home/index", ["zepto","swiper","lazyload","index"], function(require, exports, module){ 1680 define("js/home/index", ["zepto","swiper","lazyload","index"], function(require, exports, module){
1460 /** 1681 /**
1461 * 首页打包入口 1682 * 首页打包入口
@@ -2073,6 +2294,10 @@ function search(opt) { @@ -2073,6 +2294,10 @@ function search(opt) {
2073 } 2294 }
2074 } 2295 }
2075 2296
  2297 + //处理active状态
  2298 + $listNav.children('.active').removeClass('active');
  2299 + $pre.addClass('active');
  2300 +
2076 switch (opt.type) { 2301 switch (opt.type) {
2077 case 'gender': 2302 case 'gender':
2078 ext = { 2303 ext = {
This diff could not be displayed because it is too large.
1 -define("index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,s){var t;e("js/common"),e("js/passport/index"),e("js/guang/index"),e("js/home/index"),e("js/product/index"),e("js/index/index"),s.exports=t}),define("js/common",["zepto"],function(e,a,s){function t(e){var a,s,t=document.cookie;return document.cookie&&""!==document.cookie&&(s=t.indexOf(e+"="),s>-1&&(s+=e.length+1,a=decodeURIComponent(r.trim(t.substring(s,t.indexOf(";",s)))))),a}function n(){var e,a=t("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function i(){var e=n();return 0===e?0:e[1]}function o(){var e=t("_g");return"undefined"==typeof e?"":JSON.parse(e).k}var r=e("zepto");!function(){var e=r("#yoho-footer"),a=e.children(".op-row"),s=n();r("body").height()<r(window).height()&&e.addClass("bottom"),0===s?a.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):a.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+s[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+s[3]+'">退出</a>'),e.removeClass("hide")}(),window.cookie=t,window.getUser=n,window.getUid=i,window.getShoppingKey=o}),define("js/passport/index",["zepto"],function(e,a,s){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#phone-num"),i=t("#country-select"),o=t("#area-code"),r=t("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=t.trim,p=d.show;l.selectCssHack(t("#country-select")),l.bindClearEvt(),n.bind("input",function(){""===c(n.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){o.text(i.val())}),r.on("touchstart",function(){var e=c(n.val()),a=i.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?t.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["zepto"],function(e,a,s){function t(){var e,a=r(".has-eye");a.append('<div class="eye close"></div>'),e=a.children(".eye"),e.on("touchstart",function(e){var a=r(this),s=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?s.attr("type","password"):s.attr("type","text"),s.focus()})}function n(){var e,a=r(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var s=e.siblings(".input");s.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=r(this),a=e.siblings(".clear-input"),s=l(e.val());""===s?a.hide():a.show()})}function i(e){return e.length>=6&&e.length<=20?!0:!1}function o(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var s=navigator.userAgent;s.match(/uc/i)&&s.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var r=e("zepto"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};s.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:t,bindClearEvt:n,pwdValidate:i,selectCssHack:o}}),define("js/plugin/tip",["zepto"],function(e,a,s){function t(e,a){var s,t;"undefined"!=typeof e&&(s=e.toString(),t=a&&a>0?a:2e3,n.text(s).show(),i=setTimeout(function(){"block"===n.css("display")&&n.hide()},t))}var n,i,o=e("zepto");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),n=o("#yoho-tip"),n.on("touchstart",function(){n.hide(),clearTimeout(i)})}(),a.show=t}),define("js/passport/register/code",["zepto"],function(e,a,s){e("js/passport/code")(!0)}),define("js/passport/code",["zepto"],function(e,a,s){var t=e("zepto");s.exports=function(a){function s(){var e,a=59;e=setInterval(function(){0===a?(o.text("重发验证码").removeClass("disable"),clearInterval(e)):o.text("重发验证码 ("+a--+"秒)")},1e3)}var n=t("#captcha"),i=t("#btn-next"),o=t("#captcha-tip"),r=t("#phone-num").val(),l=t("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),p=t.trim,u=c.show,h=a?"reg":"back";d.bindClearEvt(),n.bind("input",function(){""!==p(n.val())?i.removeClass("disable"):i.addClass("disable")}),o.on("touchstart",function(){o.hasClass("disable")||t.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(o.text("重发验证码 (60秒)").addClass("disable"),s()):u(e.message)}})}),i.on("touchstart",function(){i.hasClass("disable")||t.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:r,areaCode:l,code:p(n.val()),token:t("#token").val()},success:function(e){200===e.code?location.href=e.data:u(e.message)}})}),s()}}),define("js/passport/register/password",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#pwd"),i=t("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=t.trim,d=r.show;o.bindEyesEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(n.val());i.hasClass("disable")||(o.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):t.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:t("#phone-num").val(),areaCode:t("#area-code").val(),token:t("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["zepto"],function(e,a,s){function t(){u&&h?d.removeClass("disable"):d.addClass("disable")}function n(){c.show(),p.show()}function i(){c.hide(),p.hide()}var o=e("zepto"),r=o("#account"),l=o("#pwd"),d=o("#btn-login"),c=o("#retrive-pwd-mask"),p=o("#retrive-pwd-ways"),u=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),v=o.trim,m=g.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){u=""!==v(r.val())?!0:!1,t()}),l.bind("input",function(){h=""===v(l.val())?!1:!0,t()}),d.on("touchstart",function(){var e=v(r.val()),a=v(l.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?o.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(m("登录成功"),setTimeout(function(){location.href=e.data},1e3)):m(e.message)},error:function(){m("网络断开连接啦~")}}):m("账号或密码有错误,请重新输入"))}),o("#forget-pwd").on("touchstart",function(){n()}),c.on("touchstart",function(){i()}),o("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),i()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["zepto"],function(e,a,s){function t(){c&&p?d.removeClass("disable"):d.addClass("disable")}var n=e("zepto"),i=n("#phone-num"),o=n("#country-select"),r=n("#area-code"),l=n("#pwd"),d=n("#btn-login"),c=!1,p=!1,u=e("js/passport/api"),h=e("js/plugin/tip"),f=n.trim,g=h.show;u.selectCssHack(o),u.bindEyesEvt(),u.bindClearEvt(),i.bind("input",function(){c=""===f(i.val())?!1:!0,t()}),l.bind("input",function(){var e=f(l.val());p=""===e?!1:!0,t()}),o.change(function(){r.text(o.val())}),d.on("touchstart",function(){var e=f(i.val()),a=o.val(),s=f(l.val());d.hasClass("disable")||(u.phoneRegx[a].test(e)&&u.pwdValidate(s)?n.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:s},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),i.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#phone-num"),i=t("#country-select"),o=t("#area-code"),r=t("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=t.trim,p=d.show;l.selectCssHack(t("#country-select")),l.bindClearEvt(),n.bind("input",function(){""===c(n.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){o.text(i.val())}),r.on("touchstart",function(){var e=c(n.val()),a=i.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?t.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["zepto"],function(e,a,s){e("js/passport/code")(!1)}),define("js/passport/back/email",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#email"),i=t("#btn-sure"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=t.trim,d=r.show;o.bindClearEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(n.val());i.hasClass("disable")||(o.emailRegx.test(e)?t.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#resend"),i=e("js/plugin/tip"),o=i.show;n.on("touchstart",function(e){e.preventDefault(),t.ajax({url:n.data("url"),type:"GET",success:function(e){o(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#pwd"),i=t("#btn-ok"),o=e("js/passport/api"),r=e("js/plugin/tip"),l=t.trim,d=r.show,c=t("#phone-num");o.bindEyesEvt(),n.bind("input",function(){""===l(n.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e,a,s=l(n.val()),r=!0;i.hasClass("disable")||(e={password:s},0===c.length&&(r=!1),r?(t.extend(e,{phoneNum:c.val(),areaCode:t("#areaCode").val(),token:t("#token").val()}),a="/passport/back/passwordByMobile"):(t.extend(e,{code:t("#email-code").val()}),a="/passport/back/passwordByEmail"),o.pwdValidate(s)?t.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/guang/index",["zepto","lazyload","swiper","mlellipsis","index"],function(e,a,s){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list")}),define("js/guang/plus-star/list",["zepto","lazyload","swiper","index"],function(e,a,s){var t,n=e("zepto"),i=e("lazyload"),o=e("swiper"),r=n("#nav-tab > li"),l=n("#ps-content > .content");i(n("img.lazy")),t=new o(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),n("#nav-tab").delegate("li","touchstart",function(){n(this).hasClass("focus")||(r.toggleClass("focus"),l.toggleClass("hide"),n(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["zepto","mlellipsis","lazyload"],function(e,a,s){var t,n,i=e("zepto"),o=e("mlellipsis"),r=e("lazyload"),l=i("#intro"),d=i("#intro-more-txt"),c=i("#related-infos-container"),p=e("js/guang/info"),u=e("js/plugin/tip"),h=i("#brand-info").data("id");o.init(),r(i("img.lazy")),l[0].mlellipsis(3),setTimeout(function(){t=l.text(),n=l.attr("title")}),p.initInfosEvt(c),i("#more-intro").bind("touchstart",function(){var e=i(this);e.toggleClass("spread"),e.hasClass("spread")?(l.text(n),d.text("收起")):(l.text(t),d.text("more"))}),i("#brand-like").bind("touchstart",function(e){var a="ok",s=i(this);e.preventDefault(),s.hasClass("like")&&(a="cancel"),i.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:h,opt:a},success:function(e){200===e.code?s.toggleClass("like"):400===e.code&&u.show("未登录")},error:function(){u.show("网络断开连接了~")}})})}),define("js/guang/info",["zepto","mlellipsis","lazyload"],function(e,a,s){function t(e){l(e.find("img.lazy")),e.each(function(){var e=o(this),a=e.find(".info-title"),s=e.find(".info-text");a[0].mlellipsis(2),s[0].mlellipsis(2)})}function n(e){e.delegate(".like-btn","touchstart",function(e){var a=o(e.currentTarget),s=a.closest(".guang-info"),t="ok";a.hasClass("like")&&(t="cancel"),o.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:s.data("id"),opt:t},success:function(e){var s=e.code;200===s&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){d.show("网络断开连接了~")}})}),t(e.find(".guang-info"))}function i(e,a){h||a.end||(h=!0,o.ajax({type:"GET",url:" /guang/list/page",data:a,success:function(s){return" "===s?(a.end=!0,h=!1,p.addClass("hide"),void u.removeClass("hide")):(e.append(s),t(e.find(".guang-info")),a.page++,void(h=!1))},error:function(){d.show("网络断开连接了~"),h=!1}}))}var o=e("zepto"),r=e("mlellipsis"),l=e("lazyload"),d=e("js/plugin/tip"),c=o("#load-more-info"),p=o(""),u=o(""),h=!1;r.init(),c.length>0&&(p=c.children(".loading"),u=c.children(".no-more")),a.initInfosEvt=n,a.setLazyLoadAndMellipsis=t,a.loadMore=i}),define("js/guang/home",["zepto","swiper","mlellipsis","lazyload","index"],function(e,a,s){var t,n=e("zepto"),i=e("swiper"),o=e("js/guang/info"),r=o.setLazyLoadAndMellipsis,l=o.loadMore,d=n("#load-more-info"),c=n(""),p=n(""),u=n(window).height(),h=d.height(),f=n("#info-list"),g=f.children(".info-list"),v=n("#guang-nav"),m=v.children(".focus"),w=m.data("type"),b={};d.length>0&&(c=d.children(".loading"),p=d.children(".no-more")),t=new i(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),o.initInfosEvt(f),function(){var e=n("#gender").val();v.children(".guang-nav-item").each(function(){var a=n(this).data("type");b[a]={page:1,gender:e,type:a,end:!1}})}(),v.delegate(".guang-nav-item","touchstart",function(){var e,a,s=n(this);s.hasClass("focus")||(a=s.index(),s.addClass("focus"),m.removeClass("focus"),g.not(".hide").addClass("hide"),e=g.eq(a),e.removeClass("hide"),r(e.children(".guang-info")),m=s,w=s.data("type"),b[w].end?(c.addClass("hide"),p.removeClass("hide")):(c.removeClass("hide"),p.addClass("hide")))}),n(document).scroll(function(){n(window).scrollTop()+u>=n(document).height()-h&&l(g,b[w])})}),define("js/guang/list",["zepto","mlellipsis","lazyload"],function(e,a,s){var t=e("zepto"),n=e("js/guang/info"),i=n.loadMore,o=t(window).height(),r=t("#load-more").height(),l=t("#author-infos"),d=t("#tag"),c={page:1,end:!1},p=t("#info-list");n.initInfosEvt(p),l.length>0&&t.extend(c,{authorId:l.data("id")}),d.length>0&&t.extend(c,{tag:d.val()}),t(document).scroll(function(){t(window).scrollTop()+o>=t(document).height()-r&&i(p,c)})}),define("js/home/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["zepto","swiper","lazyload","index"],function(e,a,s){function t(){m+=10,w.css({transform:"rotateX("+m+"deg)","-webkit-transform":"rotateX("+m+"deg)","-moz-transform":"rotateX("+m+"deg)"}),m/90%2===1&&(b?(w.addClass("animate"),b=!1):(w.removeClass("animate"),b=!0)),m/90%2===0&&m%360!==0?window.setTimeout(t,3e3):m%360===0?window.setTimeout(t,18e4):d(function(){t()})}var n,i,o,r,l,d,c,p,u,h,f=e("zepto"),g=e("swiper"),v=e("lazyload"),m=0,w=f(".home-header .logo"),b=!0;e("js/home/maybe-like"),v(f("img.lazy")),f(".nav-btn").on("click",function(e){f(this).hasClass("menu-open")||(f(".mobile-wrap").addClass("menu-open"),f(".overlay").addClass("show"),f(".side-nav").addClass("on"),f("body").css({height:f(window).height(),width:"100%",overflow:"hidden"})),e.stopPropagation()}),f(".mobile-wrap").on("click",function(){f(this).hasClass("menu-open")&&(f(".mobile-wrap").removeClass("menu-open"),f(".overlay").removeClass("show"),f(".sub-nav").removeClass("show"),f(".side-nav").removeClass("on"),f("body").css({height:"auto",overflow:"auto"}))}),f(".side-nav").on("click","li",function(){f(this).find(".sub-nav").size()>0&&(f(".sub-nav").removeClass("show"),f(this).find(".sub-nav").addClass("show"))}),f(".sub-nav").each(function(){f(this).find("li").eq(0).on("click",function(e){f(".sub-nav").removeClass("show"),e.stopPropagation()})}),f(".sub-nav").on("mouseenter","li",function(){0!==f(this).index()&&f(this).addClass("current").siblings().removeClass("current")}),f(".banner-swiper").find("li").size()>1&&(n=new g(".banner-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),o=new g(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),i=new g(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),f(".trend-topic-swiper").find("li").size()>1&&(r=new g(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),f(".category-swiper").each(function(e,a){u="category-swiper"+e,f(this).addClass(u),f("."+u).find(".swiper-slide").size()>1&&(l=new g("."+u,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+u+" .pagination-inner"}))}),f(".header-download").on("click",".close-btn",function(){f(this).parent().remove()}),d=function(){var e=null,a=["webkit","moz","ms"];for(p=0;p<a.length;p++)c=a[p]+"RequestAnimationFrame",window[c]&&(h=!0,e=c);return h?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),t()}),define("js/home/maybe-like",["zepto","lazyload"],function(e,a,s){var t,n,i,o,r=e("zepto"),l=e("js/plugin/tip"),d=e("lazyload"),c=r(window).height(),p=r("#load-more").height(),u=r("#goods-list"),h=!1,f=0,g=r(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",v=r(".mobile-wrap").hasClass("kids-wrap")?!0:!1,m=r(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=r("#maybe-like-nav");n=v?"/product/recom/maylikekids":m?"/product/recom/maylikelife":"/product/recom/maylike?gender="+g,i=w.children(".focus"),r("#maybe-like-nav").delegate("li","touchstart",function(){var e,a=r(this),s=r(".goods-list");a.hasClass("focus")||(o=a.index(),a.addClass("focus"),i.removeClass("focus"),s.not(".hide").addClass("hide"),e=s.eq(o),e.removeClass("hide"),i=a,r(document).trigger("scroll"))}),r(window).scroll(function(){if(r(window).scrollTop()+c>=r(document).height()-p){if(h)return;h=!0,t=u.children(".good-info").length,r.ajax({type:"GET",url:n,data:{page:f+1},success:function(e){return" "===e?void(h=!0):(u.append(e),d(r(".good-info").find("img.lazy")),h=!1,void f++)},error:function(){l.show("网络断开连接了~"),h=!1}})}})}),define("js/product/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["zepto","swiper","lazyload","index"],function(e,a,s){var t,n,i=e("zepto"),o=e("js/plugin/tip"),r=e("swiper"),l=e("lazyload"),d=i("#newarrival-nav"),c=i("#newarrival-goods-list"),p=c.children(".goods-list"),u=i(window).height(),h=i("#load-more").height(),f=i(".goods-list"),g=!1,v=0,m=0;n=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l(i("img.lazy")),t=d.children(".focus"),i("#newarrival-nav").delegate("li","touchstart",function(){var e,a=i(this);a.hasClass("focus")||(m=a.index(),a.addClass("focus"),t.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(m),e.removeClass("hide"),t=a,i(document).trigger("scroll"))}),i(window).scroll(function(){if(i(window).scrollTop()+u>=i(document).height()-h){if(g)return;g=!0,i.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{dayLimit:m+1,page:v+1},success:function(e){return" "===e?void(g=!0):(f.append(e),l(i(".good-info").find("img.lazy")),g=!1,void v++)},error:function(){o.show("网络断开连接了~"),g=!1}})}})}),define("js/product/newsale/discount",["zepto","swiper","lazyload","index"],function(e,a,s){function t(e){var a="0.1,0.3";switch(e){case 0:a="0.1,0.3";break;case 1:a="0.4,0.6";break;case 2:a="0.7,0.9";break;case 3:a="0.1,0.9"}return a}var n,i,o=e("zepto"),r=e("swiper"),l=e("lazyload"),d=o("#discount-nav"),c=o("#discount-goods-list"),p=c.children(".goods-list"),u=o(".goods-list"),h=0,f=o(window).height(),g=o("#load-more").height(),v=!1,m=0,w="";i=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),l(o("img.lazy")),n=d.children(".focus"),o("#discount-nav").delegate("li","touchstart",function(){var e,a=o(this);a.hasClass("focus")||(h=a.index(),w=t(h),a.addClass("focus"),n.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(h),e.removeClass("hide"),n=a,o(document).trigger("scroll"))}),o(window).scroll(function(){if(o(window).scrollTop()+f>=o(document).height()-g){if(v)return;v=!0,o.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{p_d:w,page:m+1},success:function(e){return" "===e?void(v=!1):(u.append(e),l(o(".good-info").find("img.lazy")),v=!1,void m++)},error:function(){tip.show("网络断开连接了~"),v=!1}})}})}),define("js/product/list",["zepto","lazyload"],function(e,a,s){function t(e){var a,s,t,l,d,c={};if(e){for(s in w)w.hasOwnProperty(s)&&(w[s].reload=!0);switch(e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}o.extend(v,a)}if(!i){if(n.hasClass("new")?l="newest":n.hasClass("price")?l="price":n.hasClass("discount")&&(l="discount"),t=w[l],d=t.page+1,t.reload)d=1;else if(t.end)return;o.extend(c,v,{type:l,order:t.order,page:d}),i=!0,o.ajax({type:"GET",url:"/product/list/search",data:c,success:function(e){var a,s='<p class="no-result">未找到相关搜索结果</p>';switch(l){case"newest":a=u;break;case"price":a=h;break;case"discount":a=f}" "===e?(t.end=!0,t.reload&&a.html(s)):(t.reload?a.html(e):a.append(e),r(a.find(".lazy"))),t.reload=!0,t.page=d,i=!1}})}}var n,i,o=e("zepto"),r=e("lazyload"),l=o("#brand-header"),d=o("#intro-box"),c=e("js/plugin/filter"),p=o("#goods-container"),u=p.children(".new-goods"),h=p.children(".price-goods"),f=p.children(".discount-goods"),g=o(window).height(),v={gender:o("#gender").val(),brand:o("#brand").val(),msort:o("#msort").val(),color:o("#color").val(),size:o("#size").val(),price:o("#price").val(),discount:o("#discount").val()},m=o("#list-nav"),w={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}};r(o(".lazy")),c.registerCbFn(t),m.delegate("li","touchstart",function(){var e,a,s,i=o(this);if(i.hasClass("filter"))i.hasClass("active")?(c.hideFilter(),n.addClass("active"),i.removeClass("active")):(n=i.siblings(".active"),n.removeClass("active"),i.addClass("active"),c.showFilter());else{if(i.hasClass("new")?a="newest":i.hasClass("price")?a="price":i.hasClass("discount")&&(a="discount"),e=w[a],i.hasClass("active")){if(i.hasClass("new"))return;(i.hasClass("price")||i.hasClass("discount"))&&(i.find(".icon > .iconfont").toggleClass("cur"),n=i,e.reload=!0,e.order=0===e.order?1:0)}else{if(s=i.siblings(".active"),n=i,s.hasClass("filter"))c.hideFilter();else switch(p.children(".container:not(.hide)").addClass("hide"),a){case"newest":u.removeClass("hide");break;case"price":h.removeClass("hide");break;case"discount":f.removeClass("hide")}s.removeClass("active"),i.addClass("active")}e.reload&&t()}}),o(window).scroll(function(){o(window).scrollTop()+g>o(document).height()-.25*p.height()&&t()}),l.children(".btn-intro").bind("touchstart",function(){d.removeClass("hide")}),o(".close-intro, .brand-intro-box").click(function(){d.addClass("hide")}),o("#brand-intro").click(function(e){e.stopPropagation()}),l.children(".btn-col").bind("touchstart",function(){o(this).toggleClass("coled")})}),define("js/plugin/filter",["zepto"],function(e,a,s){function t(){l.addClass("hide")}function n(){l.removeClass("hide")}function i(e){o=e}var o,r=e("zepto"),l=r(".filter-mask, .filter-body"),d=l.find(".classify"),c=l.find(".sub-classify");d.children(":first-child").addClass("active"),d.delegate(".classify-item","touchstart",function(){var e=r(this);e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}),l.filter(".filter-mask").click(function(){t()}),c.delegate("li","click",function(e){var a,s,n=r(this),i=n.data("id"),l=n.closest(".sub-classify"),d=l.siblings(".shower");e.stopPropagation(),n.hasClass("chosed")||(l.children(".chosed").removeClass("chosed"),n.addClass("chosed"),a=r.trim(n.html()),s=r.trim(d.html()),d.html(s.substring(0,s.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===n.index()?d.addClass("default"):d.removeClass("default"),o&&o({type:l.data("type"),id:i}),t())}),a.showFilter=n,a.hideFilter=t,a.registerCbFn=i}),define("js/product/detail/detail",["zepto","swiper","lazyload","index"],function(e,a,s){var t,n=e("zepto"),i=e("swiper"),o=e("lazyload");o(n("img.lazy")),t=new i(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"div",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}),define("js/index/index",["zepto"],function(e,a,s){e("js/index/search"),e("js/index/channel")}),define("js/index/search",["zepto"],function(e,a,s){var t=e("zepto"),n=t("#search-input > input"),i=t("#search-input > .clear-input"),o=t(".history");t("#clear-history").bind("touchstart",function(){t.ajax({type:"POST",url:"/search/clearHistory",success:function(e){200===e.code&&o.html("")}})}),t("#search").bind("touchstart",function(){var e=n.val();t.ajax({type:"POST",url:"/search",data:{val:e},success:function(e){200===e.code&&(location.href=e.data)}})}),n.bind("input",function(){""===n.val()?i.addClass("hide"):i.removeClass("hide")}),i.bind("touchstart",function(){n.val("").trigger("input")})}),define("js/index/channel",[],function(e,a,s){});  
  1 +define("index",["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,s){var t;e("js/common"),e("js/passport/index"),e("js/guang/index"),e("js/home/index"),e("js/product/index"),e("js/index/index"),s.exports=t}),define("js/common",["zepto"],function(e,a,s){function t(e){var a,s,t=document.cookie;return document.cookie&&""!==document.cookie&&(s=t.indexOf(e+"="),s>-1&&(s+=e.length+1,a=decodeURIComponent(l.trim(t.substring(s,t.indexOf(";",s)))))),a}function i(){var e,a=t("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function o(){var e=i();return 0===e?0:e[1]}function n(){var e=t("_g");return"undefined"==typeof e?"":JSON.parse(e).k}var l=e("zepto");!function(){var e=l("#yoho-footer"),a=e.children(".op-row"),s=i();l("body").height()<l(window).height()&&e.addClass("bottom"),0===s?a.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):a.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+s[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+s[3]+'">退出</a>'),e.removeClass("hide")}(),window.cookie=t,window.getUser=i,window.getUid=o,window.getShoppingKey=n}),define("js/passport/index",["zepto"],function(e,a,s){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#phone-num"),o=t("#country-select"),n=t("#area-code"),l=t("#btn-next"),r=e("js/passport/api"),d=e("js/plugin/tip"),c=t.trim,p=d.show;r.selectCssHack(t("#country-select")),r.bindClearEvt(),i.bind("input",function(){""===c(i.val())?l.addClass("disable"):l.removeClass("disable")}),o.change(function(){n.text(o.val())}),l.on("touchstart",function(){var e=c(i.val()),a=o.val();l.hasClass("disable")||(r.phoneRegx[a].test(e)?t.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["zepto"],function(e,a,s){function t(){var e,a=l(".has-eye");a.append('<div class="eye close"></div>'),e=a.children(".eye"),e.on("touchstart",function(e){var a=l(this),s=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?s.attr("type","password"):s.attr("type","text"),s.focus()})}function i(){var e,a=l(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var s=e.siblings(".input");s.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=l(this),a=e.siblings(".clear-input"),s=r(e.val());""===s?a.hide():a.show()})}function o(e){return e.length>=6&&e.length<=20?!0:!1}function n(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var s=navigator.userAgent;s.match(/uc/i)&&s.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var l=e("zepto"),r=l.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};s.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:t,bindClearEvt:i,pwdValidate:o,selectCssHack:n}}),define("js/plugin/tip",["zepto"],function(e,a,s){function t(e,a){var s,t;"undefined"!=typeof e&&(s=e.toString(),t=a&&a>0?a:2e3,i.text(s).show(),o=setTimeout(function(){"block"===i.css("display")&&i.hide()},t))}var i,o,n=e("zepto");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';n(".yoho-page").append(e),i=n("#yoho-tip"),i.on("touchstart",function(){i.hide(),clearTimeout(o)})}(),a.show=t}),define("js/passport/register/code",["zepto"],function(e,a,s){e("js/passport/code")(!0)}),define("js/passport/code",["zepto"],function(e,a,s){var t=e("zepto");s.exports=function(a){function s(){var e,a=59;e=setInterval(function(){0===a?(n.text("重发验证码").removeClass("disable"),clearInterval(e)):n.text("重发验证码 ("+a--+"秒)")},1e3)}var i=t("#captcha"),o=t("#btn-next"),n=t("#captcha-tip"),l=t("#phone-num").val(),r=t("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),p=t.trim,u=c.show,h=a?"reg":"back";d.bindClearEvt(),i.bind("input",function(){""!==p(i.val())?o.removeClass("disable"):o.addClass("disable")}),n.on("touchstart",function(){n.hasClass("disable")||t.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:l,areaCode:r},success:function(e){200===e.code?(n.text("重发验证码 (60秒)").addClass("disable"),s()):u(e.message)}})}),o.on("touchstart",function(){o.hasClass("disable")||t.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:l,areaCode:r,code:p(i.val()),token:t("#token").val()},success:function(e){200===e.code?location.href=e.data:u(e.message)}})}),s()}}),define("js/passport/register/password",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#pwd"),o=t("#btn-sure"),n=e("js/passport/api"),l=e("js/plugin/tip"),r=t.trim,d=l.show;n.bindEyesEvt(),i.bind("input",function(){""===r(i.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e=r(i.val());o.hasClass("disable")||(n.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):t.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:t("#phone-num").val(),areaCode:t("#area-code").val(),token:t("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["zepto"],function(e,a,s){function t(){u&&h?d.removeClass("disable"):d.addClass("disable")}function i(){c.show(),p.show()}function o(){c.hide(),p.hide()}var n=e("zepto"),l=n("#account"),r=n("#pwd"),d=n("#btn-login"),c=n("#retrive-pwd-mask"),p=n("#retrive-pwd-ways"),u=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),m=n.trim,v=g.show;f.bindEyesEvt(),f.bindClearEvt(),l.bind("input",function(){u=""!==m(l.val())?!0:!1,t()}),r.bind("input",function(){h=""===m(r.val())?!1:!0,t()}),d.on("touchstart",function(){var e=m(l.val()),a=m(r.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?n.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(v("登录成功"),setTimeout(function(){location.href=e.data},1e3)):v(e.message)},error:function(){v("网络断开连接啦~")}}):v("账号或密码有错误,请重新输入"))}),n("#forget-pwd").on("touchstart",function(){i()}),c.on("touchstart",function(){o()}),n("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),o()}),l.trigger("input"),r.trigger("input")}),define("js/passport/login/international",["zepto"],function(e,a,s){function t(){c&&p?d.removeClass("disable"):d.addClass("disable")}var i=e("zepto"),o=i("#phone-num"),n=i("#country-select"),l=i("#area-code"),r=i("#pwd"),d=i("#btn-login"),c=!1,p=!1,u=e("js/passport/api"),h=e("js/plugin/tip"),f=i.trim,g=h.show;u.selectCssHack(n),u.bindEyesEvt(),u.bindClearEvt(),o.bind("input",function(){c=""===f(o.val())?!1:!0,t()}),r.bind("input",function(){var e=f(r.val());p=""===e?!1:!0,t()}),n.change(function(){l.text(n.val())}),d.on("touchstart",function(){var e=f(o.val()),a=n.val(),s=f(r.val());d.hasClass("disable")||(u.phoneRegx[a].test(e)&&u.pwdValidate(s)?i.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:s},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),o.trigger("input"),r.trigger("input")}),define("js/passport/back/mobile",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#phone-num"),o=t("#country-select"),n=t("#area-code"),l=t("#btn-next"),r=e("js/passport/api"),d=e("js/plugin/tip"),c=t.trim,p=d.show;r.selectCssHack(t("#country-select")),r.bindClearEvt(),i.bind("input",function(){""===c(i.val())?l.addClass("disable"):l.removeClass("disable")}),o.change(function(){n.text(o.val())}),l.on("touchstart",function(){var e=c(i.val()),a=o.val();l.hasClass("disable")||(r.phoneRegx[a].test(e)?t.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["zepto"],function(e,a,s){e("js/passport/code")(!1)}),define("js/passport/back/email",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#email"),o=t("#btn-sure"),n=e("js/passport/api"),l=e("js/plugin/tip"),r=t.trim,d=l.show;n.bindClearEvt(),i.bind("input",function(){""===r(i.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e=r(i.val());o.hasClass("disable")||(n.emailRegx.test(e)?t.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#resend"),o=e("js/plugin/tip"),n=o.show;i.on("touchstart",function(e){e.preventDefault(),t.ajax({url:i.data("url"),type:"GET",success:function(e){n(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#pwd"),o=t("#btn-ok"),n=e("js/passport/api"),l=e("js/plugin/tip"),r=t.trim,d=l.show,c=t("#phone-num");n.bindEyesEvt(),i.bind("input",function(){""===r(i.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e,a,s=r(i.val()),l=!0;o.hasClass("disable")||(e={password:s},0===c.length&&(l=!1),l?(t.extend(e,{phoneNum:c.val(),areaCode:t("#areaCode").val(),token:t("#token").val()}),a="/passport/back/passwordByMobile"):(t.extend(e,{code:t("#email-code").val()}),a="/passport/back/passwordByEmail"),n.pwdValidate(s)?t.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/guang/index",["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,s){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list"),e("js/guang/detail")}),define("js/guang/plus-star/list",["zepto","lazyload","swiper","index"],function(e,a,s){var t,i=e("zepto"),o=e("lazyload"),n=e("swiper"),l=i("#nav-tab > li"),r=i("#ps-content > .content");o(i("img.lazy")),t=new n(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),i("#nav-tab").delegate("li","touchstart",function(){i(this).hasClass("focus")||(l.toggleClass("focus"),r.toggleClass("hide"),i(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["zepto","mlellipsis","lazyload"],function(e,a,s){var t,i,o=e("zepto"),n=e("mlellipsis"),l=e("lazyload"),r=o("#intro"),d=o("#intro-more-txt"),c=o("#related-infos-container"),p=e("js/guang/info"),u=e("js/plugin/tip"),h=o("#brand-info").data("id");n.init(),l(o("img.lazy")),r[0].mlellipsis(3),setTimeout(function(){t=r.text(),i=r.attr("title")}),p.initInfosEvt(c),o("#more-intro").bind("touchstart",function(){var e=o(this);e.toggleClass("spread"),e.hasClass("spread")?(r.text(i),d.text("收起")):(r.text(t),d.text("more"))}),o("#brand-like").bind("touchstart",function(e){var a="ok",s=o(this);e.preventDefault(),s.hasClass("like")&&(a="cancel"),o.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:h,opt:a},success:function(e){200===e.code?s.toggleClass("like"):400===e.code&&u.show("未登录")},error:function(){u.show("网络断开连接了~")}})})}),define("js/guang/info",["zepto","mlellipsis","lazyload"],function(e,a,s){function t(e){r(e.find("img.lazy")),e.each(function(){var e=n(this),a=e.find(".info-title"),s=e.find(".info-text");a[0].mlellipsis(2),s[0].mlellipsis(2)})}function i(e){e.delegate(".like-btn","touchstart",function(e){var a=n(e.currentTarget),s=a.closest(".guang-info"),t="ok";a.hasClass("like")&&(t="cancel"),n.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:s.data("id"),opt:t},success:function(e){var s=e.code;200===s&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){d.show("网络断开连接了~")}})}),t(e.find(".guang-info"))}function o(e,a){h||a.end||(h=!0,n.ajax({type:"GET",url:" /guang/list/page",data:a,success:function(s){return" "===s?(a.end=!0,h=!1,p.addClass("hide"),void u.removeClass("hide")):(e.append(s),t(e.find(".guang-info")),a.page++,void(h=!1))},error:function(){d.show("网络断开连接了~"),h=!1}}))}var n=e("zepto"),l=e("mlellipsis"),r=e("lazyload"),d=e("js/plugin/tip"),c=n("#load-more-info"),p=n(""),u=n(""),h=!1;l.init(),c.length>0&&(p=c.children(".loading"),u=c.children(".no-more")),a.initInfosEvt=i,a.setLazyLoadAndMellipsis=t,a.loadMore=o}),define("js/guang/home",["zepto","swiper","mlellipsis","lazyload","index"],function(e,a,s){var t,i=e("zepto"),o=e("swiper"),n=e("js/guang/info"),l=n.setLazyLoadAndMellipsis,r=n.loadMore,d=i("#load-more-info"),c=i(""),p=i(""),u=i(window).height(),h=d.height(),f=i("#info-list"),g=f.children(".info-list"),m=i("#guang-nav"),v=m.children(".focus"),w=v.data("type"),b={};d.length>0&&(c=d.children(".loading"),p=d.children(".no-more")),t=new o(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),n.initInfosEvt(f),function(){var e=i("#gender").val();m.children(".guang-nav-item").each(function(){var a=i(this).data("type");b[a]={page:1,gender:e,type:a,end:!1}})}(),m.delegate(".guang-nav-item","touchstart",function(){var e,a,s=i(this);s.hasClass("focus")||(a=s.index(),s.addClass("focus"),v.removeClass("focus"),g.not(".hide").addClass("hide"),e=g.eq(a),e.removeClass("hide"),l(e.children(".guang-info")),v=s,w=s.data("type"),b[w].end?(c.addClass("hide"),p.removeClass("hide")):(c.removeClass("hide"),p.addClass("hide")))}),i(document).scroll(function(){i(window).scrollTop()+u>=i(document).height()-h&&r(g,b[w])})}),define("js/guang/list",["zepto","mlellipsis","lazyload"],function(e,a,s){var t=e("zepto"),i=e("js/guang/info"),o=i.loadMore,n=t(window).height(),l=t("#load-more").height(),r=t("#author-infos"),d=t("#tag"),c={page:1,end:!1},p=t("#info-list");i.initInfosEvt(p),r.length>0&&t.extend(c,{authorId:r.data("id")}),d.length>0&&t.extend(c,{tag:d.val()}),t(document).scroll(function(){t(window).scrollTop()+n>=t(document).height()-l&&o(p,c)})}),define("js/guang/detail",["zepto","mlellipsis","lazyload","iscroll-probe"],function(e,a,s){function t(e){var a=e.offset().left,s=-C+a+w/2+"px";n.css({backgroundPosition:s+" bottom"}),m&&b.css({backgroundPosition:s+" bottom"})}function i(e){var a,s,i,u=p(e.currentTarget),f=u.index();u.hasClass("focus")||(l.filter(".focus").removeClass("focus"),m&&(a=u.closest(".fixed-thumb-container").length>0?n:b,s=a.find(".thumb").eq(f),b.find(".thumb.focus").removeClass("focus"),s.addClass("focus")),u.addClass("focus"),t(u),r.not(".hide").addClass("hide"),i=r.eq(f),i.removeClass("hide"),h(i.find(".lazy")),m?c&&c.scrollToElement(d,400):p("body").animate({scrollTop:o.offset().top},400))}var o,n,l,r,d,c,p=e("zepto"),u=e("mlellipsis"),h=e("lazyload"),f=e("iscroll-probe"),g=p(".author .intro"),m=navigator.userAgent.indexOf("iPhone")>0?!0:!1,v=p(".collocation-block").length>0?!0:!1,w=0,b=p(""),d=document.querySelector("#wrapper .collocation-block"),C=p(window).width();m&&p("#wrapper").addClass("ios"),u.init(),h(p(".lazy")),p(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),v&&(o=p(".collocation-block"),n=o.children(".thumb-container"),l=n.find("li"),r=o.find(".prod"),w=l.width(),m&&(b=p("#wrapper").after(n.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),h(b.find(".lazy"),{event:"sporty"})),t(l.filter(".focus")),n.delegate(".thumb","touchend",i),m&&b.delegate(".thumb","touchend",i)),window.onload=function(){var e,a,s,t,i,l=p("#scroller");if(m){if(c=new f("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),!v)return void c.on("scroll",function(){l.trigger("scroll")});e=p(window).height(),i=b[0],a=n.height(),s=o.height(),t=o.offset().top,c.on("scroll",function(){var o=-this.y,n=i.className;t-e+a>=o?-1===n.indexOf("fixed-bottom")&&b.addClass("fixed-bottom").removeClass("hide"):t>=o?-1===n.indexOf("hide")&&b.addClass("hide").removeClass("fixed-bottom fixed-top"):t+s-a>=o?-1===n.indexOf("fixed-top")&&b.addClass("fixed-top").removeClass("hide absolute").css("top",""):t+s>=o?(-1===n.indexOf("absolute")&&b.addClass("absolute").removeClass("fixed-top hide"),i.style.top=t+s-a-o+"px"):o>t+s&&-1===n.indexOf("hide")&&b.addClass("hide").removeClass("absolute"),l.trigger("scroll")})}}}),define("js/home/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["zepto","swiper","lazyload","index"],function(e,a,s){function t(){v+=10,w.css({transform:"rotateX("+v+"deg)","-webkit-transform":"rotateX("+v+"deg)","-moz-transform":"rotateX("+v+"deg)"}),v/90%2===1&&(b?(w.addClass("animate"),b=!1):(w.removeClass("animate"),b=!0)),v/90%2===0&&v%360!==0?window.setTimeout(t,3e3):v%360===0?window.setTimeout(t,18e4):d(function(){t()})}var i,o,n,l,r,d,c,p,u,h,f=e("zepto"),g=e("swiper"),m=e("lazyload"),v=0,w=f(".home-header .logo"),b=!0;e("js/home/maybe-like"),m(f("img.lazy")),f(".nav-btn").on("click",function(e){f(this).hasClass("menu-open")||(f(".mobile-wrap").addClass("menu-open"),f(".overlay").addClass("show"),f(".side-nav").addClass("on"),f("body").css({height:f(window).height(),width:"100%",overflow:"hidden"})),e.stopPropagation()}),f(".mobile-wrap").on("click",function(){f(this).hasClass("menu-open")&&(f(".mobile-wrap").removeClass("menu-open"),f(".overlay").removeClass("show"),f(".sub-nav").removeClass("show"),f(".side-nav").removeClass("on"),f("body").css({height:"auto",overflow:"auto"}))}),f(".side-nav").on("click","li",function(){f(this).find(".sub-nav").size()>0&&(f(".sub-nav").removeClass("show"),f(this).find(".sub-nav").addClass("show"))}),f(".sub-nav").each(function(){f(this).find("li").eq(0).on("click",function(e){f(".sub-nav").removeClass("show"),e.stopPropagation()})}),f(".sub-nav").on("mouseenter","li",function(){0!==f(this).index()&&f(this).addClass("current").siblings().removeClass("current")}),f(".banner-swiper").find("li").size()>1&&(i=new g(".banner-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),n=new g(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),o=new g(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),f(".trend-topic-swiper").find("li").size()>1&&(l=new g(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),f(".category-swiper").each(function(e,a){u="category-swiper"+e,f(this).addClass(u),f("."+u).find(".swiper-slide").size()>1&&(r=new g("."+u,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+u+" .pagination-inner"}))}),f(".header-download").on("click",".close-btn",function(){f(this).parent().remove()}),d=function(){var e=null,a=["webkit","moz","ms"];for(p=0;p<a.length;p++)c=a[p]+"RequestAnimationFrame",window[c]&&(h=!0,e=c);return h?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),t()}),define("js/home/maybe-like",["zepto","lazyload"],function(e,a,s){var t,i,o,n,l=e("zepto"),r=e("js/plugin/tip"),d=e("lazyload"),c=l(window).height(),p=l("#load-more").height(),u=l("#goods-list"),h=!1,f=0,g=l(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",m=l(".mobile-wrap").hasClass("kids-wrap")?!0:!1,v=l(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=l("#maybe-like-nav");i=m?"/product/recom/maylikekids":v?"/product/recom/maylikelife":"/product/recom/maylike?gender="+g,o=w.children(".focus"),l("#maybe-like-nav").delegate("li","touchstart",function(){var e,a=l(this),s=l(".goods-list");a.hasClass("focus")||(n=a.index(),a.addClass("focus"),o.removeClass("focus"),s.not(".hide").addClass("hide"),e=s.eq(n),e.removeClass("hide"),o=a,l(document).trigger("scroll"))}),l(window).scroll(function(){if(l(window).scrollTop()+c>=l(document).height()-p){if(h)return;h=!0,t=u.children(".good-info").length,l.ajax({type:"GET",url:i,data:{page:f+1},success:function(e){return" "===e?void(h=!0):(u.append(e),d(l(".good-info").find("img.lazy")),h=!1,void f++)},error:function(){r.show("网络断开连接了~"),h=!1}})}})}),define("js/product/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["zepto","swiper","lazyload","index"],function(e,a,s){var t,i,o=e("zepto"),n=e("js/plugin/tip"),l=e("swiper"),r=e("lazyload"),d=o("#newarrival-nav"),c=o("#newarrival-goods-list"),p=c.children(".goods-list"),u=o(window).height(),h=o("#load-more").height(),f=o(".goods-list"),g=!1,m=0,v=0;i=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),r(o("img.lazy")),t=d.children(".focus"),o("#newarrival-nav").delegate("li","touchstart",function(){var e,a=o(this);a.hasClass("focus")||(v=a.index(),a.addClass("focus"),t.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(v),e.removeClass("hide"),t=a,o(document).trigger("scroll"))}),o(window).scroll(function(){if(o(window).scrollTop()+u>=o(document).height()-h){if(g)return;g=!0,o.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{dayLimit:v+1,page:m+1},success:function(e){return" "===e?void(g=!0):(f.append(e),r(o(".good-info").find("img.lazy")),g=!1,void m++)},error:function(){n.show("网络断开连接了~"),g=!1}})}})}),define("js/product/newsale/discount",["zepto","swiper","lazyload","index"],function(e,a,s){function t(e){var a="0.1,0.3";switch(e){case 0:a="0.1,0.3";break;case 1:a="0.4,0.6";break;case 2:a="0.7,0.9";break;case 3:a="0.1,0.9"}return a}var i,o,n=e("zepto"),l=e("swiper"),r=e("lazyload"),d=n("#discount-nav"),c=n("#discount-goods-list"),p=c.children(".goods-list"),u=n(".goods-list"),h=0,f=n(window).height(),g=n("#load-more").height(),m=!1,v=0,w="";o=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),r(n("img.lazy")),i=d.children(".focus"),n("#discount-nav").delegate("li","touchstart",function(){var e,a=n(this);a.hasClass("focus")||(h=a.index(),w=t(h),a.addClass("focus"),i.removeClass("focus"),p.not(".hide").addClass("hide"),e=p.eq(h),e.removeClass("hide"),i=a,n(document).trigger("scroll"))}),n(window).scroll(function(){if(n(window).scrollTop()+f>=n(document).height()-g){if(m)return;m=!0,n.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:{p_d:w,page:v+1},success:function(e){return" "===e?void(m=!1):(u.append(e),r(n(".good-info").find("img.lazy")),m=!1,void v++)},error:function(){tip.show("网络断开连接了~"),m=!1}})}})}),define("js/product/list",["zepto","lazyload"],function(e,a,s){function t(e){var a,s,t,r,d,c={};if(e){for(s in w)w.hasOwnProperty(s)&&(w[s].reload=!0);switch(v.children(".active").removeClass("active"),i.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}n.extend(m,a)}if(!o){if(i.hasClass("new")?r="newest":i.hasClass("price")?r="price":i.hasClass("discount")&&(r="discount"),t=w[r],d=t.page+1,t.reload)d=1;else if(t.end)return;n.extend(c,m,{type:r,order:t.order,page:d}),o=!0,n.ajax({type:"GET",url:"/product/list/search",data:c,success:function(e){var a,s='<p class="no-result">未找到相关搜索结果</p>';switch(r){case"newest":a=u;break;case"price":a=h;break;case"discount":a=f}" "===e?(t.end=!0,t.reload&&a.html(s)):(t.reload?a.html(e):a.append(e),l(a.find(".lazy"))),t.reload=!0,t.page=d,o=!1}})}}var i,o,n=e("zepto"),l=e("lazyload"),r=n("#brand-header"),d=n("#intro-box"),c=e("js/plugin/filter"),p=n("#goods-container"),u=p.children(".new-goods"),h=p.children(".price-goods"),f=p.children(".discount-goods"),g=n(window).height(),m={gender:n("#gender").val(),brand:n("#brand").val(),msort:n("#msort").val(),color:n("#color").val(),size:n("#size").val(),price:n("#price").val(),discount:n("#discount").val()},v=n("#list-nav"),w={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}};l(n(".lazy")),c.registerCbFn(t),v.delegate("li","touchstart",function(){var e,a,s,o=n(this);if(o.hasClass("filter"))o.hasClass("active")?(c.hideFilter(),i.addClass("active"),o.removeClass("active")):(i=o.siblings(".active"),i.removeClass("active"),o.addClass("active"),c.showFilter());else{if(o.hasClass("new")?a="newest":o.hasClass("price")?a="price":o.hasClass("discount")&&(a="discount"),e=w[a],o.hasClass("active")){if(o.hasClass("new"))return;(o.hasClass("price")||o.hasClass("discount"))&&(o.find(".icon > .iconfont").toggleClass("cur"),i=o,e.reload=!0,e.order=0===e.order?1:0)}else{if(s=o.siblings(".active"),i=o,s.hasClass("filter"))c.hideFilter();else switch(p.children(".container:not(.hide)").addClass("hide"),a){case"newest":u.removeClass("hide");break;case"price":h.removeClass("hide");break;case"discount":f.removeClass("hide")}s.removeClass("active"),o.addClass("active")}e.reload&&t()}}),n(window).scroll(function(){n(window).scrollTop()+g>n(document).height()-.25*p.height()&&t()}),r.children(".btn-intro").bind("touchstart",function(){d.removeClass("hide")}),n(".close-intro, .brand-intro-box").click(function(){d.addClass("hide")}),n("#brand-intro").click(function(e){e.stopPropagation()}),r.children(".btn-col").bind("touchstart",function(){n(this).toggleClass("coled")})}),define("js/plugin/filter",["zepto"],function(e,a,s){function t(){r.addClass("hide")}function i(){r.removeClass("hide")}function o(e){n=e}var n,l=e("zepto"),r=l(".filter-mask, .filter-body"),d=r.find(".classify"),c=r.find(".sub-classify");d.children(":first-child").addClass("active"),d.delegate(".classify-item","touchstart",function(){var e=l(this);e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}),r.filter(".filter-mask").click(function(){t()}),c.delegate("li","click",function(e){var a,s,i=l(this),o=i.data("id"),r=i.closest(".sub-classify"),d=r.siblings(".shower");e.stopPropagation(),i.hasClass("chosed")||(r.children(".chosed").removeClass("chosed"),i.addClass("chosed"),a=l.trim(i.html()),s=l.trim(d.html()),d.html(s.substring(0,s.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===i.index()?d.addClass("default"):d.removeClass("default"),n&&n({type:r.data("type"),id:o}),t())}),a.showFilter=i,a.hideFilter=t,a.registerCbFn=o}),define("js/product/detail/detail",["zepto","swiper","lazyload","index"],function(e,a,s){var t,i=e("zepto"),o=e("swiper"),n=e("lazyload");n(i("img.lazy")),t=new o(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"div",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}),define("js/index/index",["zepto"],function(e,a,s){e("js/index/search"),e("js/index/channel")}),define("js/index/search",["zepto"],function(e,a,s){var t=e("zepto"),i=t("#search-input > input"),o=t("#search-input > .clear-input"),n=t(".history");t("#clear-history").bind("touchstart",function(){t.ajax({type:"POST",url:"/search/clearHistory",success:function(e){200===e.code&&n.html("")}})}),t("#search").bind("touchstart",function(){var e=i.val();t.ajax({type:"POST",url:"/search",data:{val:e},success:function(e){200===e.code&&(location.href=e.data)}})}),i.bind("input",function(){""===i.val()?o.addClass("hide"):o.removeClass("hide")}),o.bind("touchstart",function(){i.val("").trigger("input")})}),define("js/index/channel",[],function(e,a,s){});
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Wed Sep 30 17:19:41 2015 5 +Created by FontForge 20120731 at Fri Oct 23 16:38:57 2015
6 By Ads 6 By Ads
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -16,10 +16,10 @@ Created by FontForge 20120731 at Wed Sep 30 17:19:41 2015 @@ -16,10 +16,10 @@ Created by FontForge 20120731 at Wed Sep 30 17:19:41 2015
16 ascent="812" 16 ascent="812"
17 descent="-212" 17 descent="-212"
18 x-height="792" 18 x-height="792"
19 - bbox="0 -224 3943 812" 19 + bbox="-0.75 -224 3943 812.871"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E619" 22 + unicode-range="U+0078-E628"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
@@ -114,5 +114,43 @@ d="M224 192q-40 0 -68 28t-28 68t28 68t68 28t68 -28t28 -68t-28 -68t-68 -28zM512 1 @@ -114,5 +114,43 @@ d="M224 192q-40 0 -68 28t-28 68t28 68t68 28t68 -28t28 -68t-28 -68t-68 -28zM512 1
114 <glyph glyph-name="uniE619" unicode="&#xe619;" 114 <glyph glyph-name="uniE619" unicode="&#xe619;"
115 d="M126 225q30 0 50.5 21.5t20.5 52.5q0 33 -20.5 54.5t-51 21.5t-51.5 -21.5t-21 -54.5q0 -45 38 -66q17 -8 35 -8zM512 225q15 0 28.5 5.5t23 15.5t15 24t5.5 29q0 9 -2 18t-5.5 16.5t-8 14t-10.5 11.5t-13.5 9t-15.5 5.5t-17 1.5q-30 0 -51 -21.5t-21 -54.5q0 -45 38 -66 115 d="M126 225q30 0 50.5 21.5t20.5 52.5q0 33 -20.5 54.5t-51 21.5t-51.5 -21.5t-21 -54.5q0 -45 38 -66q17 -8 35 -8zM512 225q15 0 28.5 5.5t23 15.5t15 24t5.5 29q0 9 -2 18t-5.5 16.5t-8 14t-10.5 11.5t-13.5 9t-15.5 5.5t-17 1.5q-30 0 -51 -21.5t-21 -54.5q0 -45 38 -66
116 q16 -8 34 -8zM899.5 225q30.5 0 51 21.5t20.5 52.5q0 9 -2 18t-5.5 16.5t-8 14t-11 11.5t-13.5 9t-15 5.5t-17 1.5q-20 0 -36.5 -9.5t-26 -27t-9.5 -39.5q0 -31 21 -52.5t51.5 -21.5z" /> 116 q16 -8 34 -8zM899.5 225q30.5 0 51 21.5t20.5 52.5q0 9 -2 18t-5.5 16.5t-8 14t-11 11.5t-13.5 9t-15 5.5t-17 1.5q-20 0 -36.5 -9.5t-26 -27t-9.5 -39.5q0 -31 21 -52.5t51.5 -21.5z" />
  117 + <glyph glyph-name="uniE61A" unicode="&#xe61a;"
  118 +d="M512 -146q-91 0 -173.5 35.5t-142 95t-95 142t-35.5 173.5q0 61 16 118.5t45 106.5t70 90t90 70t106.5 45t118.5 16q91 0 173.5 -35.5t142 -95t95 -142t35.5 -173.5q0 -61 -16 -118.5t-45 -106.5t-70 -90t-90 -70t-106.5 -45t-118.5 -16zM512 682q-104 0 -192 -51
  119 +t-139 -139t-51 -192t51 -192t139 -139t192 -51t192 51t139 139t51 192t-51 192t-139 139t-192 51zM512 508zM464 508q0 20 14 34t34 14t34 -14t14 -34t-14 -34t-34 -14t-34 14t-14 34zM512 44q-13 0 -22.5 9.5t-9.5 22.5v288q0 13 9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5
  120 +v-288q0 -13 -9.5 -22.5t-22.5 -9.5z" />
  121 + <glyph glyph-name="uniE61B" unicode="&#xe61b;"
  122 +d="M437 41h-193q-27 2 -41.5 22.5t-17.5 45.5q3 25 17.5 41t41.5 18h193v63l-193 1q-27 2 -41.5 19t-17.5 43q3 25 17.5 41t41.5 18h144l-134 236q-10 12 -19 30.5t-8 40.5q5 28 20 45.5t56 22.5q24 -2 43 -16.5t31 -31.5l152 -278l167 280q12 17 31 30t43 16q15 -1 27.5 -4
  123 +t22 -10t16 -20t9.5 -34q0 -29 -20 -55l-155 -252h147q26 -2 41 -18t17 -41q-2 -26 -17.5 -44t-41.5 -20l-191 -1v-61h192q26 -2 41 -20t17 -43q-2 -26 -17 -43.5t-41 -19.5l-192 1v-106q-4 -85 -93 -85q-44 0 -68.5 21t-26.5 64v104z" />
  124 + <glyph glyph-name="uniE61C" unicode="&#xe61c;"
  125 +d="M946 -196h-868q-26 0 -44 18t-18 44v868q0 26 18 44t44 18h868q26 0 44 -18t18 -44v-868q0 -26 -18 -44t-44 -18zM946 703q0 13 -9 22t-22 9h-806q-13 0 -22 -9t-9 -22v-806q0 -13 9 -22t22 -9h806q13 0 22 9t9 22v806z" />
  126 + <glyph glyph-name="uniE61D" unicode="&#xe61d;"
  127 +d="M939 -202h-876q-17 0 -31.5 8.5t-23 23t-8.5 31.5v876q0 26 18.5 44.5t44.5 18.5h876q26 0 44.5 -18.5t18.5 -44.5v-876q0 -39 -35 -57q-14 -6 -28 -6zM814 612l-376 -438l-250 188l-63 -126l313 -250l439 501z" />
  128 + <glyph glyph-name="uniE61E" unicode="&#xe61e;"
  129 +d="M224 211l416 410l179 -179l-416 -410zM659 525l-19 19l-333 -333l19 -19zM698 486l-20 20l-332 -333l19 -19zM736 448l-19 19l-333 -333l19 -19zM717 704q14 14 38 14t39 -14l102 -102q6 -6 9.5 -14t4.5 -16.5t0 -17t-4.5 -16.5t-9.5 -13l-64 -58l-173 173zM211 186
  130 +l167 -167l-148 -51l-70 70zM205 -45l-83 -32l32 83z" />
  131 + <glyph glyph-name="uniE61F" unicode="&#xe61f;"
  132 +d="M512 812q-138 0 -256 -69t-187 -187t-69 -256t69 -256t187 -187t256 -69t256 69t187 187t69 256t-69 256t-187 187t-256 69zM563 44h-102v307h102v-307zM563 454h-102v102h102v-102z" />
  133 + <glyph glyph-name="uniE620" unicode="&#xe620;"
  134 +d="M938 276h-400v274h-50v-274h-399q-15 0 -29 5.5t-24 15.5t-16 24t-6 29v175q0 31 22 53t53 22h90q-18 21 -29 46t-11 54q0 27 10 47.5t25 30t29.5 15t24.5 6.5l11 1q53 0 100 -15.5t81 -42t56 -50t39 -50.5q17 27 39.5 51t56 50t79.5 41.5t98 15.5h4q2 0 8.5 -1.5
  135 +t13.5 -3t16 -5.5t16.5 -9t15.5 -13t13.5 -17.5t9 -23.5t3.5 -30q0 -28 -9.5 -52t-25.5 -45h85q31 0 53 -22t22 -53v-175q0 -44 -39 -65q-17 -9 -36 -9zM264 725q-15 0 -26 -2.5t-15.5 -6t-6.5 -7.5t-2 -6v-3q0 -49 66 -100h173q-14 30 -30 52.5t-34 35.5t-33 21t-34.5 11.5
  136 +t-30 4t-27.5 0.5zM763 723q-13 0 -20 -0.5t-21.5 -1.5t-24.5 -4.5t-24 -9t-25.5 -14.5t-24 -21.5t-24.5 -30.5t-22 -41h177q59 50 59 97v3q0 2 -2 6.5t-7 7.5t-15.5 6t-25.5 3zM488 -224h-349q-15 0 -29 6t-24 16t-16 24t-6 29v375h424v-450zM538 226h400v-375
  137 +q0 -31 -22 -53t-53 -22h-325v450z" />
  138 + <glyph glyph-name="uniE621" unicode="&#xe621;"
  139 +d="M160 492v-640q0 -26 19 -45t45 -19h576q26 0 45 19t19 45v640h-704zM352 -84h-64v448h64v-448zM480 -84h-64v448h64v-448zM608 -84h-64v448h64v-448zM736 -84h-64v448h64v-448zM880 684h-208v80q0 20 -14 34t-34 14h-224q-8 0 -15 -2.5t-13 -7t-10.5 -10.5t-7 -13
  140 +t-2.5 -15v-80h-208q-20 0 -34 -14t-14 -34v-80h832v80q0 6 -1.5 11t-3.5 10t-5.5 9t-7.5 7.5t-9 5.5t-10 3.5t-11 1.5zM608 684h-192v63h192v-63z" />
  141 + <glyph glyph-name="uniE622" unicode="&#xe622;" horiz-adv-x="1173"
  142 +d="M586 588q-64 150 -188 203q-114 47 -222 -7q-112 -56 -155 -192q-20 -67 -21 -144q0 -41 9 -78.5t24 -66.5t39 -57.5t47 -48.5t55.5 -43t56.5 -38t58.5 -35.5t53.5 -33.5q63 -42 118 -94.5t86.5 -95t39.5 -69.5q4 19 25.5 50t53.5 66t75 74t88 71q21 15 53.5 35.5t58 36
  143 +t57 38t55 43t47 48t39 56.5t25 66.5t8.5 78.5q0 75 -19.5 138t-52.5 105.5t-76.5 70.5t-91 37.5t-98 1t-96 -34.5t-85.5 -72.5t-67 -108.5z" />
  144 + <glyph glyph-name="uniE623" unicode="&#xe623;"
  145 +d="M835 576l-60 63l-263 -275v0l-263 275l-60 -63l262 -276l-262 -276l60 -63l263 275v0l263 -275l60 63l-262 276z" />
  146 + <glyph glyph-name="uniE624" unicode="&#xe624;" horiz-adv-x="1000"
  147 +d="M459 754h22h23h20h22h22v-191v-191h191h191v-109h-191h-191v-191v-190h-109v190v191h-191h-190q-1 37 -1 109h128h127h127v116v150v116z" />
  148 + <glyph glyph-name="uniE625" unicode="&#xe625;" horiz-adv-x="1000"
  149 +d="M77 372h873v-109h-873v109z" />
  150 + <glyph glyph-name="uniE626" unicode="&#xe626;"
  151 +d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 115l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" />
  152 + <glyph glyph-name="uniE628" unicode="&#xe628;"
  153 +d="M505 776q77 0 148.5 -23.5t129 -67t101 -101.5t67.5 -129.5t24 -147.5q0 -64 -17 -125t-47.5 -112t-74 -94.5t-94.5 -74t-112 -47.5t-125 -17q-95 0 -182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -104q112 0 206.5 55t149.5 149.5
  154 +t55 206.5q0 37 -6.5 73.5t-19.5 69.5t-30.5 64t-40.5 57.5t-49.5 49.5t-57.5 40.5t-64 30t-69.5 19t-73.5 6.5q-111 0 -205.5 -55t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 138v-59h-58v59h58zM470 564h58v-349h-58v349z" />
117 </font> 155 </font>
118 </defs></svg> 156 </defs></svg>

6.5 KB | W: | H:

9.08 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Thu Oct 22 11:17:10 2015 5 +Created by FontForge 20120731 at Fri Oct 23 16:38:57 2015
6 By Ads 6 By Ads
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Oct 22 11:17:10 2015 @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Oct 22 11:17:10 2015
19 bbox="-0.75 -224 3943 812.871" 19 bbox="-0.75 -224 3943 812.871"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E626" 22 + unicode-range="U+0078-E628"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
@@ -114,6 +114,10 @@ d="M224 192q-40 0 -68 28t-28 68t28 68t68 28t68 -28t28 -68t-28 -68t-68 -28zM512 1 @@ -114,6 +114,10 @@ d="M224 192q-40 0 -68 28t-28 68t28 68t68 28t68 -28t28 -68t-28 -68t-68 -28zM512 1
114 <glyph glyph-name="uniE619" unicode="&#xe619;" 114 <glyph glyph-name="uniE619" unicode="&#xe619;"
115 d="M126 225q30 0 50.5 21.5t20.5 52.5q0 33 -20.5 54.5t-51 21.5t-51.5 -21.5t-21 -54.5q0 -45 38 -66q17 -8 35 -8zM512 225q15 0 28.5 5.5t23 15.5t15 24t5.5 29q0 9 -2 18t-5.5 16.5t-8 14t-10.5 11.5t-13.5 9t-15.5 5.5t-17 1.5q-30 0 -51 -21.5t-21 -54.5q0 -45 38 -66 115 d="M126 225q30 0 50.5 21.5t20.5 52.5q0 33 -20.5 54.5t-51 21.5t-51.5 -21.5t-21 -54.5q0 -45 38 -66q17 -8 35 -8zM512 225q15 0 28.5 5.5t23 15.5t15 24t5.5 29q0 9 -2 18t-5.5 16.5t-8 14t-10.5 11.5t-13.5 9t-15.5 5.5t-17 1.5q-30 0 -51 -21.5t-21 -54.5q0 -45 38 -66
116 q16 -8 34 -8zM899.5 225q30.5 0 51 21.5t20.5 52.5q0 9 -2 18t-5.5 16.5t-8 14t-11 11.5t-13.5 9t-15 5.5t-17 1.5q-20 0 -36.5 -9.5t-26 -27t-9.5 -39.5q0 -31 21 -52.5t51.5 -21.5z" /> 116 q16 -8 34 -8zM899.5 225q30.5 0 51 21.5t20.5 52.5q0 9 -2 18t-5.5 16.5t-8 14t-11 11.5t-13.5 9t-15 5.5t-17 1.5q-20 0 -36.5 -9.5t-26 -27t-9.5 -39.5q0 -31 21 -52.5t51.5 -21.5z" />
  117 + <glyph glyph-name="uniE61A" unicode="&#xe61a;"
  118 +d="M512 -146q-91 0 -173.5 35.5t-142 95t-95 142t-35.5 173.5q0 61 16 118.5t45 106.5t70 90t90 70t106.5 45t118.5 16q91 0 173.5 -35.5t142 -95t95 -142t35.5 -173.5q0 -61 -16 -118.5t-45 -106.5t-70 -90t-90 -70t-106.5 -45t-118.5 -16zM512 682q-104 0 -192 -51
  119 +t-139 -139t-51 -192t51 -192t139 -139t192 -51t192 51t139 139t51 192t-51 192t-139 139t-192 51zM512 508zM464 508q0 20 14 34t34 14t34 -14t14 -34t-14 -34t-34 -14t-34 14t-14 34zM512 44q-13 0 -22.5 9.5t-9.5 22.5v288q0 13 9.5 22.5t22.5 9.5t22.5 -9.5t9.5 -22.5
  120 +v-288q0 -13 -9.5 -22.5t-22.5 -9.5z" />
117 <glyph glyph-name="uniE61B" unicode="&#xe61b;" 121 <glyph glyph-name="uniE61B" unicode="&#xe61b;"
118 d="M437 41h-193q-27 2 -41.5 22.5t-17.5 45.5q3 25 17.5 41t41.5 18h193v63l-193 1q-27 2 -41.5 19t-17.5 43q3 25 17.5 41t41.5 18h144l-134 236q-10 12 -19 30.5t-8 40.5q5 28 20 45.5t56 22.5q24 -2 43 -16.5t31 -31.5l152 -278l167 280q12 17 31 30t43 16q15 -1 27.5 -4 122 d="M437 41h-193q-27 2 -41.5 22.5t-17.5 45.5q3 25 17.5 41t41.5 18h193v63l-193 1q-27 2 -41.5 19t-17.5 43q3 25 17.5 41t41.5 18h144l-134 236q-10 12 -19 30.5t-8 40.5q5 28 20 45.5t56 22.5q24 -2 43 -16.5t31 -31.5l152 -278l167 280q12 17 31 30t43 16q15 -1 27.5 -4
119 t22 -10t16 -20t9.5 -34q0 -29 -20 -55l-155 -252h147q26 -2 41 -18t17 -41q-2 -26 -17.5 -44t-41.5 -20l-191 -1v-61h192q26 -2 41 -20t17 -43q-2 -26 -17 -43.5t-41 -19.5l-192 1v-106q-4 -85 -93 -85q-44 0 -68.5 21t-26.5 64v104z" /> 123 t22 -10t16 -20t9.5 -34q0 -29 -20 -55l-155 -252h147q26 -2 41 -18t17 -41q-2 -26 -17.5 -44t-41.5 -20l-191 -1v-61h192q26 -2 41 -20t17 -43q-2 -26 -17 -43.5t-41 -19.5l-192 1v-106q-4 -85 -93 -85q-44 0 -68.5 21t-26.5 64v104z" />
@@ -145,5 +149,8 @@ d="M459 754h22h23h20h22h22v-191v-191h191h191v-109h-191h-191v-191v-190h-109v190v1 @@ -145,5 +149,8 @@ d="M459 754h22h23h20h22h22v-191v-191h191h191v-109h-191h-191v-191v-190h-109v190v1
145 d="M77 372h873v-109h-873v109z" /> 149 d="M77 372h873v-109h-873v109z" />
146 <glyph glyph-name="uniE626" unicode="&#xe626;" 150 <glyph glyph-name="uniE626" unicode="&#xe626;"
147 d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 115l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" /> 151 d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 115l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" />
  152 + <glyph glyph-name="uniE628" unicode="&#xe628;"
  153 +d="M505 776q77 0 148.5 -23.5t129 -67t101 -101.5t67.5 -129.5t24 -147.5q0 -64 -17 -125t-47.5 -112t-74 -94.5t-94.5 -74t-112 -47.5t-125 -17q-95 0 -182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -104q112 0 206.5 55t149.5 149.5
  154 +t55 206.5q0 37 -6.5 73.5t-19.5 69.5t-30.5 64t-40.5 57.5t-49.5 49.5t-57.5 40.5t-64 30t-69.5 19t-73.5 6.5q-111 0 -205.5 -55t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 138v-59h-58v59h58zM470 564h58v-349h-58v349z" />
148 </font> 155 </font>
149 </defs></svg> 156 </defs></svg>
No preview for this file type
No preview for this file type
@@ -8,4 +8,5 @@ require('./plus-star/list'); @@ -8,4 +8,5 @@ require('./plus-star/list');
8 require('./plus-star/detail'); 8 require('./plus-star/detail');
9 9
10 require('./home'); 10 require('./home');
11 -require('./list');  
  11 +require('./list');
  12 +require('./detail');
@@ -78,6 +78,10 @@ function search(opt) { @@ -78,6 +78,10 @@ function search(opt) {
78 } 78 }
79 } 79 }
80 80
  81 + //处理active状态
  82 + $listNav.children('.active').removeClass('active');
  83 + $pre.addClass('active');
  84 +
81 switch (opt.type) { 85 switch (opt.type) {
82 case 'gender': 86 case 'gender':
83 ext = { 87 ext = {
  1 +/**
  2 + * 购物车Logic
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/20
  5 + */
  6 +
  7 +var $ = require('yoho.zepto');
  8 +
  9 +var $cartContent = $('.cart-content');
  10 +
  11 +require('./good');
  12 +
  13 +$('.cart-nav').delegate('li', 'touchstart', function() {
  14 + var $this = $(this);
  15 +
  16 + if ($this.hasClass('active')) {
  17 + return;
  18 + }
  19 +
  20 + $this.siblings('.active').removeClass('active');
  21 + $this.addClass('active');
  22 +
  23 + //切换普通商品和预售商品购物车显示
  24 + $cartContent.toggleClass('hide');
  25 +
  26 + //trigger lazyload
  27 + $(window).trigger('scroll');
  28 +});
  1 +/**
  2 + * 赠品/加价购
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/10/23
  5 + */
  6 +
  7 +var $ = require('yoho.zepto'),
  8 + lazyLoad = require('yoho.zeptolazyload');
  9 +
  10 +var chosePanel = require('./chose-panel');
  11 +
  12 +lazyLoad($('.lazy'));
  13 +
  14 +$('.gift-advance-page').delegate('.chose', 'touchstart', function() {
  15 + var id = $(this).closest('.gift-advance-good').data('id');
  16 +
  17 + $.ajax({
  18 + type: 'GET',
  19 + url: '/shoppingCart/goodinfo',
  20 + data: {
  21 + id: id
  22 + },
  23 + success: function(data) {
  24 + if (data.code === 200) {
  25 + chosePanel.show(data.data);
  26 + }
  27 + }
  28 + });
  29 +});
@@ -55,9 +55,36 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() { @@ -55,9 +55,36 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() {
55 } 55 }
56 } 56 }
57 }); 57 });
58 -}).delegate('.icon-del', 'touchstart', function() { 58 +}).delegate('.icon-del', 'touchstart', function(e) {
  59 + e.stopPropagation();
  60 +
59 $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide'); 61 $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
60 62
61 $(document).bind('touchstart', docTouchEvt); 63 $(document).bind('touchstart', docTouchEvt);
  64 +}).delegate('.opt-panel', 'touchstart', function() {
  65 + var $this = $(this),
  66 + id = $this.closest('.shopping-cart-good').data('id');
  67 +
  68 + if ($this.closest('.put-in-favorite')) {
  69 +
  70 + //移入收藏夹
  71 + $.ajax({
  72 + type: 'POST',
  73 + url: '/shoppingCart/col',
  74 + data: {
  75 + id: id
  76 + }
  77 + });
  78 + } else {
  79 +
  80 + //删除
  81 + $.ajax({
  82 + type: 'POST',
  83 + url: '/shoppingCart/del',
  84 + data: {
  85 + id: id
  86 + }
  87 + });
  88 + }
62 }); 89 });
63 90
1 /** 1 /**
2 - * 购物车Logic 2 + * 购物车打包入口
3 * @author: xuqi<qi.xu@yoho.cn> 3 * @author: xuqi<qi.xu@yoho.cn>
4 - * @date: 2015/10/20 4 + * @date: 2015/10/23
5 */ 5 */
6 6
7 -var $ = require('yoho.zepto');  
8 -  
9 -require('./good');  
10 -  
11 -$('.cart-nav').delegate('li', 'touchstart', function() {  
12 - var $this = $(this);  
13 -  
14 - if ($this.hasClass('active')) {  
15 - return;  
16 - }  
17 -  
18 - $this.siblings('.active').removeClass('active');  
19 - $this.addClass('active');  
20 -});  
  7 +require('./cart');
  8 +require('./gift-advance');
  1 +.gift-advance-page {
  2 + .gift-advance-good {
  3 + position: relative;
  4 + padding: 20rem / $pxConvertRem 0;
  5 + margin-left: 34rem / $pxConvertRem;
  6 + height: 160rem / $pxConvertRem;
  7 + border-bottom: 1px solid #e0e0e0;
  8 +
  9 + &:last-child {
  10 + border-bottom: none;
  11 + }
  12 + }
  13 +
  14 +
  15 + .advance-block .gift-advance-good:last-child {
  16 + border-bottom: none;
  17 + }
  18 +
  19 + .advance-block:last-child .gift-advance-good:last-child {
  20 + border-bottom: 1px solid #e0e0e0;
  21 + }
  22 +
  23 + .thumb-wrap {
  24 + position: relative;
  25 + float: left;
  26 + width: 120rem / $pxConvertRem;
  27 + height: 160rem / $pxConvertRem;
  28 +
  29 + .thumb {
  30 + width: 100%;
  31 + height: 100%;
  32 + }
  33 + }
  34 +
  35 + .tag {
  36 + position: absolute;
  37 + bottom: 0;
  38 + left: 0;
  39 + right: 0;
  40 + height: 25rem / $pxConvertRem;
  41 + color: #fff;
  42 + text-align: center;
  43 + background: #a1ce4e;
  44 +
  45 + &:before {
  46 + content: '赠品';
  47 + }
  48 + }
  49 +
  50 + .deps {
  51 + margin-left: 135rem / $pxConvertRem;
  52 + }
  53 +
  54 + .name {
  55 + font-size: 28rem / $pxConvertRem;
  56 + }
  57 +
  58 + .row:nth-child(2) {
  59 + font-size: 22rem / $pxConvertRem;
  60 + height: 45rem / $pxConvertRem;
  61 + line-height: 45rem / $pxConvertRem;
  62 +
  63 + > span {
  64 + margin-right: 15rem / $pxConvertRem;
  65 + }
  66 + }
  67 +
  68 + .row:nth-child(3) {
  69 + position: relative;
  70 + }
  71 +
  72 + .color, .size {
  73 + color: #b6b6b6;
  74 + }
  75 +
  76 + .price {
  77 + font-size: 24rem / $pxConvertRem;
  78 + color: #000;
  79 + }
  80 +
  81 + .count {
  82 + font-size: 20rem / $pxConvertRem;
  83 + color: #999;
  84 + margin-left: 22rem / $pxConvertRem;
  85 + }
  86 +
  87 + .chose {
  88 + position: absolute;
  89 + width: 88rem / $pxConvertRem;
  90 + height: 58rem / $pxConvertRem;
  91 + background: #f8f8f8;
  92 + border: 1px solid #ccc;
  93 + right: 20rem / $pxConvertRem;
  94 + top: 71rem / $pxConvertRem;
  95 + font-size: 26rem / $pxConvertRem;
  96 + }
  97 +
  98 + .title {
  99 + height: 50rem / $pxConvertRem;
  100 + line-height: 50rem / $pxConvertRem;
  101 + padding-left: 20rem / $pxConvertRem;
  102 + font-size: 24rem / $pxConvertRem;
  103 + background: #f8f8f8;
  104 + }
  105 +
  106 + .advance-block .tag {
  107 + background: #eb76aa;
  108 + &:before {
  109 + content: '加价购';
  110 + }
  111 + }
  112 +}
1 -@import "good", "chose-panel"; 1 +@import "good", "chose-panel", "gift-advance-good";
2 2
3 3
4 .icon-checkbox:before { content: "\e61c"; } 4 .icon-checkbox:before { content: "\e61c"; }
@@ -6,135 +6,175 @@ @@ -6,135 +6,175 @@
6 6
7 .shopping-cart-page { 7 .shopping-cart-page {
8 padding-bottom: 120rem / $pxConvertRem; 8 padding-bottom: 120rem / $pxConvertRem;
9 -}  
10 9
11 -.cart-nav {  
12 - height: 30rem / $pxConvertRem;  
13 - color: #c6c6c6;  
14 - border-bottom: 1px solid #e0e0e0;  
15 - padding: 30rem / $pxConvertRem 0; 10 + .cart-nav {
  11 + height: 30rem / $pxConvertRem;
  12 + color: #c6c6c6;
  13 + border-bottom: 1px solid #e0e0e0;
  14 + padding: 30rem / $pxConvertRem 0;
16 15
17 - li {  
18 - float: left;  
19 - width: 50%;  
20 - } 16 + li {
  17 + float: left;
  18 + width: 50%;
  19 + }
21 20
22 - li.active {  
23 - color: #000;  
24 - } 21 + li.active {
  22 + color: #000;
  23 + }
25 24
26 - span {  
27 - display: block;  
28 - box-sizing: border-box;  
29 - width: 100%;  
30 - height: 30rem / $pxConvertRem;  
31 - line-height: 30rem / $pxConvertRem;  
32 - font-size: 30rem / $pxConvertRem;  
33 - text-align: center;  
34 - } 25 + span {
  26 + display: block;
  27 + box-sizing: border-box;
  28 + width: 100%;
  29 + height: 30rem / $pxConvertRem;
  30 + line-height: 30rem / $pxConvertRem;
  31 + font-size: 30rem / $pxConvertRem;
  32 + text-align: center;
  33 + }
35 34
36 - li:first-child span {  
37 - border-right: 1px solid #e0e0e0; 35 + li:first-child span {
  36 + border-right: 1px solid #e0e0e0;
  37 + }
38 } 38 }
39 -}  
40 39
41 -.cart-goods {  
42 - border-bottom: 1px solid #e0e0e0; 40 + .login-info {
  41 + height: 46rem / $pxConvertRem;
  42 + padding: 17rem / $pxConvertRem 20rem / $pxConvertRem;
  43 + color: #24acaa;
  44 + text-align: center;
  45 + font-size: 28rem / $pxConvertRem;
43 46
44 - .shopping-cart-good:last-child .info {  
45 - border-bottom: none; 47 + .btn {
  48 + display: inline-block;
  49 + background: #ed0010;
  50 + color: #fff;
  51 + width: 80rem / $pxConvertRem;
  52 + height: 46rem / $pxConvertRem;
  53 + line-height: 46rem / $pxConvertRem;
  54 + }
46 } 55 }
47 -}  
48 56
49 -.freebie-and-advance-buy {  
50 - padding: 20rem / $pxConvertRem;  
51 - font-size: 24rem / $pxConvertRem;  
52 - border-bottom: 1px solid #e0e0e0; 57 + .presell-info {
  58 + height: 60rem / $pxConvertRem;
  59 + padding: 15rem / $pxConvertRem 30rem / $pxConvertRem;
  60 + font-size: 22rem / $pxConvertRem;
  61 + background: #f0f0f0;
  62 + color: #b7b7b7;
53 63
54 - > li {  
55 - box-sizing: border-box;  
56 - height: 90rem / $pxConvertRem;  
57 - line-height: 90rem / $pxConvertRem;  
58 - margin-bottom: 10rem / $pxConvertRem;  
59 - background: #f8f8f8;  
60 - padding: 0 20rem / $pxConvertRem; 64 + > span {
  65 + display: block;
  66 + }
61 67
62 - &:last-child {  
63 - margin-bottom: 0; 68 + .iconfont {
  69 + float: left;
  70 + font-size: 45rem / $pxConvertRem;
64 } 71 }
65 72
66 - a {  
67 - float: right; 73 + .txt {
  74 + height: 30rem / $pxConvertRem;
  75 + line-height: 30rem / $pxConvertRem;
  76 + margin-left: 80rem / $pxConvertRem;
68 } 77 }
69 } 78 }
70 79
71 - .count {  
72 - color: #f00;  
73 - } 80 + .cart-goods {
  81 + border-bottom: 1px solid #e0e0e0;
74 82
75 - .icon-right-arrow {  
76 - color: #8f8f8f; 83 + .shopping-cart-good:last-child .info {
  84 + border-bottom: none;
  85 + }
77 } 86 }
78 -}  
79 -  
80 -.price-compute {  
81 - padding: 20rem / $pxConvertRem;  
82 - border-bottom: 1px solid #e0e0e0;  
83 - font-size: 26rem / $pxConvertRem;  
84 87
85 - .title {  
86 - display: inline-block;  
87 - width: 175rem / $pxConvertRem;  
88 - } 88 + .freebie-and-advance-buy {
  89 + padding: 20rem / $pxConvertRem;
  90 + font-size: 24rem / $pxConvertRem;
  91 + border-bottom: 1px solid #e0e0e0;
  92 +
  93 + > li {
  94 + box-sizing: border-box;
  95 + height: 90rem / $pxConvertRem;
  96 + line-height: 90rem / $pxConvertRem;
  97 + margin-bottom: 10rem / $pxConvertRem;
  98 + background: #f8f8f8;
  99 + padding: 0 20rem / $pxConvertRem;
  100 +
  101 + &:last-child {
  102 + margin-bottom: 0;
  103 + }
  104 +
  105 + a {
  106 + float: right;
  107 + }
  108 + }
89 109
90 - .minus {  
91 - float: right;  
92 - }  
93 -} 110 + .count {
  111 + color: #f00;
  112 + }
94 113
95 -.balance {  
96 - position: fixed;  
97 - box-sizing: border-box;  
98 - bottom: 0;  
99 - width: 100%;  
100 - padding: 20rem / $pxConvertRem;  
101 - height: 120rem / $pxConvertRem;  
102 - border-top: 1px solid #e0e0e0;  
103 - background: #fff;  
104 -  
105 - .iconfont {  
106 - position: absolute;  
107 - top: 50%;  
108 - margin-top: -14rem / $pxConvertRem;  
109 - font-size: 28rem / $pxConvertRem; 114 + .icon-right-arrow {
  115 + color: #8f8f8f;
  116 + }
110 } 117 }
111 118
112 - p {  
113 - float: left;  
114 - margin-left: 50rem / $pxConvertRem; 119 + .price-compute {
  120 + padding: 20rem / $pxConvertRem;
  121 + border-bottom: 1px solid #e0e0e0;
115 font-size: 26rem / $pxConvertRem; 122 font-size: 26rem / $pxConvertRem;
116 123
117 - span {  
118 - display: block;  
119 - height: 40rem / $pxConvertRem;  
120 - line-height: 40rem / $pxConvertRem; 124 + .title {
  125 + display: inline-block;
  126 + width: 175rem / $pxConvertRem;
121 } 127 }
122 128
123 - .tip {  
124 - color: #666;  
125 - font-size: 22rem / $pxConvertRem; 129 + .minus {
  130 + float: right;
126 } 131 }
127 } 132 }
128 133
129 - .btn-balance {  
130 - float: right;  
131 - width: 140rem / $pxConvertRem;  
132 - height: 80rem / $pxConvertRem;  
133 - line-height: 80rem / $pxConvertRem;  
134 - text-align: center;  
135 - background: #e01;  
136 - color: #fff;  
137 - border: none;  
138 - font-size: 28rem / $pxConvertRem; 134 + .balance {
  135 + position: fixed;
  136 + box-sizing: border-box;
  137 + bottom: 0;
  138 + width: 100%;
  139 + padding: 20rem / $pxConvertRem;
  140 + height: 120rem / $pxConvertRem;
  141 + border-top: 1px solid #e0e0e0;
  142 + background: #fff;
  143 +
  144 + .iconfont {
  145 + position: absolute;
  146 + top: 50%;
  147 + margin-top: -14rem / $pxConvertRem;
  148 + font-size: 28rem / $pxConvertRem;
  149 + }
  150 +
  151 + p {
  152 + float: left;
  153 + margin-left: 50rem / $pxConvertRem;
  154 + font-size: 26rem / $pxConvertRem;
  155 +
  156 + span {
  157 + display: block;
  158 + height: 40rem / $pxConvertRem;
  159 + line-height: 40rem / $pxConvertRem;
  160 + }
  161 +
  162 + .tip {
  163 + color: #666;
  164 + font-size: 22rem / $pxConvertRem;
  165 + }
  166 + }
  167 +
  168 + .btn-balance {
  169 + float: right;
  170 + width: 140rem / $pxConvertRem;
  171 + height: 80rem / $pxConvertRem;
  172 + line-height: 80rem / $pxConvertRem;
  173 + text-align: center;
  174 + background: #e01;
  175 + color: #fff;
  176 + border: none;
  177 + font-size: 28rem / $pxConvertRem;
  178 + }
139 } 179 }
140 -}  
  180 +}
  1 +{{> layout/header}}
  2 +<div class="gift-advance-page yoho-page">
  3 + {{# shoppingCart}}
  4 + {{#if gift}}
  5 + {{# gift}}
  6 + {{> shopping-cart/gift-advance-good}}
  7 + {{/ gift}}
  8 + {{^}}
  9 + {{# advance}}
  10 + <div class="advance-block">
  11 + <p class="title">{{title}}</p>
  12 + {{# goods}}
  13 + {{> shopping-cart/gift-advance-good}}
  14 + {{/ goods}}
  15 + </div>
  16 + {{/ advance}}
  17 + {{/if}}
  18 + {{/ shoppingCart}}
  19 +</div>
  20 +{{> layout/footer}}
@@ -16,63 +16,32 @@ @@ -16,63 +16,32 @@
16 </ul> 16 </ul>
17 {{/if}} 17 {{/if}}
18 18
19 - <div class="cart-goods">  
20 - {{# goods}}  
21 - {{> shopping-cart/good}}  
22 - {{/ goods}}  
23 - </div>  
24 -  
25 - {{#if freebieOrAdvanceBuy}}  
26 - <ul class="freebie-and-advance-buy">  
27 - {{# freebie}}  
28 - <li class="freebie">  
29 - <span class="iconfont">&#xe620;</span>  
30 - 赠品  
31 - <a href={{url}}>  
32 - <span class="count">{{count}}</span>  
33 - <span class="iconfont icon-right-arrow">&#xe614;</span>  
34 - </a>  
35 - </li>  
36 - {{/ freebie}}  
37 - {{# advanceBuy}}  
38 - <li class="advance-buy">  
39 - <span class="iconfont">&#xe61b;</span>  
40 - 加价购  
41 - <a href={{url}}>  
42 - <span class="count">{{count}}</span>  
43 - <span class="iconfont icon-right-arrow">&#xe614;</span>  
44 - </a>  
45 - </li>  
46 - {{/ advanceBuy}}  
47 - </ul> 19 + {{#if showLoginInfo}}
  20 + <p class="login-info">
  21 + <span class="iconfont">&#xe628;</span>
  22 + 请您先
  23 + <a class="btn btn-login">登录</a>
  24 + 可以同步电脑和手机中的商品
  25 + </p>
48 {{/if}} 26 {{/if}}
49 27
50 - <div class="price-compute">  
51 - <p class="sum-price">  
52 - <span class="title">总价</span>  
53 - {{price}}  
54 - </p>  
55 - <p class="activity-price">  
56 - <span class="title">  
57 - 活动价  
58 - <i class="minus">-</i>  
59 - </span>  
60 - {{activityPrice}}  
61 - </p>  
62 - </div> 28 + {{# commonCart}}
  29 + <div class="cart-content common">
  30 + {{> shopping-cart/cart-content}}
  31 + </div>
  32 + {{/ commonCart}}
  33 +
  34 + {{# preSellCart}}
  35 + <div class="cart-content presell hide">
  36 + <p class="presell-info">
  37 + <span class="iconfont">&#xe61a;</span>
  38 + <span class="txt">预售商品全场包邮,到货后立即发货</span>
  39 + <span class="txt">预售商品不参加活动,不可使用优惠券</span>
  40 + </p>
  41 + {{> shopping-cart/cart-content}}
  42 + </div>
  43 + {{/ preSellCart}}
63 44
64 - <div class="balance">  
65 - <span class="iconfont icon-cb-checked"></span>  
66 - <p>  
67 - <span>  
68 - {{count}}件总计:¥{{sumPrice}}  
69 - </span>  
70 - <span class="tip">(不含运费)</span>  
71 - </p>  
72 - <button class="btn-balance">  
73 - 结算  
74 - </button>  
75 - </div>  
76 {{/ shoppingCart}} 45 {{/ shoppingCart}}
77 </div> 46 </div>
78 {{> layout/footer}} 47 {{> layout/footer}}
1 <script> 1 <script>
2 seajs.use('js/common'); 2 seajs.use('js/common');
3 </script> 3 </script>
  4 +
4 {{!-- 逛(PLUS+STAR) --}} 5 {{!-- 逛(PLUS+STAR) --}}
5 {{#if psList}} 6 {{#if psList}}
6 <script> 7 <script>
@@ -27,6 +28,7 @@ @@ -27,6 +28,7 @@
27 seajs.use('js/guang/detail'); 28 seajs.use('js/guang/detail');
28 </script> 29 </script>
29 {{/if}} 30 {{/if}}
  31 +
30 {{!-- 注册 --}} 32 {{!-- 注册 --}}
31 {{#if regIndex}} 33 {{#if regIndex}}
32 <script> 34 <script>
@@ -43,6 +45,7 @@ @@ -43,6 +45,7 @@
43 seajs.use('js/passport/register/password'); 45 seajs.use('js/passport/register/password');
44 </script> 46 </script>
45 {{/if}} 47 {{/if}}
  48 +
46 {{!-- 登陆 --}} 49 {{!-- 登陆 --}}
47 {{#if loginIndex}} 50 {{#if loginIndex}}
48 <script> 51 <script>
@@ -54,6 +57,7 @@ @@ -54,6 +57,7 @@
54 seajs.use('js/passport/login/international'); 57 seajs.use('js/passport/login/international');
55 </script> 58 </script>
56 {{/if}} 59 {{/if}}
  60 +
57 {{!-- 密码找回 --}} 61 {{!-- 密码找回 --}}
58 {{#if backEmail}} 62 {{#if backEmail}}
59 <script> 63 <script>
@@ -80,6 +84,7 @@ @@ -80,6 +84,7 @@
80 seajs.use('js/passport/back/new-password'); 84 seajs.use('js/passport/back/new-password');
81 </script> 85 </script>
82 {{/if}} 86 {{/if}}
  87 +
83 {{!-- 首页 --}} 88 {{!-- 首页 --}}
84 {{#if grilsHomePage}} 89 {{#if grilsHomePage}}
85 <script> 90 <script>
@@ -101,51 +106,64 @@ @@ -101,51 +106,64 @@
101 seajs.use('js/home/home'); 106 seajs.use('js/home/home');
102 </script> 107 </script>
103 {{/if}} 108 {{/if}}
  109 +
104 {{!-- 新品到着 --}} 110 {{!-- 新品到着 --}}
105 {{#if newArrival}} 111 {{#if newArrival}}
106 <script> 112 <script>
107 seajs.use('js/product/newsale/newarrival'); 113 seajs.use('js/product/newsale/newarrival');
108 </script> 114 </script>
109 {{/if}} 115 {{/if}}
  116 +
110 {{!-- 折扣专区 --}} 117 {{!-- 折扣专区 --}}
111 {{#if discount}} 118 {{#if discount}}
112 <script> 119 <script>
113 seajs.use('js/product/newsale/discount'); 120 seajs.use('js/product/newsale/discount');
114 </script> 121 </script>
115 {{/if}} 122 {{/if}}
  123 +
116 {{!-- 商品列表 --}} 124 {{!-- 商品列表 --}}
117 {{#if goodListPage}} 125 {{#if goodListPage}}
118 <script> 126 <script>
119 seajs.use('js/product/list'); 127 seajs.use('js/product/list');
120 </script> 128 </script>
121 {{/if}} 129 {{/if}}
  130 +
122 {{!-- 商品详情 --}} 131 {{!-- 商品详情 --}}
123 {{#if goodDetail}} 132 {{#if goodDetail}}
124 <script> 133 <script>
125 seajs.use('js/product/detail/detail'); 134 seajs.use('js/product/detail/detail');
126 </script> 135 </script>
127 {{/if}} 136 {{/if}}
  137 +
128 {{!-- 品类 --}} 138 {{!-- 品类 --}}
129 {{#if categoryPage}} 139 {{#if categoryPage}}
130 <script> 140 <script>
131 seajs.use('js/category/index'); 141 seajs.use('js/category/index');
132 </script> 142 </script>
133 {{/if}} 143 {{/if}}
  144 +
134 {{!-- 品牌 --}} 145 {{!-- 品牌 --}}
135 {{#if brandPage}} 146 {{#if brandPage}}
136 <script> 147 <script>
137 seajs.use('js/category/brand'); 148 seajs.use('js/category/brand');
138 </script> 149 </script>
139 {{/if}} 150 {{/if}}
  151 +
140 {{!-- 搜索 --}} 152 {{!-- 搜索 --}}
141 {{#if searchPage}} 153 {{#if searchPage}}
142 <script> 154 <script>
143 seajs.use('js/index/search'); 155 seajs.use('js/index/search');
144 </script> 156 </script>
145 {{/if}} 157 {{/if}}
  158 +
146 {{!-- 购物车 --}} 159 {{!-- 购物车 --}}
147 {{#if shoppingCartPage}} 160 {{#if shoppingCartPage}}
148 <script> 161 <script>
149 - seajs.use('js/shopping-cart/index'); 162 + seajs.use('js/shopping-cart/cart');
  163 +</script>
  164 +{{/if}}
  165 +{{#if giftAdvancePage}}
  166 +<script>
  167 + seajs.use('js/shopping-cart/gift-advance');
150 </script> 168 </script>
151 {{/if}} 169 {{/if}}
  1 +<div class="cart-goods">
  2 + {{# goods}}
  3 + {{> shopping-cart/good}}
  4 + {{/ goods}}
  5 +</div>
  6 +
  7 +{{#if freebieOrAdvanceBuy}}
  8 + <ul class="freebie-and-advance-buy">
  9 + {{# freebie}}
  10 + <li class="freebie">
  11 + <span class="iconfont">&#xe620;</span>
  12 + 赠品
  13 + <a href={{url}}>
  14 + <span class="count">{{count}}</span>
  15 + <span class="iconfont icon-right-arrow">&#xe614;</span>
  16 + </a>
  17 + </li>
  18 + {{/ freebie}}
  19 + {{# advanceBuy}}
  20 + <li class="advance-buy">
  21 + <span class="iconfont">&#xe61b;</span>
  22 + 加价购
  23 + <a href={{url}}>
  24 + <span class="count">{{count}}</span>
  25 + <span class="iconfont icon-right-arrow">&#xe614;</span>
  26 + </a>
  27 + </li>
  28 + {{/ advanceBuy}}
  29 + </ul>
  30 +{{/if}}
  31 +
  32 +<div class="price-compute">
  33 + <p class="sum-price">
  34 + <span class="title">总价</span>
  35 + ¥{{price}}
  36 + </p>
  37 + <p class="activity-price">
  38 + <span class="title">
  39 + 活动价
  40 + <i class="minus">-</i>
  41 + </span>
  42 + ¥{{activityPrice}}
  43 + </p>
  44 +</div>
  45 +
  46 +<div class="balance">
  47 + <span class="iconfont icon-cb-checked"></span>
  48 + <p>
  49 + <span>
  50 + {{count}}件总计:¥{{sumPrice}}
  51 + </span>
  52 + <span class="tip">(不含运费)</span>
  53 + </p>
  54 + <button class="btn-balance">
  55 + 结算
  56 + </button>
  57 + </div>
  1 +<div class="gift-advance-good" data-id={{id}}>
  2 + <div class="thumb-wrap">
  3 + <img class="thumb lazy" data-original={{thumb}}>
  4 + <p class="tag"></p>
  5 + </div>
  6 + <div class="deps">
  7 + <p class="name row">{{name}}</p>
  8 + <p class="row">
  9 + {{#if color}}
  10 + <span class="color">
  11 + 颜色:{{color}}
  12 + </span>
  13 + {{/if}}
  14 +
  15 + {{#if size}}
  16 + <span class="size">
  17 + 尺码:{{size}}
  18 + </span>
  19 + {{/if}}
  20 + </p>
  21 + <p class="row">
  22 + <span class="price">
  23 + ¥{{price}}
  24 + </span>
  25 + <span class="count">
  26 + ×{{count}}
  27 + </span>
  28 + </p>
  29 + <button class="chose">选择</button>
  30 + </div>
  31 +</div>
@@ -57,37 +57,6 @@ class SearchController extends AbstractAction @@ -57,37 +57,6 @@ class SearchController extends AbstractAction
57 57
58 $result = SearchData::searchFuzzyDatas($keyword); 58 $result = SearchData::searchFuzzyDatas($keyword);
59 59
60 - $this->_view->display('list', array('searchPage' => true, 'pageFooter' => true));  
61 - }  
62 - }  
63 -  
64 - /**  
65 - * 根据指定字符串查询数据  
66 - *  
67 - * @return array 搜索的结果  
68 - */  
69 - public function listsearch()  
70 - {  
71 - $query = $this->get('query', '');  
72 -  
73 - $result = SearchData::searchLiDatas($query);  
74 -  
75 - $this->echoJson($result);  
76 - }  
77 -  
78 - /**  
79 - * 根据指定条件筛选查询到数据  
80 - *  
81 - * @return array 筛选之后的结果  
82 - */  
83 - public function sortsearch()  
84 - {  
85 - if($this->isAjax())  
86 - {  
87 - $query = $this->post('query', '');  
88 -  
89 - $result = SearchData::searchLiDatas($query);  
90 -  
91 $this->echoJson($result); 60 $this->echoJson($result);
92 } 61 }
93 } 62 }
@@ -13,47 +13,120 @@ class ShoppingCartController extends AbstractAction @@ -13,47 +13,120 @@ class ShoppingCartController extends AbstractAction
13 'cartNav' => true, 13 'cartNav' => true,
14 'commonGoodsCount' => 2, 14 'commonGoodsCount' => 2,
15 'presellGoodsCount' => 2, 15 'presellGoodsCount' => 2,
16 - 'goods' => array(  
17 - array(  
18 - 'id' => 1,  
19 - 'name' => '黄伟文Wyman X y yohood 联名商品YYYOHOOD圆领卫衣',  
20 - 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90',  
21 - 'color' => '黄色',  
22 - 'size' => 'F',  
23 - 'appearDate' => '12月',  
24 - 'price' => 399.00,  
25 - 'count' => 8,  
26 - 'lowStocks' => true 16 + 'showLoginInfo' => true,
  17 + 'commonCart' => array(
  18 + 'goods' => array(
  19 + array(
  20 + 'id' => 1,
  21 + 'name' => '黄伟文Wyman X y yohood 联名商品YYYOHOOD圆领卫衣',
  22 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90',
  23 + 'color' => '黄色',
  24 + 'size' => 'F',
  25 + 'appearDate' => '12月',
  26 + 'price' => 399.00,
  27 + 'count' => 8,
  28 + 'lowStocks' => true
  29 + ),
  30 + array(
  31 + 'id' => 2,
  32 + 'name' => 'TYAKSHA圣诞树凭借三角领蓝色白条毛衣',
  33 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/03/10/01bc1878f9154e77ac4f7a6003c954f1b8.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  34 + 'color' => '黄色',
  35 + 'size' => 'F',
  36 + 'price' => 553.00,
  37 + 'count' => 1,
  38 + 'soldOut' => true
  39 + )
27 ), 40 ),
28 - array(  
29 - 'id' => 2,  
30 - 'name' => 'TYAKSHA圣诞树凭借三角领蓝色白条毛衣',  
31 - 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/03/10/01bc1878f9154e77ac4f7a6003c954f1b8.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',  
32 - 'color' => '黄色',  
33 - 'size' => 'F',  
34 - 'price' => 553.00,  
35 - 'count' => 1,  
36 - 'soldOut' => true  
37 - )  
38 - ),  
39 - 'freebieOrAdvanceBuy' => true,  
40 - 'freebie' => array(  
41 - 'url' => '',  
42 - 'count' => 2  
43 - ),  
44 - 'advanceBuy' => array(  
45 - 'url' => '',  
46 - 'count' => 3 41 + 'freebieOrAdvanceBuy' => true,
  42 + 'freebie' => array(
  43 + 'url' => '',
  44 + 'count' => 2
  45 + ),
  46 + 'advanceBuy' => array(
  47 + 'url' => '',
  48 + 'count' => 3
  49 + ),
  50 + 'price' => 3192,
  51 + 'activityPrice' => 0,
  52 + 'count' => 8,
  53 + 'sumPrice' => 3192
47 ), 54 ),
48 - 'price' => 3192,  
49 - 'activityPrice' => 0,  
50 - 'count' => 8,  
51 - 'sumPrice' => 3192 55 + 'preSellCart' => array(
  56 + 'goods' => array(
  57 + array(
  58 + 'id' => 2,
  59 + 'name' => 'TYAKSHA圣诞树凭借三角领蓝色白条毛衣',
  60 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/03/10/01bc1878f9154e77ac4f7a6003c954f1b8.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  61 + 'color' => '黄色',
  62 + 'size' => 'F',
  63 + 'price' => 553.00,
  64 + 'count' => 1,
  65 + 'soldOut' => true
  66 + )
  67 + ),
  68 + 'freebieOrAdvanceBuy' => true,
  69 + 'freebie' => array(
  70 + 'url' => '',
  71 + 'count' => 2
  72 + ),
  73 + 'advanceBuy' => array(
  74 + 'url' => '',
  75 + 'count' => 3
  76 + ),
  77 + 'price' => 553,
  78 + 'activityPrice' => 0,
  79 + 'count' => 1,
  80 + 'sumPrice' => 553
  81 + )
52 ); 82 );
53 // 渲染模板 83 // 渲染模板
54 $this->_view->display('index', array('shoppingCartPage' => true, 'pageHeader' => array( 84 $this->_view->display('index', array('shoppingCartPage' => true, 'pageHeader' => array(
55 'navBack' => 'http://m.yohobuy.com', 'navTitle' => '购物车'), 'shoppingCart' => $data)); 85 'navBack' => 'http://m.yohobuy.com', 'navTitle' => '购物车'), 'shoppingCart' => $data));
56 } 86 }
  87 +
  88 + public function giftAdvanceAction()
  89 + {
  90 + $data = array(
  91 + 'advance' => array(
  92 + array(
  93 + 'title' => '【izzue】加¥19购袜子',
  94 + 'goods' => array(
  95 + 'id' => 1,
  96 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90',
  97 + 'name' => 'Life.After.Life纯棉短袜',
  98 + 'salePrice' => 19,
  99 + 'price' => 99
  100 + )
  101 + ),
  102 + array(
  103 + 'title' => '【银鳞堂】加¥9购手绳',
  104 + 'goods' => array(
  105 + 'id' => 1,
  106 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/03/10/01bc1878f9154e77ac4f7a6003c954f1b8.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  107 + 'name' => '银鳞堂民族风牛皮手绳',
  108 + 'salePrice' => 9,
  109 + 'price' => 19
  110 + )
  111 + )
  112 + )
  113 + );
  114 +
  115 + // $data = array(
  116 + // 'gift' => array(
  117 + // 'id' => 1,
  118 + // 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90',
  119 + // 'name' => 'Life.After.Life纯棉短袜',
  120 + // 'color' => '黄色',
  121 + // 'size' => 'L',
  122 + // 'price' => 0,
  123 + // 'count' => 1
  124 + // )
  125 + // );
  126 +
  127 + $this->_view->display('gift-advance', array('giftAdvancePage' => true, 'pageHeader' => array(
  128 + 'navBack' => true, 'navTitle' => '加价购'), 'shoppingCart' => $data));
  129 + }
57 130
58 /** 131 /**
59 * 读取chose-panel内容 132 * 读取chose-panel内容
  1 +<?php
  2 +
  3 +namespace Category;
  4 +
  5 +use LibModels\Wap\Category\ClassData;
  6 +use Configs\CacheConfig;
  7 +use Plugin\Helpers;
  8 +use Plugin\Cache;
  9 +
  10 +/**
  11 + * 品牌相关的模板数据模型
  12 + *
  13 + * @name BrandModel
  14 + * @package Models/Category
  15 + * @copyright yoho.inc
  16 + * @version 1.0 (2015-10-21 13:52:44)
  17 + * @author fei.hong <fei.hong@yoho.cn>
  18 + */
  19 +class ClassModel
  20 +{
  21 +
  22 + /**
  23 + * 根据频道获取品牌一览数据
  24 + *
  25 + * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
  26 + * @return array
  27 + */
  28 + public static function getClassData()
  29 + {
  30 + $classes = array();
  31 +
  32 + if (USE_CACHE) {
  33 + // 先尝试获取一级缓存(master), 有数据则直接返回.
  34 + $result = Cache::get(CacheConfig::KEY_CATEGORY_CLASSES_DATA, 'master');
  35 + if (!empty($result)) {
  36 + return $result;
  37 + }
  38 + }
  39 +
  40 + do {
  41 + $num = 1;
  42 + $data = ClassData::getClassesData();
  43 +
  44 + if(!isset($data['code']) || $data['code'] !== 200)
  45 + {
  46 + break;
  47 + }
  48 +
  49 + if(!isset($data['data']))
  50 + {
  51 + break;
  52 + }
  53 +
  54 + foreach ($data['data'] as $k => $v){
  55 + $oneClass = array('name'=>$k, 'ca'=>array());
  56 + if($num === 1)
  57 + {
  58 + $oneClass['focus'] = true;
  59 + }
  60 +
  61 + foreach ($v as $val) {
  62 + $item = array();
  63 + $item['name'] = $val['category_name'];
  64 + $item['id'] = $val['relation_parameter']['sort'];
  65 + foreach ($val['sub'] as $value) {
  66 + $subitem = array();
  67 + $subitem['name'] = $value['category_name'];
  68 + $subitem['id'] = $value['relation_parameter']['sort'];
  69 + $subitem['url'] = $value['category_id'];
  70 +
  71 + $item['sub'][] = $subitem;
  72 + }
  73 +
  74 + $oneClass['ca'][] = $item;
  75 + }
  76 +
  77 + $num++;
  78 + $classes[] = $oneClass;
  79 + }
  80 +
  81 + if (USE_CACHE) {
  82 + // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
  83 + if (empty($classes)) {
  84 + $classes = Cache::get(CacheConfig::KEY_CATEGORY_CLASSES_DATA, 'slave');
  85 + }
  86 + // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
  87 + else {
  88 + Cache::set(CacheConfig::KEY_CATEGORY_CLASSES_DATA, $classes);
  89 + }
  90 + }
  91 +
  92 + }while(false);
  93 +
  94 + return $classes;
  95 + }
  96 +
  97 +
  98 + /**
  99 + * 返回品类构成的数组
  100 + *
  101 + * @return array 键为品类查询sort参数,值为品类名称构成的数组
  102 + */
  103 + public static function getClassesArr()
  104 + {
  105 + $classes = array();
  106 + $classesData = self::getClassData();
  107 +
  108 + foreach ($classesData as $val) {
  109 + foreach ($val['ca'] as $single) {
  110 + $classes[$single['id']] = $single['name'];
  111 + $classes += self::array_column($single['sub'], 'name', 'id');
  112 + }
  113 + }
  114 +
  115 + return $classes;
  116 + }
  117 +
  118 +
  119 + /**
  120 + * 自定义array_column函数
  121 + *
  122 + * @return array 返回数组中指定的一列组成的数组
  123 + */
  124 + /**
  125 + * 自定义array_column函数
  126 + * @param array $input 需要取出数组咧的多维数组
  127 + * @param string $columnKey 需要返回的列
  128 + * @param mixed $indexKey 作为返回数组的索引值
  129 + * @return array 从多维数组中返回单列数组
  130 + */
  131 + private static function array_column(array $input, $columnKey, $indexKey = null)
  132 + {
  133 + $array = array();
  134 + foreach ($input as $value) {
  135 + if ( ! isset($value[$columnKey])) {
  136 + trigger_error("Key \"$columnKey\" does not exist in array");
  137 + return false;
  138 + }
  139 + if (is_null($indexKey)) {
  140 + $array[] = $value[$columnKey];
  141 + }
  142 + else {
  143 + if ( ! isset($value[$indexKey])) {
  144 + trigger_error("Key \"$indexKey\" does not exist in array");
  145 + return false;
  146 + }
  147 + if ( ! is_scalar($value[$indexKey])) {
  148 + trigger_error("Key \"$indexKey\" does not contain scalar value");
  149 + return false;
  150 + }
  151 + $array[$value[$indexKey]] = $value[$columnKey];
  152 + }
  153 + }
  154 + return $array;
  155 +
  156 + }
  157 +
  158 +}
@@ -18,44 +18,43 @@ use Plugin\Helpers; @@ -18,44 +18,43 @@ use Plugin\Helpers;
18 */ 18 */
19 class NewsaleModel 19 class NewsaleModel
20 { 20 {
21 -  
22 - /* 获取新品到着顶部焦点图的位置码 */  
23 - const CODE_FOCUS_NEW = 'a7989369aa86681c678bc40f171b8f1d';  
24 - /* 获取折扣专区顶部焦点图的位置码 */  
25 - const CODE_FOCUS_SALE = 'e9c9be32d72e2906d404a72ee24cb523'; 21 + /* 男生频道取新品到着及折扣专区数据的位置码 */
  22 + const CODE_TOP_NEW_BOYS = 'a7989369aa86681c678bc40f171b8f1d';
  23 + const CODE_TOP_SALE_BOYS = 'e9c9be32d72e2906d404a72ee24cb523';
  24 + /* 女生频道取新品到着及折扣专区数据的位置码 */
  25 + const CODE_TOP_NEW_GIRLS = 'b0ba12104cfecacdcfd7ad74117a22b8';
  26 + const CODE_TOP_SALE_GIRLS = '785c0e6aab746949073c4ffb9d5106ac';
  27 + /* 潮童频道取新品到着及折扣专区数据的位置码 */
  28 + const CODE_TOP_NEW_KIDS = 'c39607aa21219117976848819cf81a69';
  29 + const CODE_TOP_SALE_KIDS = 'ad1bb67a6007819c86f737d74172fd2e';
  30 + /* 创意生活频道取新品到着及折扣专区数据的位置码 */
  31 + const CODE_TOP_NEW_LIFESTYLE = '7c9ae01071f7a75d3911782feb4caebd';
  32 + const CODE_TOP_SALE_LIFESTYLE = '8132c7db3adbeb7b0d0002de9691c753';
26 33
27 /** 34 /**
28 * 获取新品到着的焦点图资源数据 35 * 获取新品到着的焦点图资源数据
29 * 36 *
30 * @return array 37 * @return array
31 */ 38 */
32 - public static function getNewFocus() 39 + public static function getNewFocus($channel)
33 { 40 {
34 $result = array(); 41 $result = array();
35 42
36 - if (USE_CACHE) {  
37 - // 先尝试获取一级缓存(master), 有数据则直接返回.  
38 - $result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, 'master');  
39 - if (!empty($result)) {  
40 - return $result;  
41 - }  
42 - }  
43 -  
44 - // 调用接口获取数据并封装  
45 - $newsale = NewsaleData::getNewsaleFocus(self::CODE_FOCUS_NEW);  
46 - if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {  
47 - $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);  
48 - } 43 + /* 根据频道调用接口 */
  44 + switch (intval($channel)) {
  45 + case 1: // 男生
  46 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, self::CODE_TOP_NEW_BOYS);
49 47
50 - if (USE_CACHE) {  
51 - // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.  
52 - if (empty($result)) {  
53 - $result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, 'slave');  
54 - }  
55 - // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存  
56 - else {  
57 - Cache::set(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, $result);  
58 - } 48 + break;
  49 + case 2: // 女生
  50 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS, self::CODE_TOP_NEW_GIRLS);
  51 + break;
  52 + case 3: // 潮童
  53 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_KIDS, self::CODE_TOP_NEW_KIDS);
  54 + break;
  55 + case 4: // 创意生活
  56 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_LIFESTYLE, self::CODE_TOP_NEW_LIFESTYLE);
  57 + break;
59 } 58 }
60 59
61 return $result; 60 return $result;
@@ -70,29 +69,20 @@ class NewsaleModel @@ -70,29 +69,20 @@ class NewsaleModel
70 { 69 {
71 $result = array(); 70 $result = array();
72 71
73 - if (USE_CACHE) {  
74 - // 先尝试获取一级缓存(master), 有数据则直接返回.  
75 - $result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, 'master');  
76 - if (!empty($result)) {  
77 - return $result;  
78 - }  
79 - }  
80 -  
81 - // 调用接口获取数据并封装  
82 - $newsale = NewsaleData::getNewsaleFocus(self::CODE_FOCUS_SALE);  
83 - if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {  
84 - $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);  
85 - }  
86 -  
87 - if (USE_CACHE) {  
88 - // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.  
89 - if (empty($result)) {  
90 - $result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, 'slave');  
91 - }  
92 - // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存  
93 - else {  
94 - Cache::set(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, $result);  
95 - } 72 + /* 根据频道调用接口 */
  73 + switch (intval($channel)) {
  74 + case 1: // 男生
  75 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_BOYS, self::CODE_TOP_SALE_BOYS);
  76 + break;
  77 + case 2: // 女生
  78 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS, self::CODE_TOP_SALE_GIRLS);
  79 + break;
  80 + case 3: // 潮童
  81 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS, self::CODE_TOP_SALE_KIDS);
  82 + break;
  83 + case 4: // 创意生活
  84 + $result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE, self::CODE_TOP_SALE_LIFESTYLE);
  85 + break;
96 } 86 }
97 87
98 return $result; 88 return $result;
@@ -134,6 +124,7 @@ class NewsaleModel @@ -134,6 +124,7 @@ class NewsaleModel
134 return $result; 124 return $result;
135 } 125 }
136 126
  127 +
137 /** 128 /**
138 * 获取折扣专区的商品列表 129 * 获取折扣专区的商品列表
139 * 130 *
@@ -170,4 +161,59 @@ class NewsaleModel @@ -170,4 +161,59 @@ class NewsaleModel
170 return $result; 161 return $result;
171 } 162 }
172 163
  164 +
  165 + /**
  166 + * 顶部焦点图缓存控制
  167 + * @param const $cacheKey 缓存常量值
  168 + * @param const $codeKey 顶部焦点图位置码
  169 + * @return array 焦点图数据
  170 + */
  171 + private static function cacheControl($cacheKey, $codeKey)
  172 + {
  173 + if (USE_CACHE) {
  174 + // 先尝试获取一级缓存(master), 有数据则直接返回.
  175 + $result = Cache::get($cacheKey, 'master');
  176 + if (!empty($result)) {
  177 + return $result;
  178 + }
  179 + }
  180 + $newsale = NewsaleData::getNewsaleFocus($codeKey);
  181 +
  182 + // 调用接口获取数据并封装
  183 + if (isset($newsale['code']) && isset($newsale['data'][0]['data'][0])) {
  184 + $result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
  185 + }
  186 +
  187 + if (USE_CACHE) {
  188 + // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
  189 + if (empty($result)) {
  190 + $result = Cache::get(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, 'slave');
  191 + }
  192 + // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
  193 + else {
  194 + Cache::set(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, $result);
  195 + }
  196 + }
  197 +
  198 + return $result;
  199 + }
  200 +
  201 + /**
  202 + * 筛选出来的商品数据处理
  203 + *
  204 + * @param array $data 筛选出来的原数据
  205 + * @return array 处理之后的数据
  206 + */
  207 + public static function selectData($data)
  208 + {
  209 + $result = array('goods' => array());
  210 +
  211 + if (isset($data['code']) && $data['code'] === 200) {
  212 + foreach ($data['data']['product_list'] as $val) {
  213 + $result['goods'][] = Helpers::formatProduct($val);
  214 + }
  215 + }
  216 +
  217 + return $result;
  218 + }
173 } 219 }
1 <?php 1 <?php
2 use Action\AbstractAction; 2 use Action\AbstractAction;
3 -use LibModels\Wap\Category\ClassData;  
4 -use Plugin\DataProcess\ClassProcess; 3 +use Category\ClassModel;
5 4
6 /** 5 /**
7 * 品类 6 * 品类
@@ -10,13 +9,7 @@ class ClassController extends AbstractAction @@ -10,13 +9,7 @@ class ClassController extends AbstractAction
10 { 9 {
11 public function indexAction() 10 public function indexAction()
12 { 11 {
13 - $brandsData = ClassData::getClassesData();  
14 -  
15 - $classes = array();  
16 - if($brandsData['code'] == 200)  
17 - {  
18 - $classes = ClassProcess::getClassData($brandsData['data']);  
19 - } 12 + $classes = ClassModel::getClassData();
20 13
21 $data = array( 14 $data = array(
22 "searchUrl" => "", 15 "searchUrl" => "",
@@ -4,6 +4,7 @@ use Action\AbstractAction; @@ -4,6 +4,7 @@ use Action\AbstractAction;
4 use LibModels\Wap\Product\SearchData; 4 use LibModels\Wap\Product\SearchData;
5 use LibModels\Wap\Category\BrandData; 5 use LibModels\Wap\Category\BrandData;
6 use LibModels\Wap\Category\ClassData; 6 use LibModels\Wap\Category\ClassData;
  7 +use Category\ClassModel;
7 use Plugin\DataProcess\ListProcess; 8 use Plugin\DataProcess\ListProcess;
8 use Plugin\Helpers; 9 use Plugin\Helpers;
9 10
@@ -19,7 +20,7 @@ class ListController extends AbstractAction @@ -19,7 +20,7 @@ class ListController extends AbstractAction
19 { 20 {
20 $query = $this->get('query', null); 21 $query = $this->get('query', null);
21 $brand = $this->get('brand', null); 22 $brand = $this->get('brand', null);
22 - $gender = $this->get('gender', null); 23 + $gender = $this->getCookie('_Channel', 'boys');
23 $p_d = $this->get('p_d', null); 24 $p_d = $this->get('p_d', null);
24 $misort = $this->get('misort', null); 25 $misort = $this->get('misort', null);
25 $msort = $this->get('msort', null); 26 $msort = $this->get('msort', null);
@@ -31,17 +32,35 @@ class ListController extends AbstractAction @@ -31,17 +32,35 @@ class ListController extends AbstractAction
31 'navHome' => '/' 32 'navHome' => '/'
32 ), 33 ),
33 'goodListPage' => true, 34 'goodListPage' => true,
34 - 'goodList' => array() 35 + 'goodList' => array(
  36 + 'brand' => 0,
  37 + 'msort' => 0,
  38 + 'gender' => $gender,
  39 + 'price' => 0,
  40 + 'size' => 0,
  41 + 'discount' => ''
  42 + )
35 ); 43 );
36 44
  45 + // 首先查询是否属于内置品类
  46 + $classes = ClassModel::getClassesArr();
  47 + $classFlag = array_search($query, $classes);
  48 + if($classFlag !== false)// 属于内部品类
  49 + {
  50 + $data['pageHeader']['navTitle'] = '所有'.$query;
  51 + }
  52 +
37 // 如果存在搜索字符串就显示搜索栏 53 // 如果存在搜索字符串就显示搜索栏
38 - if(!is_null($query)) 54 + if(!is_null($query) && $classFlag === false)
39 { 55 {
40 $data['search'] = array( 56 $data['search'] = array(
41 'default' => $query 57 'default' => $query
42 ); 58 );
43 } 59 }
44 60
  61 + // 转换性别
  62 + $this->genderTrans($gender);
  63 +
45 // 查询数据 64 // 查询数据
46 $listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort); 65 $listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort);
47 // 处理返回的数据 66 // 处理返回的数据
@@ -57,9 +76,12 @@ class ListController extends AbstractAction @@ -57,9 +76,12 @@ class ListController extends AbstractAction
57 'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40), 76 'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
58 'name' => $brandData['brand_name'] 77 'name' => $brandData['brand_name']
59 ); 78 );
  79 +
  80 + // 设置品牌默认值
  81 + $data['goodList']['brand'] = $brandData['id'];
60 } 82 }
61 83
62 - $data['goodList'] = ListProcess::getListData($tmpData); 84 + $data['goodList'] += ListProcess::getListData($tmpData);
63 } 85 }
64 86
65 $this->_view->display('index', $data); 87 $this->_view->display('index', $data);
@@ -76,10 +98,16 @@ class ListController extends AbstractAction @@ -76,10 +98,16 @@ class ListController extends AbstractAction
76 $query = $this->get('query', null); 98 $query = $this->get('query', null);
77 $brand = $this->get('brand', null); 99 $brand = $this->get('brand', null);
78 $gender = $this->get('gender', null); 100 $gender = $this->get('gender', null);
79 - $p_d = $this->get('p_d', null);  
80 - $misort = $this->get('misort', null);  
81 - $msort = $this->get('msort', null); 101 + $color = $this->get('color', null);
  102 + $size = $this->get('size', null);
  103 + $price = $this->get('price', null);
  104 + $p_d = $this->get('discount', null);
  105 + $sort = $this->get('msort', null);
  106 +
  107 + // 转换性别
  108 + $this->genderTrans($gender);
82 109
  110 + // 转换排序方式
83 $order = $this->get('order', null); 111 $order = $this->get('order', null);
84 $type = $this->get('type', ''); 112 $type = $this->get('type', '');
85 switch ($type) { 113 switch ($type) {
@@ -97,7 +125,7 @@ class ListController extends AbstractAction @@ -97,7 +125,7 @@ class ListController extends AbstractAction
97 125
98 $data = array(); 126 $data = array();
99 // 查询数据 127 // 查询数据
100 - $listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort, $order); 128 + $listData = SearchData::searchLiDatas($query, $brand, $gender, $color, $size, $price, $p_d, $sort, $order);
101 // 处理返回的数据 129 // 处理返回的数据
102 if (isset($listData['code']) && $listData['code'] === 200) { 130 if (isset($listData['code']) && $listData['code'] === 200) {
103 $tmpData = $listData['data']; 131 $tmpData = $listData['data'];
@@ -124,12 +152,12 @@ class ListController extends AbstractAction @@ -124,12 +152,12 @@ class ListController extends AbstractAction
124 public function brandAction() 152 public function brandAction()
125 { 153 {
126 $brand = $this->get('brand', null); 154 $brand = $this->get('brand', null);
127 - $gender = $this->get('gender', null); 155 + $gender = $this->getCookie('_Channel', 'boys');
128 $sort = $this->get('sort', null); 156 $sort = $this->get('sort', null);
129 $color = $this->get('color', null); 157 $color = $this->get('color', null);
130 $size = $this->get('size', null); 158 $size = $this->get('size', null);
131 $price = $this->get('price', null); 159 $price = $this->get('price', null);
132 - $p_d = $this->get('p_d', null); 160 + $p_d = $this->get('discount', null);
133 161
134 $data = array( 162 $data = array(
135 'pageHeader' => array( 163 'pageHeader' => array(
@@ -138,9 +166,17 @@ class ListController extends AbstractAction @@ -138,9 +166,17 @@ class ListController extends AbstractAction
138 ), 166 ),
139 'goodListPage' => true, 167 'goodListPage' => true,
140 'goodList' => array( 168 'goodList' => array(
141 - 'brand' => array( 169 + 'brandHome' => array(
142 'id' => $brand 170 'id' => $brand
143 - ) 171 + ),
  172 + 'brand' => $brand,
  173 + 'msort' => 0,
  174 + 'gender' => $gender,
  175 + 'sort' => 0,
  176 + 'price' => 0,
  177 + 'size' => 0,
  178 + 'discount' => '',
  179 + 'p_d' => ''
144 ) 180 )
145 ); 181 );
146 182
@@ -148,17 +184,20 @@ class ListController extends AbstractAction @@ -148,17 +184,20 @@ class ListController extends AbstractAction
148 $introData = BrandData::getBrandIntro($brand); 184 $introData = BrandData::getBrandIntro($brand);
149 if(isset($introData['code']) && $introData['code'] === 200) 185 if(isset($introData['code']) && $introData['code'] === 200)
150 { 186 {
151 - $data['goodList']['brand']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : ''; 187 + $data['goodList']['brandHome']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : '';
152 } 188 }
153 189
154 // 获取品牌banner的数据 190 // 获取品牌banner的数据
155 - $bannerData = BrandData::getBrandBanner($brand, 0); 191 + $uid = $this->getUid();
  192 + $bannerData = BrandData::getBrandBanner($brand, $uid);
156 if(isset($bannerData['code']) && $bannerData['code'] === 200) 193 if(isset($bannerData['code']) && $bannerData['code'] === 200)
157 { 194 {
158 - $data['goodList']['brand']['banner'] = isset($bannerData['data']['banner']) ? Helpers::getImageUrl($bannerData['data']['banner'], 640, 75) : ''; 195 + $data['goodList']['brandHome']['banner'] = isset($bannerData['data']['banner']) ? Helpers::getImageUrl($bannerData['data']['banner'], 640, 75) : '';
159 } 196 }
160 197
161 // 查询数据 198 // 查询数据
  199 + // 转换性别
  200 + $this->genderTrans($gender);
162 $listData = BrandData::selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d); 201 $listData = BrandData::selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
163 // 处理返回的数据 202 // 处理返回的数据
164 if (isset($listData['code']) && $listData['code'] === 200) { 203 if (isset($listData['code']) && $listData['code'] === 200) {
@@ -179,12 +218,12 @@ class ListController extends AbstractAction @@ -179,12 +218,12 @@ class ListController extends AbstractAction
179 public function classAction() 218 public function classAction()
180 { 219 {
181 $brand = $this->get('brand', null); 220 $brand = $this->get('brand', null);
182 - $gender = $this->get('gender', null); 221 + $gender = $this->getCookie('_Channel', 'boys');
183 $sort = $this->get('sort', null); 222 $sort = $this->get('sort', null);
184 $color = $this->get('color', null); 223 $color = $this->get('color', null);
185 $size = $this->get('size', null); 224 $size = $this->get('size', null);
186 $price = $this->get('price', null); 225 $price = $this->get('price', null);
187 - $p_d = $this->get('p_d', null); 226 + $p_d = $this->get('discount', null);
188 227
189 $data = array( 228 $data = array(
190 'pageHeader' => array( 229 'pageHeader' => array(
@@ -192,19 +231,55 @@ class ListController extends AbstractAction @@ -192,19 +231,55 @@ class ListController extends AbstractAction
192 'navHome' => '/' 231 'navHome' => '/'
193 ), 232 ),
194 'goodListPage' => true, 233 'goodListPage' => true,
195 - 'goodList' => array() 234 + 'goodList' => array(
  235 + 'brand' => 0,
  236 + 'msort' => 0,
  237 + 'gender' => $gender,
  238 + 'sort' => $sort,
  239 + 'price' => 0,
  240 + 'size' => 0,
  241 + 'discount' => ''
  242 + )
196 ); 243 );
197 244
  245 + // 根据id查询类的名称
  246 + $classes = ClassModel::getClassesArr();
  247 + $data['pageHeader']['navTitle'] = isset($classes[$sort]) ? $classes[$sort] : '';
  248 +
198 // 查询数据 249 // 查询数据
  250 + // 转换性别
  251 + $this->genderTrans($gender);
199 $listData = ClassData::selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d); 252 $listData = ClassData::selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
200 // 处理返回的数据 253 // 处理返回的数据
201 if (isset($listData['code']) && $listData['code'] === 200) { 254 if (isset($listData['code']) && $listData['code'] === 200) {
202 $tmpData = $listData['data']; 255 $tmpData = $listData['data'];
203 256
204 - $data['goodList'] = ListProcess::getListData($tmpData); 257 + $data['goodList'] += ListProcess::getListData($tmpData);
205 } 258 }
206 259
207 $this->_view->display('index', $data); 260 $this->_view->display('index', $data);
208 } 261 }
209 262
  263 +
  264 + /**
  265 + * 性别数据转换
  266 + *
  267 + * @param string &$gender 从cookie中获取的gender值,最后得到转换之后接口调用的值
  268 + */
  269 + private function genderTrans(&$gender)
  270 + {
  271 + if($gender === 'boys')
  272 + {
  273 + $gender = '1,3';
  274 + }
  275 + elseif($gender === 'girls')
  276 + {
  277 + $gender = '2,3';
  278 + }
  279 + else
  280 + {
  281 + $gender = '1,2,3';
  282 + }
  283 + }
  284 +
210 } 285 }
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use LibModels\Wap\Product\NewsaleData; 4 use LibModels\Wap\Product\NewsaleData;
5 -use Plugin\DataProcess\NewSaleProcess; 5 +use Product\NewsaleModel;
6 6
7 /** 7 /**
8 * 新品到着 8 * 新品到着
@@ -27,11 +27,22 @@ class NewsaleController extends AbstractAction @@ -27,11 +27,22 @@ class NewsaleController extends AbstractAction
27 27
28 $data = array(); 28 $data = array();
29 $data['newArrival'] = true; 29 $data['newArrival'] = true;
30 - $data['headerBanner'] = \Product\NewsaleModel::getNewFocus(); 30 + $data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
31 $goodsList = \Product\NewsaleModel::getNewProducts($channel, 20); 31 $goodsList = \Product\NewsaleModel::getNewProducts($channel, 20);
32 if (!empty($goodsList)) { 32 if (!empty($goodsList)) {
33 $data += $goodsList; 33 $data += $goodsList;
34 } 34 }
  35 + // 设置一些筛选的默认参数
  36 + $data += array(
  37 + 'brand' => 0,
  38 + 'sort' => 0,
  39 + 'gender' => $this->getCookie('_Channel', 'boys'),
  40 + 'price' => 0,
  41 + 'size' => 0,
  42 + 'dayLimit' => 1,
  43 + 'discount' => ''
  44 + );
  45 +
35 $this->_view->display('new', $data); 46 $this->_view->display('new', $data);
36 } 47 }
37 48
@@ -52,11 +63,41 @@ class NewsaleController extends AbstractAction @@ -52,11 +63,41 @@ class NewsaleController extends AbstractAction
52 63
53 $data = array(); 64 $data = array();
54 $data['discount'] = true; 65 $data['discount'] = true;
55 - $data['headerBanner'] = \Product\NewsaleModel::getNewFocus(); 66 + $data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
56 $goodsList = \Product\NewsaleModel::getSaleProducts($channel, 20); 67 $goodsList = \Product\NewsaleModel::getSaleProducts($channel, 20);
57 if (!empty($goodsList)) { 68 if (!empty($goodsList)) {
58 $data += $goodsList; 69 $data += $goodsList;
59 } 70 }
  71 + // 设置一些筛选的默认参数
  72 + $data += array(
  73 + 'brand' => 0,
  74 + 'sort' => 0,
  75 + 'gender' => $this->getCookie('_Channel', 'boys'),
  76 + 'price' => 0,
  77 + 'size' => 0,
  78 + 'dayLimit' => 1,
  79 + 'discount' => '0.1,0.3'
  80 + );
  81 + $data['tabs'] = array(
  82 + array(
  83 + 'title' => '1-3折',
  84 + 'dataId' => '0.1,0.3',
  85 + 'focus' => true
  86 + ),
  87 + array(
  88 + 'title' => '4-6折',
  89 + 'dataId' => '0.4,0.6',
  90 + ),
  91 + array(
  92 + 'title' => '7-9折',
  93 + 'dataId' => '0.7,0.9',
  94 + ),
  95 + array(
  96 + 'title' => 'ALL',
  97 + 'dataId' => '0.1,0.9',
  98 + )
  99 + );
  100 +
60 $this->_view->display('sale', $data); 101 $this->_view->display('sale', $data);
61 } 102 }
62 103
@@ -80,11 +121,25 @@ class NewsaleController extends AbstractAction @@ -80,11 +121,25 @@ class NewsaleController extends AbstractAction
80 $limit = $this->get('limit', 20); 121 $limit = $this->get('limit', 20);
81 $page = $this->get('page', 1); 122 $page = $this->get('page', 1);
82 123
  124 + // 转换性别
  125 + if($gender === 'boys')
  126 + {
  127 + $gender = '1,3';
  128 + }
  129 + elseif($gender === 'girls')
  130 + {
  131 + $gender = '2,3';
  132 + }
  133 + else
  134 + {
  135 + $gender = '1,2,3';
  136 + }
  137 +
83 $data = NewsaleData::selectNewSaleProducts( 138 $data = NewsaleData::selectNewSaleProducts(
84 $gender, $brand, $sort, $color, 139 $gender, $brand, $sort, $color,
85 $size, $price, $p_d, $channel, $dayLimit, $limit, $page 140 $size, $price, $p_d, $channel, $dayLimit, $limit, $page
86 ); 141 );
87 - $result = NewSaleProcess::selectData($data); 142 + $result = \Product\NewsaleModel::selectData($data);
88 143
89 $this->_view->display('product', $result); 144 $this->_view->display('product', $result);
90 } else { 145 } else {