Authored by Lynnic

update

Showing 71 changed files with 3259 additions and 411 deletions
@@ -947,18 +947,20 @@ @@ -947,18 +947,20 @@
947 order: { 947 order: {
948 orders: [ 948 orders: [
949 ... 949 ...
950 - ] 950 + ],
  951 + //没有订单的情况不传orders
  952 + walkWayUrl: '' //随便逛逛url
951 } 953 }
952 } 954 }
953 955
954 956
955 //订单 957 //订单
956 { 958 {
  959 + detailUrl: '',
957 orderNum: '', 960 orderNum: '',
958 - tradingStatus: '', 961 + orderStatus: '',
959 goods: [ 962 goods: [
960 { 963 {
961 - id: '',  
962 thumb: '', 964 thumb: '',
963 gift: true, //是否赠品 965 gift: true, //是否赠品
964 advanceBuy: true, //是否加价购 966 advanceBuy: true, //是否加价购
@@ -974,9 +976,52 @@ @@ -974,9 +976,52 @@
974 sumCost: '199.00', 976 sumCost: '199.00',
975 //status 977 //status
976 completed: true, //已完成 978 completed: true, //已完成
  979 + canceled: true, //已取消
977 unpaid: true, //or 未支付 980 unpaid: true, //or 未支付
978 - unshipped: true, //or 未发货  
979 - unreceived: '', //or 未收货,查看物流URL 981 + unreceived: '', //or 待收货(未发货/未收货),查看物流URL
  982 +
  983 + //待收货时传递物流参数
  984 + logisticsUrl: ''
  985 +
  986 + }
  987 +
  988 +### 订单详情页
  989 +
  990 + {
  991 + orderDetail: {
  992 + orderNum: '', //订单号
  993 +
  994 + name: '', //收货人姓名
  995 + phoneNum: '',
  996 + address: '',
  997 +
  998 + orderStatus: '订单成功', //订单取消...等订单状态
  999 + orderNum: '',
  1000 + orderTime: '',
  1001 +
  1002 + //订单状态
  1003 + canceled: true, //是否是取消的订单
  1004 + completed: true, //是否是已完成订单
  1005 + unpaid: true, //是否是未支付订单
  1006 + unreceived: true, //是否是未收货订单
  1007 +
  1008 + //如果是待收货(未发货和未收货),传物流信息参数
  1009 + logisticsUrl: '',
  1010 + logisticsCompany: '',
  1011 + logisticsNum: '',
  1012 + //end
  1013 +
  1014 + goods: [
  1015 + {
  1016 + ... //订单商品
  1017 + }
  1018 + ],
  1019 + sumPrice: '',
  1020 + salePrice: '',
  1021 + freight: '',
  1022 + yohoCoin: '',
  1023 + price: ''
  1024 + }
980 } 1025 }
981 1026
982 ### YOHO币 1027 ### YOHO币
framework @ 75bbc3b0
1 -Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -18,14 +18,15 @@ class Yohobuy @@ -18,14 +18,15 @@ class Yohobuy
18 { 18 {
19 19
20 /* 正式环境 */ 20 /* 正式环境 */
21 - // const API_URL = 'http://api2.open.yohobuy.com/';  
22 - // const SERVICE_URL = 'http://service.api.yohobuy.com/';  
23 - // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 21 + const API_URL = 'http://api2.open.yohobuy.com/';
  22 + const API_URL2 = 'http://api.open.yohobuy.com/';
  23 + const SERVICE_URL = 'http://service.api.yohobuy.com/';
  24 + const YOHOBUY_URL = 'http://www.yohobuy.com/';
24 25
25 /* 测试环境 */ 26 /* 测试环境 */
26 - const API_URL = 'http://test2.open.yohobuy.com/';  
27 - const SERVICE_URL = 'http://test.service.api.yohobuy.com/';  
28 - const YOHOBUY_URL = 'http://www.yohobuy.com/'; 27 +// const API_URL = 'http://test2.open.yohobuy.com/';
  28 +// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
  29 +// const YOHOBUY_URL = 'http://www.yohobuy.com/';
29 30
30 /** 31 /**
31 * 私钥列表 32 * 私钥列表
@@ -42,5 +42,6 @@ class CacheConfig @@ -42,5 +42,6 @@ class CacheConfig
42 const KEY_ACTION_HOME_PREFERENTIAL = 'key_action_home_preferential';//会员特权详情 42 const KEY_ACTION_HOME_PREFERENTIAL = 'key_action_home_preferential';//会员特权详情
43 const KEY_ACTION_GUANG_PLUSTAR_DATA = 'key_action_guang_plustar_data'; // 逛PLUSTAR 43 const KEY_ACTION_GUANG_PLUSTAR_DATA = 'key_action_guang_plustar_data'; // 逛PLUSTAR
44 const KEY_ACTION_GUANG_DETAIL_DATA = 'key_action_guang_detail_data'; // 逛内容详情 44 const KEY_ACTION_GUANG_DETAIL_DATA = 'key_action_guang_detail_data'; // 逛内容详情
  45 + const KEY_ACTION_HOME_ORDER_ORDER = 'key_action_home_order_order';//订单列表
45 46
46 } 47 }
@@ -15,17 +15,30 @@ class GradeData @@ -15,17 +15,30 @@ class GradeData
15 /** 15 /**
16 * 获取会员等级数据 16 * 获取会员等级数据
17 * @param string $yh_channel 频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他 17 * @param string $yh_channel 频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他
  18 + * @param strint $gender 用户性别
18 * @param string $uid 用户id 19 * @param string $uid 用户id
19 * @return array 接口返回的会员等级数据 20 * @return array 接口返回的会员等级数据
20 */ 21 */
21 - public function getGradeData($channel, $uid) {  
22 - 22 + public function getGradeData($gender, $channel, $uid) {
  23 + $urlList = array();
  24 + //获取会员等级数据
23 $param = Yohobuy::param(); 25 $param = Yohobuy::param();
24 $param['yh_channel'] = $channel; 26 $param['yh_channel'] = $channel;
25 $param['uid'] = $uid; 27 $param['uid'] = $uid;
26 $param['method'] = 'app.Passport.vip'; 28 $param['method'] = 'app.Passport.vip';
27 $param['client_secret'] = Sign::getSign($param); 29 $param['client_secret'] = Sign::getSign($param);
28 - return Yohobuy::get(Yohobuy::API_URL, $param); 30 + $urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
  31 +
  32 + //获取用户基本信息数据(用来得到username)
  33 + $param = Yohobuy::param();
  34 + $param['gender'] = $gender;
  35 + $param['uid'] = $uid;
  36 + $param['yh_channel'] = $channel;
  37 + $param['method'] = 'app.passport.profile';
  38 + $param['client_secret'] = Sign::getSign($param);
  39 + $urlList['userProfile'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
  40 +
  41 + return Yohobuy::getMulti($urlList);
29 } 42 }
30 43
31 /** 44 /**
@@ -44,18 +57,4 @@ class GradeData @@ -44,18 +57,4 @@ class GradeData
44 return Yohobuy::get(Yohobuy::API_URL, $param); 57 return Yohobuy::get(Yohobuy::API_URL, $param);
45 } 58 }
46 59
47 - /**  
48 - * 获取用户基本信息数据  
49 - */  
50 - public function getUserProfileData($gender, $uid, $channel) {  
51 - $param = Yohobuy::param();  
52 - $param['gender'] = $gender;  
53 - $param['uid'] = $uid;  
54 - $param['yh_channel'] = $channel;  
55 - $param['method'] = 'app.passport.profile';  
56 - $param['client_secret'] = Sign::getSign($param);  
57 -  
58 - return Yohobuy::get("http://api.open.yohobuy.com/",$param);  
59 - }  
60 -  
61 } 60 }
  1 +<?php
  2 +
  3 +namespace LibModels\Wap\Home;
  4 +
  5 +use Api\Sign;
  6 +use Api\Yohobuy;
  7 +
  8 +/**
  9 + * 在线客服数据模型
  10 + *
  11 + * @name OnlineData
  12 + * @package LibModels/Wap/Home
  13 + * @copyright yoho.inc
  14 + * @version 1.0 (2015-11-13)
  15 + * @author xiaowei
  16 + */
  17 +class OnlineData
  18 +{
  19 + const ONLINE_URI = 'operations/api/v1/help/';
  20 +
  21 + //获取帮助列表(分类)
  22 + public static function getOnlineServiceInfo($clientType='iphone')
  23 + {
  24 + return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getCategory', array('client_type'=>$clientType));
  25 + }
  26 +
  27 + //获取问题详情
  28 + public static function getOnlineServiceDetail($cateId, $clientType = 'iphone')
  29 + {
  30 + return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getHelp', array('category_id'=>$cateId,'client_type'=>$clientType));
  31 + }
  32 +
  33 +}
  1 +<?php
  2 +
  3 +namespace LibModels\Wap\Home;
  4 +
  5 +use Api\Yohobuy;
  6 +use Api\Sign;
  7 +
  8 +/*
  9 + * To change this license header, choose License Headers in Project Properties.
  10 + * To change this template file, choose Tools | Templates
  11 + * and open the template in the editor.
  12 + */
  13 +
  14 +/**
  15 + * Description of OrderData
  16 + *
  17 + * @author Administrator
  18 + */
  19 +class OrderData
  20 +{
  21 + /*
  22 + * 获取订单数据
  23 + * To change this template file, choose Tools | Templates
  24 + * and open the template in the editor.
  25 + */
  26 +
  27 + public function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
  28 + //构建必传参数
  29 + $param = Yohobuy::param();
  30 + $param['gender'] = $gender;
  31 + $param['limit'] = $limit;
  32 + $param['method'] = 'app.SpaceOrders.get';
  33 + $param['page'] = $page;
  34 + $param['type'] = $type;
  35 + $param['uid'] = $uid;
  36 + $param['yh_channel'] = $yh_channel;
  37 + $param['client_secret'] = Sign::getSign($param);
  38 + //调用接口获得数据
  39 + return Yohobuy::get(Yohobuy::API_URL2, $param);
  40 + }
  41 +
  42 +}
@@ -161,7 +161,7 @@ class UserData @@ -161,7 +161,7 @@ class UserData
161 public static function couponData($uid, $status, $page = 1, $limit = 10) 161 public static function couponData($uid, $status, $page = 1, $limit = 10)
162 { 162 {
163 $param = Yohobuy::param(); 163 $param = Yohobuy::param();
164 - $param['method'] = 'app.yohocoin.lists'; 164 + $param['method'] = 'app.coupons.li';
165 $param['uid'] = $uid; 165 $param['uid'] = $uid;
166 $param['status'] = $status; 166 $param['status'] = $status;
167 $param['page'] = $page; 167 $param['page'] = $page;
@@ -188,6 +188,76 @@ class UserData @@ -188,6 +188,76 @@ class UserData
188 } 188 }
189 189
190 /** 190 /**
  191 + * 获取三级地址列表数据
  192 + *
  193 + * @param int $uid 用户ID
  194 + * @return array 地址接口返回的数据
  195 + */
  196 + public static function addressListData($uid)
  197 + {
  198 + $param = Yohobuy::param();
  199 + $param['method'] = 'app.address.getlist';
  200 + $param['uid'] = $uid;
  201 + $param['client_secret'] = Sign::getSign($param);
  202 +
  203 + return Yohobuy::get(Yohobuy::API_URL, $param);
  204 + }
  205 +
  206 + /**
  207 + * 保存地址数据
  208 + *
  209 + * @param int $uid 用户ID
  210 + * @param string $address 地址信息
  211 + * @param int $area_code 城市码
  212 + * @param string $consignee 收货人
  213 + * @param string $email 邮箱地址
  214 + * @param int $id 地址唯一标识符id
  215 + * @param string $mobile 手机号码
  216 + * @param string $zip_code 邮编
  217 + * @return array 地址接口返回的数据
  218 + */
  219 + public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
  220 + {
  221 + $param = Yohobuy::param();
  222 + $param['address'] = $address;
  223 + $param['area_code'] = $area_code;
  224 + $param['consignee'] = $consignee;
  225 + $param['email'] = $email;
  226 +
  227 + if ($id !== null) { // 修改
  228 + $param['id'] = $id;
  229 + $param['method'] = 'app.address.update';
  230 + } else { // 添加
  231 + $param['method'] = 'app.address.add';
  232 + }
  233 +
  234 + $param['mobile'] = $mobile;
  235 + $param['zip_code'] = $zip_code;
  236 + $param['uid'] = $uid;
  237 + $param['client_secret'] = Sign::getSign($param);
  238 +
  239 + return Yohobuy::get(Yohobuy::API_URL, $param);
  240 + }
  241 +
  242 + /**
  243 + * 设置默认地址
  244 + *
  245 + * @param int $uid 用户ID
  246 + * @param int $id 地址唯一标识符id
  247 + * @return array 接口返回的数据
  248 + */
  249 + public static function setDefaultAddress($uid, $id)
  250 + {
  251 + $param = Yohobuy::param();
  252 + $param['id'] = $id;
  253 + $param['method'] = 'app.address.setdefault';
  254 + $param['uid'] = $uid;
  255 + $param['client_secret'] = Sign::getSign($param);
  256 +
  257 + return Yohobuy::get(Yohobuy::API_URL, $param);
  258 + }
  259 +
  260 + /**
191 * 意见反馈数据 261 * 意见反馈数据
192 * 262 *
193 * @param string $udid 客户端唯一标识 263 * @param string $udid 客户端唯一标识
@@ -298,7 +298,12 @@ class FloorProcess @@ -298,7 +298,12 @@ class FloorProcess
298 $one['img'] = Helpers::getImageUrl($one['src'], 640, 403); 298 $one['img'] = Helpers::getImageUrl($one['src'], 640, 403);
299 unset($one['src']); 299 unset($one['src']);
300 } 300 }
301 - $result['big_image']['list'] = $data['big_image']; 301 +
  302 + // 区别多张图与一张图
  303 + if (count($data['big_image']) > 1) {
  304 + $result['big_image']['list'] = $data['big_image'];
  305 + unset($data['big_image']);
  306 + }
302 307
303 foreach ($data['list'] as $kk => &$one) { 308 foreach ($data['list'] as $kk => &$one) {
304 if ($kk == 0) { 309 if ($kk == 0) {
@@ -318,8 +323,6 @@ class FloorProcess @@ -318,8 +323,6 @@ class FloorProcess
318 $data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']); 323 $data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
319 } 324 }
320 325
321 - unset($data['big_image']);  
322 -  
323 $result['goodsCategory'] = $data; 326 $result['goodsCategory'] = $data;
324 327
325 return $result; 328 return $result;
@@ -50,4 +50,47 @@ class NewSaleProcess @@ -50,4 +50,47 @@ class NewSaleProcess
50 return $result; 50 return $result;
51 } 51 }
52 52
  53 + /**
  54 + * 处理热销排行榜数据
  55 + *
  56 + * @param array $products 接口传回的数据
  57 + * @param boolean $notab 是否传回tab数据
  58 + * @param int $limit 查询返回的最大限制数
  59 + * @param int $page 分页第几页
  60 + * @return array 处理之后的数据
  61 + */
  62 + public static function topData($products, $notab, $limit, $page)
  63 + {
  64 + $result = array();
  65 +
  66 + // 处理Tabs
  67 + if (!$notab && isset($products['tabs'])) {
  68 + $result['tabs'] = array();
  69 + foreach ($products['tabs'] as $key => $one) {
  70 + $tabItem = array();
  71 + $tabItem['title'] = $one;
  72 + $tabItem['dataId'] = $key;
  73 + if ($key === 1) {
  74 + $tabItem['focus'] = true;
  75 + }
  76 + $result['tabs'][] = $tabItem;
  77 + }
  78 + }
  79 +
  80 + // 处理商品
  81 + if (isset($products['product_list'])) {
  82 +
  83 + $count = count($products['product_list']);
  84 + $one = array();
  85 + foreach ($products['product_list'] as $key => $single) {
  86 + $one = Helpers::formatProduct($single, true, false, false, 75, 114);
  87 + $one['rank'] = $limit * ($page -1) + $key + 1;
  88 +
  89 + $result['goods'][] = $one;
  90 + }
  91 + }
  92 +
  93 + return $result;
  94 + }
  95 +
53 } 96 }
@@ -14,6 +14,7 @@ fonts_dir = "font" @@ -14,6 +14,7 @@ fonts_dir = "font"
14 output_style = :expanded 14 output_style = :expanded
15 # To enable relative paths to assets via compass helper functions. Uncomment: 15 # To enable relative paths to assets via compass helper functions. Uncomment:
16 relative_assets = true 16 relative_assets = true
  17 +sourcemap = true
17 18
18 # To disable debugging comments that display the original location of your selectors. Uncomment: 19 # To disable debugging comments that display the original location of your selectors. Uncomment:
19 line_comments = false 20 line_comments = false
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 Nov 12 16:17:15 2015 5 +Created by FontForge 20120731 at Mon Nov 16 18:08:15 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 Nov 12 16:17:15 2015 @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Nov 12 16:17:15 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-E62F" 22 + unicode-range="U+0078-E63E"
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" />
@@ -179,5 +179,73 @@ q0 -66 47 -112.5t113.5 -46.5t113.5 46.5t47 112.5z" /> @@ -179,5 +179,73 @@ q0 -66 47 -112.5t113.5 -46.5t113.5 46.5t47 112.5z" />
179 d="M474 28v161h-167v50h167v74h-167v49h134l-168 265h87l152 -257v386q-48 0 -96.5 4t-83.5 10.5t-63.5 12.5t-42.5 10l-14 4q-2 -43 -16.5 -74t-34 -44t-38.5 -20t-33 -7h-13q0 -110 10.5 -203.5t20.5 -131.5l10 -38q15 -61 45 -120.5t65.5 -105.5t75.5 -87.5t76 -70.5 179 d="M474 28v161h-167v50h167v74h-167v49h134l-168 265h87l152 -257v386q-48 0 -96.5 4t-83.5 10.5t-63.5 12.5t-42.5 10l-14 4q-2 -43 -16.5 -74t-34 -44t-38.5 -20t-33 -7h-13q0 -110 10.5 -203.5t20.5 -131.5l10 -38q15 -61 45 -120.5t65.5 -105.5t75.5 -87.5t76 -70.5
180 t66.5 -50.5t47.5 -31.5t18 -10v225h-38zM550 28v161h167v50h-167v74h167v49h-134l168 265h-87l-152 -257v386q35 0 70.5 2t64 6t55.5 8.5t46.5 8.5t34 8t22.5 6l7 2q2 -43 16.5 -74t34 -44t38.5 -20t33 -7h13q0 -110 -10.5 -203.5t-20.5 -131.5l-10 -38q-15 -61 -45 -120.5 180 t66.5 -50.5t47.5 -31.5t18 -10v225h-38zM550 28v161h167v50h-167v74h167v49h-134l168 265h-87l-152 -257v386q35 0 70.5 2t64 6t55.5 8.5t46.5 8.5t34 8t22.5 6l7 2q2 -43 16.5 -74t34 -44t38.5 -20t33 -7h13q0 -110 -10.5 -203.5t-20.5 -131.5l-10 -38q-15 -61 -45 -120.5
181 t-65.5 -105.5t-75.5 -87.5t-76 -70.5t-66.5 -50.5t-47.5 -31.5t-18 -10v225h38z" /> 181 t-65.5 -105.5t-75.5 -87.5t-76 -70.5t-66.5 -50.5t-47.5 -31.5t-18 -10v225h38z" />
  182 + <glyph glyph-name="uniE630" unicode="&#xe630;"
  183 +d="M629 -71h-268v20q0 31 -21.5 53t-52.5 22t-52.5 -22t-21.5 -53v-20h-174v609h590v-609zM400 -30h188v527h-508v-527h94q7 41 39 68t74 27t74 -27t39 -68zM989 -71h-136v20q0 21 -10 38t-27 27t-37 10q-31 0 -52.5 -22t-21.5 -53v-20h-117v476h210q22 0 57 -34
  184 +q27 -26 58 -67q31 -40 52 -75q14 -25 19 -39t5 -23v-238zM892 -30h56v197q0 9 -18 40t-46 68q-7 9 -14 17.5t-13.5 16.5t-13 15t-12.5 14q-10 9 -18 16t-11 8.5t-5 1.5h-168v-394h37q7 41 39 68t74 27q28 0 52 -12.5t40.5 -34t20.5 -48.5zM989 137h-287v193h191l6 -8
  185 +q35 -43 61 -84q29 -48 29 -71v-30zM743 178h202q-6 15 -21 39q-21 34 -50 72h-131v-111zM779.5 -166q-47.5 0 -81.5 34t-34 81.5t34 81.5t81 34q24 0 45 -9.5t36.5 -25t24.5 -36.5t9 -45q0 -47 -33.5 -81t-81 -34zM779 24q-31 0 -52.5 -22t-21.5 -53q0 -15 6 -28.5t16 -23.5
  186 +t23.5 -16t28.5 -6q12 0 23.5 4t20.5 10.5t16 16t10.5 20.5t3.5 23q0 21 -10 38t-27 27t-37 10zM287 -166q-48 0 -81.5 34t-33.5 81.5t33.5 81.5t81.5 34t81.5 -34t33.5 -81.5t-33.5 -81.5t-81.5 -34zM287 24q-31 0 -52.5 -22t-21.5 -52.5t21.5 -52.5t52.5 -22t52.5 22
  187 +t21.5 52.5t-21.5 52.5t-52.5 22z" />
  188 + <glyph glyph-name="uniE631" unicode="&#xe631;"
  189 +d="M24 799zM47 799zM70 799zM94 799zM117 799zM140 799zM163 799zM187 799zM210 799zM233 799zM256 799zM280 799zM303 799zM326 799zM349 799zM373 799zM396 799zM419 799zM442 799zM466 799zM489 799zM512 799zM535 799zM558 799zM582 799zM605 799zM628 799zM651 799z
  190 +M675 799zM698 799zM721 799zM744 799zM768 799zM791 799zM814 799zM837 799zM861 799zM884 799zM907 799zM930 799zM954 799zM977 799zM1000 799zM1 776zM1 753zM1 730zM1 706zM1 683zM1 660zM1 637zM1 613zM1 590zM1 567zM1 544zM1 520zM1 497zM1 474zM1 451zM1 427zM1 404
  191 +zM1 381zM1 358zM1 334zM1 311zM1 288zM1 265zM1 242zM1 218zM1 195zM1 172zM1 149zM1 125zM1 102zM1 79zM1 56zM1 32zM1 9zM1 -14zM1 -37zM1 -61zM1 -84zM1 -107zM1 -130zM1 -154zM1 -177zM1 -200zM512 -223q-7 8 -18.5 22t-45.5 59t-64.5 91t-68 113.5t-64.5 131.5
  192 +t-45.5 139t-18.5 141q0 52 11 96.5t30 75.5t43 56.5t51 41t54 27t51.5 17t43.5 8.5t30 3h11q7 0 18.5 -0.5t45.5 -7t64.5 -17.5t68 -35.5t64.5 -57.5t45.5 -87t18.5 -120t-18 -140.5t-46.5 -140.5t-63 -130t-69.5 -114.5t-63.5 -90t-46.5 -60.5zM740 517q-16 85 -86 140
  193 +q-1 1 -4 3.5t-5 3.5q-5 4 -22 13l-4 2q-2 1 -3.5 2t-3.5 2l-4 2l-4 2q-1 0 -20 7q-2 0 -7.5 2t-9 3.5t-7.5 1.5q-24 5 -48 5v0q-24 0 -47 -5q-15 -3 -29.5 -8t-27.5 -11.5t-25 -14.5h-1q-12 -9 -27 -23q-2 -1 -5 -4l-3 -3q-2 -2 -4.5 -5t-4 -4.5t-4 -5t-3.5 -4.5
  194 +q-12 -16 -13 -17q-2 -3 -4.5 -7.5t-3.5 -5.5q0 -1 -1 -2q-2 -4 -3 -6.5t-3 -6t-3.5 -6.5t-2.5 -6q-1 -2 -2 -7q-1 -3 -2 -4q-7 -21 -9 -32q-4 -22 -4 -44q0 -183 175 -470l57 -88q9 13 25 36.5t56 92t70.5 133.5t55.5 148t25 148q0 11 -1 21.5t-3 21.5zM373 474
  195 +q0 58 40.5 98.5t98.5 40.5t98.5 -40.5t40.5 -98.5t-40.5 -99t-98.5 -41q-28 0 -54 11.5t-44.5 30t-29.5 44.5t-11 54z" />
  196 + <glyph glyph-name="uniE632" unicode="&#xe632;"
  197 +d="M313 163h397v69h-397v-69zM313 26h397v68h-397v-68zM611 747h-430q-4 0 -7 -0.5t-6 -2t-6 -3.5t-5 -4t-4 -5t-3 -6t-1.5 -6.5t-0.5 -6.5v-825q0 -5 1.5 -10.5t4.5 -9.5t7 -7.5t9 -5t11 -1.5h661q9 0 17 4.5t12.5 12.5t4.5 17v619zM644 626l131 -119h-131v119zM809 -77
  198 +h-595v755h364v-206q0 -14 9.5 -24t23.5 -10h198v-515zM313 300h397v69h-397v-69z" />
  199 + <glyph glyph-name="uniE633" unicode="&#xe633;" horiz-adv-x="1304"
  200 +d="M1303 454l-161 242h-304v-443h233q12 0 23 6.5t17 17t6 23.5q0 8 -2.5 15t-6.5 12.5t-10 10t-13 7t-14 2.5h-140v256h161l118 -177v-242h-442v577q0 14 -7 25.5t-18.5 18.5t-25.5 7h-666q-21 0 -36 -15t-15 -36v-620q0 -21 15 -35.5t36 -14.5h142q-30 -49 -30 -105
  201 +q0 -82 58 -140t140 -58t140 58t58 140q0 28 -8 54.5t-23 50.5h363q-30 -49 -30 -105q0 -82 58 -140t140 -58t140 58t58 140q0 56 -31 105h77v363zM93 719h582v-535h-582v535zM465 -14q0 -43 -30.5 -74t-74 -31t-74 31t-30.5 74t30.5 74t74 31t74 -31t30.5 -74zM1164 -14
  202 +q0 -29 -14 -53t-38.5 -38t-52.5 -14q-43 0 -74 31t-31 74t31 74t74 31t74 -31t31 -74z" />
  203 + <glyph glyph-name="uniE634" unicode="&#xe634;" horiz-adv-x="1476"
  204 +d="M1403 812h-1331q-14 0 -27.5 -5.5t-23.5 -15.5t-15.5 -23.5t-5.5 -27.5v-880q0 -30 21 -51t51 -21h1331q30 0 51.5 21t21.5 51v880q0 19 -10 36t-26.5 26.5t-36.5 9.5zM120 692h1235v-151h-1235v151zM120 330h1235v-422h-1235v422zM211 210h572v-61h-572v61zM211 89h331
  205 +v-60h-331v60z" />
  206 + <glyph glyph-name="uniE635" unicode="&#xe635;"
  207 +d="M512 797q-102 0 -194.5 -39.5t-160 -106.5t-107 -160t-39.5 -195q0 -68 18 -133t50.5 -119.5t78.5 -101t101 -79t120 -50.5t133 -18q102 0 194.5 40t160 107t107 160t39.5 194q0 82 -25.5 158.5t-71.5 138t-108 108t-138 71.5t-158 25zM512 -118q-112 0 -207.5 55.5
  208 +t-151 151t-55.5 207.5q0 84 33 161t88.5 132.5t132 88t160.5 32.5q112 0 207.5 -55.5t151 -150.5t55.5 -207.5t-55.5 -208t-151 -151t-207.5 -55.5zM512 471q25 0 43 -18t18 -44h87q0 50 -29 89t-75 53v50q0 6 -3 11t-8 8t-11 3h-44q-9 0 -15.5 -6.5t-6.5 -15.5v-50
  209 +q-22 -7 -41.5 -20.5t-33.5 -32t-21.5 -41.5t-7.5 -48q0 -104 133 -154q27 -9 44 -20t23 -22t7.5 -16.5t1.5 -13.5q0 -25 -18 -43t-43 -18q-17 0 -31 8.5t-22 22.5t-8 30h-87q0 -73 59 -118q21 -16 45 -24v-50q0 -9 6.5 -15t15.5 -6h44q6 0 11 2.5t8 7.5t3 11v50q46 15 75 54
  210 +t29 88q0 105 -133 154q-18 7 -32 14.5t-22 14.5t-13 13t-6.5 12.5t-2 10t-0.5 7.5q0 26 18 44t43 18z" />
  211 + <glyph glyph-name="uniE636" unicode="&#xe636;"
  212 +d="M947 675h-892q-23 0 -39 -16t-16 -38v-642q0 -23 16 -39t39 -16h892q22 0 38 16t16 39v642q0 15 -7 27.5t-19.5 19.5t-27.5 7zM836 584l-335 -260l-336 260h671zM91 16v511l376 -293q4 -3 8 -5t8 -3.5t8.5 -2t9.5 -0.5q18 0 33 11l376 293v-511h-819z" />
  213 + <glyph glyph-name="uniE637" unicode="&#xe637;"
  214 +d="M512 572q-31 0 -59 -12t-48.5 -32.5t-32.5 -48.5t-12 -59q0 -63 44.5 -107.5t107.5 -44.5q31 0 59 12t48.5 32.5t32.5 48.5t12 59q0 63 -44.5 107.5t-107.5 44.5zM512 796q-149 0 -257 -103q-107 -100 -117 -245q-1 -14 -1 -28q0 -56 36 -137.5t81 -151t104 -146.5
  215 +t85 -107t44 -50l25 -28l25 28q18 20 44 50t85 107t104 146.5t81 151t36 137.5q0 76 -29.5 145.5t-80 120t-120 80.5t-145.5 30zM512 -97q-46 54 -93.5 115.5t-98.5 137t-83 147t-32 117.5q0 127 90 217t217 90t217 -90t90 -217q0 -46 -32 -117.5t-83 -147t-98.5 -137
  216 +t-93.5 -115.5z" />
  217 + <glyph glyph-name="uniE638" unicode="&#xe638;" horiz-adv-x="1335"
  218 +d="M1273 -88h-1179q-26 0 -44 -18t-18 -44t18 -44t44 -18h1179q17 0 31 8.5t22.5 22.5t8.5 31t-8.5 31.5t-22.5 22.5t-31 8zM841 657h429q27 0 46 18t19 44t-19 44t-46 18h-429q-27 0 -46 -18t-19 -44q0 -10 3.5 -19.5t9.5 -17t14 -13.5t17.5 -9t20.5 -3zM841 230h429
  219 +q27 0 46 18t19 44q0 17 -8.5 31.5t-23.5 22.5t-33 8h-429q-13 0 -25 -5t-20.5 -13t-14 -19.5t-5.5 -24t5.5 -24t14 -20t20.5 -13.5t25 -5zM85 230h434q26 0 44 18t18 44v435q0 17 -8 31t-22.5 22.5t-31.5 8.5h-434q-26 0 -44 -18.5t-18 -43.5v-435q0 -25 18 -43.5t44 -18.5z
  220 +M147 665h310v-311h-310v311z" />
  221 + <glyph glyph-name="uniE639" unicode="&#xe639;"
  222 +d="M507 811q-81 0 -157.5 -25.5t-138 -72t-108 -108t-72 -138t-25.5 -157.5q0 -185 121 -326q115 -134 287 -167q47 -8 93 -9q46 0 90.5 8.5t85 23.5t78 37t70 49.5t60 60t49.5 70t37 78t23.5 85t8.5 90.5q0 101 -40 194t-107 160t-160 107t-195 40zM507 -104
  223 +q-112 0 -207.5 55.5t-150.5 150.5t-55 207.5t55 208t150.5 151t207.5 55.5q68 0 131 -21t114 -59.5t89.5 -89.5t59 -114t20.5 -130q0 -113 -55.5 -208t-150.5 -150.5t-208 -55.5zM506 605h-1h-1q-67 0 -115 -47q-48 -48 -48 -116q0 -9 3 -17t9 -14t14 -9.5t17 -3.5t17 3.5
  224 +t14 9.5t9.5 14t3.5 17q0 32 22 54q22 21 55 22q10 0 19.5 -3t17.5 -8t15 -12t12 -15t8 -17.5t3 -19.5q1 -24 -12 -43t-34 -29q-22 -9 -39 -26t-26 -39.5t-9 -47.5v-36q0 -18 13 -30.5t31 -12.5t31 12.5t13 30.5v36q0 24 20 33q46 20 73 61.5t26 91.5q-1 66 -48 113t-113 48z
  225 +M504 135q-23 0 -39 -16t-16 -38q0 -5 1 -10t3 -9.5t4 -8.5t5 -7.5t6.5 -6.5t8 -5.5t8.5 -4t9 -2.5t10 -1q23 0 38.5 16t15.5 39q0 9 -2.5 17t-7.5 15t-12 12t-15 7.5t-17 2.5z" />
  226 + <glyph glyph-name="uniE63A" unicode="&#xe63a;"
  227 +d="M964 376q14 1 25 8t17.5 18.5t6.5 25.5v147q0 14 -7 26t-19 19t-26 7h-898q-10 0 -20 -4t-17 -11t-11 -17t-4 -20v-147q0 -21 14 -36t35 -16q29 -2 49.5 -24t20.5 -52t-20.5 -52t-49.5 -24q-21 -1 -35 -16t-14 -36v-147q0 -21 15.5 -36.5t36.5 -15.5h898q21 0 36.5 15.5
  228 +t15.5 36.5v147q0 21 -14 36t-35 16q-19 2 -35.5 12.5t-25.5 27t-9 36.5q0 15 5.5 28.5t15 23.5t22.5 16.5t27 7.5zM926 143v-83h-828v83q52 15 85.5 58.5t33.5 98.5t-33.5 98.5t-85.5 58.5v83h283v-66h66v66h479v-83q-52 -15 -85.5 -58.5t-33.5 -98.5t33.5 -98.5t85.5 -58.5
  229 +zM381 278h66v-109h-66v109zM381 431h66v-109h-66v109zM381 126h66v-66h-66v66z" />
  230 + <glyph glyph-name="uniE63B" unicode="&#xe63b;" horiz-adv-x="1199"
  231 +d="M1149 812h-1099q-21 0 -35.5 -14.5t-14.5 -35.5v-350q0 -20 14.5 -35t35.5 -15h1099q13 0 24.5 7t18.5 18.5t7 24.5v350q0 21 -14.5 35.5t-35.5 14.5zM100 712h999v-250h-999v250zM1024 312q-21 0 -35.5 -14.5t-14.5 -34.5v-375h-749v375q0 20 -14.5 34.5t-35.5 14.5
  232 +t-35.5 -14.5t-14.5 -34.5v-425q0 -21 14.5 -35.5t35.5 -14.5h849q10 0 19.5 4t16 10.5t10.5 16t4 19.5v425q0 20 -14.5 34.5t-35.5 14.5zM325 312q-10 0 -19.5 -3.5t-16 -10.5t-10.5 -16t-4 -19v-200q0 -33 30 -46q10 -4 20 -4h549q21 0 35.5 14.5t14.5 35.5v200
  233 +q0 20 -14.5 34.5t-35.5 14.5t-35.5 -14.5t-14.5 -34.5v-150h-449v150q0 32 -30 45q-10 4 -20 4z" />
  234 + <glyph glyph-name="uniE63C" unicode="&#xe63c;" horiz-adv-x="1048"
  235 +d="M298 437q-21 0 -35.5 -14.5t-14.5 -35.5t14.5 -35.5t35.5 -14.5q13 0 24.5 7t18.5 18.5t7 25t-7 25t-18.5 18t-24.5 6.5zM953 -55q95 93 95 215t-94 214q0 2 0.5 7t1 9t0.5 7q0 111 -64 205t-174.5 148.5t-239.5 54.5q-97 0 -185.5 -32.5t-152.5 -87t-102 -130
  236 +t-38 -158.5q0 -78 33 -148.5t93 -125.5l-77 -123q-8 -12 -6.5 -26t10.5 -25l5 -5q2 -2 4.5 -3.5t5 -2.5t5.5 -2t6 -1.5t6 -0.5q9 0 18 4l180 80q4 2 7 4q20 -7 39 -12q48 -80 138.5 -128t199.5 -48q38 0 74.5 6t70.5 19q1 -1 2 -1l140 -62q2 -2 5 -2l6 -2h6q20 0 32 15
  237 +q10 10 11 24t-7 26zM286 160q0 -17 2 -35v1q-35 16 -64.5 38t-53 48t-40.5 55.5t-26 62.5t-9 67q0 85 51.5 157t139.5 114t192 42q142 0 249.5 -76.5t128.5 -189.5q-43 21 -91 32t-98 11q-39 0 -77 -6.5t-71.5 -19t-64.5 -30.5t-56.5 -40t-46.5 -48.5t-35.5 -55.5t-22 -61
  238 +t-7.5 -66zM381 160q0 63 38.5 116.5t104 84.5t143.5 31q118 0 202 -68t84 -164q0 -62 -38.5 -115.5t-104.5 -84.5t-143 -31q-118 0 -202 68t-84 163zM527 191q-16 0 -27.5 -11t-11.5 -27q0 -11 5.5 -20t14.5 -14t19 -5q16 0 27.5 11.5t11.5 27.5t-11.5 27t-27.5 11zM667 191
  239 +q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5q10 0 19 5t14.5 14t5.5 20q0 7 -3.5 14.5t-8.5 12.5t-12 8t-15 3zM806 191q-16 0 -27 -11t-11 -27t11 -27.5t27 -11.5t27.5 11.5t11.5 27.5q0 7 -3 14.5t-8 12.5t-12.5 8t-15.5 3z" />
  240 + <glyph glyph-name="uniE63E" unicode="&#xe63e;"
  241 +d="M521 317zM768 -178h-1h-1h-1h-1h-1h-1h-1h-1h-1h-1h-1q-11 1 -23 2h-1h-1h-1h-1h-1l-1 1h-1h-1h-1h-1h-1h-1h-1l-1 1h-1h-1h-1h-1h-1l-1 1h-1h-1h-1h-1h-1h-1l-1 1h-1h-1h-1h-1l-1 1h-1h-1h-1h-1l-1 1h-1h-1h-1h-1l-1 1h-1h-1h-1l-1 1h-1h-1h-1h-1l-1 1h-1h-1l-1 1h-1h-1
  242 +h-1h-1l-1 1h-1h-1h-1l-1 1h-1h-1h-1l-1 1h-1l-1 1h-1h-1h-1l-1 1h-1h-1h-1l-1 1h-1h-1l-1 1h-1h-1h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1l-1 1h-1h-1l-1 1h-1h-1l-1 1
  243 +h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1h-1l-1 1q-145 72 -277 204.5t-205 277.5q-55 113 -56.5 201t52.5 140q13 13 30 13
  244 +t30 -13q8 -8 11 -19t0 -21.5t-11 -19.5q-32 -32 -26.5 -98t47.5 -149q68 -137 187.5 -256.5t256.5 -187.5q83 -42 149 -47.5t98 26.5q13 13 30 13t30 -13t13 -30t-13 -30q-54 -47 -141 -47zM333 355q-26 0 -39 26q-9 16 -4 32.5t21 23.5l99 46q15 8 26 23t8 33q0 13 -17 30
  245 +l-141 145q-10 9 -24.5 12.5t-31.5 0.5q-12 -7 -25 -13l-68 -73q-9 -8 -19.5 -11t-21.5 0t-19 11q-13 13 -13 30t13 30l68 68q28 28 60 34q80 20 141 -34l140 -140q4 -4 7 -8l6 -8q3 -4 6 -8.5t5 -8.5l4 -10q2 -4 4 -9l2 -10q2 -5 3 -10l2 -10q1 -8 1 -16.5t-1 -16.5
  246 +t-3.5 -16.5t-5.5 -16.5t-7.5 -15.5t-10 -15t-11.5 -14t-13 -12.5t-14.5 -11.5t-15.5 -10.5l-98 -47q0 2 -2.5 2t-6 -1t-4.5 -1zM875 -139q-10 0 -17 3t-13 9q-13 13 -13 30t13 30l68 68q13 13 13 26q7 35 -13 55l-141 141q-4 4 -30 17q-12 2 -23.5 -2t-19.5 -12.5t-12 -19.5
  247 +l-47 -98q-3 -6 -7 -11t-10 -8t-12.5 -4t-13 0.5t-12.5 5.5q-8 3 -13.5 9t-8 13.5t-1.5 16.5t5 16l47 99q23 42 62 64.5t83 16.5q45 -7 77 -39l141 -141q29 -28 38 -65t-4 -75q-17 -43 -34 -60l-72 -73q-5 -4 -9.5 -7t-9.5 -4t-11 -1zM602 87q-4 0 -9 1.5t-8 2.5t-9 4
  248 +q-77 58 -154 128q-76 77 -128 154q-9 12 -6 29.5t19 30.5q6 3 13 5t13.5 2t13 -2t11.5 -5.5t9 -8.5q15 -21 27 -36.5t27.5 -35t32 -37t32.5 -32.5q14 -12 21 -18.5t19.5 -17.5t20.5 -18t19.5 -17t20.5 -17.5t19.5 -15.5t20.5 -15q11 -7 16 -17t3 -21.5t-10 -21.5
  249 +q-6 -21 -34 -21z" />
182 </font> 250 </font>
183 </defs></svg> 251 </defs></svg>
No preview for this file type
No preview for this file type
@@ -148,7 +148,7 @@ function rePosFooter() { @@ -148,7 +148,7 @@ function rePosFooter() {
148 window._ozuid = uid;//暴露ozuid 148 window._ozuid = uid;//暴露ozuid
149 149
150 if (window._yas) { 150 if (window._yas) {
151 - window._yas(1 * new Date(), '1.0.12', 'yohobuy_m', uid, ''); 151 + window._yas(1 * new Date(), '1.0.13', 'yohobuy_m', uid, '');
152 } 152 }
153 }()); 153 }());
154 154
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
5 */ 5 */
6 6
7 require('./order'); 7 require('./order');
  8 +require('./order-detail');
8 require('./fav'); 9 require('./fav');
9 require('./index'); 10 require('./index');
10 -require('./coupons');  
  11 +require('./coupons');
  12 +require('./online-service');
@@ -6,8 +6,10 @@ @@ -6,8 +6,10 @@
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 Hammer = require('yoho.hammer'), 8 Hammer = require('yoho.hammer'),
9 - lazyLoad = require('yoho.lazyload'); 9 + lazyLoad = require('yoho.lazyload'),
  10 + Swiper = require('yoho.iswiper');
10 11
  12 +//导航
11 var $navLi = $('#fav-tab > li'), 13 var $navLi = $('#fav-tab > li'),
12 $favContainer = $('.fav-content'); 14 $favContainer = $('.fav-content');
13 15
@@ -15,11 +17,15 @@ var $curContainer = $favContainer.children('.fav-type').first();//保存当前 @@ -15,11 +17,15 @@ var $curContainer = $favContainer.children('.fav-type').first();//保存当前
15 17
16 var favTabHammer; 18 var favTabHammer;
17 19
  20 +//轮播图
  21 +var $swiperList = $('.swiper-container'),
  22 + swiperArray = [],
  23 + swiperObj = {};
  24 +
18 //lazyLoad(); 25 //lazyLoad();
19 26
20 favTabHammer = new Hammer(document.getElementById('fav-tab')); 27 favTabHammer = new Hammer(document.getElementById('fav-tab'));
21 favTabHammer.on('tap', function(e) { 28 favTabHammer.on('tap', function(e) {
22 - console.log(1);  
23 var $cur = $(e.target).closest('li'), 29 var $cur = $(e.target).closest('li'),
24 index; 30 index;
25 31
@@ -34,4 +40,20 @@ favTabHammer.on('tap', function(e) { @@ -34,4 +40,20 @@ favTabHammer.on('tap', function(e) {
34 40
35 $curContainer.addClass('hide'); 41 $curContainer.addClass('hide');
36 $curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide'); 42 $curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide');
  43 +
  44 + if (index === 1) {
  45 + //导航
  46 + for (var i = 0; i < $swiperList.length; i++) {
  47 + var id = $swiperList.eq(i).attr('data-id');
  48 + swiperObj[id] = new Swiper('#swiper-container-' + id, {
  49 + slidesPerView: 'auto',
  50 + grabCursor: true,
  51 + slideElement: 'li',
  52 + wrapperClass: 'swiper-wrapper-' + id,
  53 + lazyLoading: true,
  54 + watchSlidesVisibility: true
  55 + });
  56 + }
  57 +
  58 + }
37 }); 59 });
@@ -4,12 +4,4 @@ @@ -4,12 +4,4 @@
4 * @date: 2015/11/12 4 * @date: 2015/11/12
5 */ 5 */
6 6
7 -var Swiper = require('yoho.iswiper');  
8 -  
9 -var recommendSwiper;  
10 -  
11 -recommendSwiper = new Swiper('.swiper-recommend', {  
12 - lazyLoading: true,  
13 - lazyLoadingInPrevNext: true,  
14 - slidesPerView: 'auto'  
15 -});  
  7 +require('../product/recommend-for-you.js');
  1 +/*
  2 +UploadiFive 1.2.2
  3 +Copyright (c) 2012 Reactive Apps, Ronnie Garcia
  4 +Released under the UploadiFive Standard License <http://www.uploadify.com/uploadifive-standard-license>
  5 +*/
  6 +
  7 +var jQuery = require('jquery');
  8 +
  9 +;(function($) {
  10 +
  11 + var methods = {
  12 +
  13 + init : function(options) {
  14 +
  15 + return this.each(function() {
  16 +
  17 + // Create a reference to the jQuery DOM object
  18 + var $this = $(this);
  19 + $this.data('uploadifive', {
  20 + inputs : {}, // The object that contains all the file inputs
  21 + inputCount : 0, // The total number of file inputs created
  22 + fileID : 0,
  23 + queue : {
  24 + count : 0, // Total number of files in the queue
  25 + selected : 0, // Number of files selected in the last select operation
  26 + replaced : 0, // Number of files replaced in the last select operation
  27 + errors : 0, // Number of files that returned an error in the last select operation
  28 + queued : 0, // Number of files added to the queue in the last select operation
  29 + cancelled : 0 // Total number of files that have been cancelled or removed from the queue
  30 + },
  31 + uploads : {
  32 + current : 0, // Number of files currently being uploaded
  33 + attempts : 0, // Number of file uploads attempted in the last upload operation
  34 + successful : 0, // Number of files successfully uploaded in the last upload operation
  35 + errors : 0, // Number of files returning errors in the last upload operation
  36 + count : 0 // Total number of files uploaded successfully
  37 + }
  38 + });
  39 + var $data = $this.data('uploadifive');
  40 +
  41 + // Set the default options
  42 + var settings = $data.settings = $.extend({
  43 + 'auto' : true, // Automatically upload a file when it's added to the queue
  44 + 'buttonClass' : false, // A class to add to the UploadiFive button
  45 + 'buttonText' : 'Select Files', // The text that appears on the UploadiFive button
  46 + 'checkScript' : false, // Path to the script that checks for existing file names
  47 + 'dnd' : true, // Allow drag and drop into the queue
  48 + 'dropTarget' : false, // Selector for the drop target
  49 + 'fileObjName' : 'Filedata', // The name of the file object to use in your server-side script
  50 + 'fileSizeLimit' : 0, // Maximum allowed size of files to upload
  51 + 'fileType' : false, // Type of files allowed (image, etc), separate with a pipe character |
  52 + 'formData' : {}, // Additional data to send to the upload script
  53 + 'height' : 30, // The height of the button
  54 + 'itemTemplate' : false, // The HTML markup for the item in the queue
  55 + 'method' : 'post', // The method to use when submitting the upload
  56 + 'multi' : true, // Set to true to allow multiple file selections
  57 + 'overrideEvents' : [], // An array of events to override
  58 + 'queueID' : false, // The ID of the file queue
  59 + 'queueSizeLimit' : 0, // The maximum number of files that can be in the queue
  60 + 'removeCompleted' : false, // Set to true to remove files that have completed uploading
  61 + 'simUploadLimit' : 0, // The maximum number of files to upload at once
  62 + 'truncateLength' : 0, // The length to truncate the file names to
  63 + 'uploadLimit' : 0, // The maximum number of files you can upload
  64 + 'uploadScript' : 'uploadifive.php', // The path to the upload script
  65 + 'width' : 100 // The width of the button
  66 +
  67 + /*
  68 + // Events
  69 + 'onAddQueueItem' : function(file) {}, // Triggered for each file that is added to the queue
  70 + 'onCancel' : function(file) {}, // Triggered when a file is cancelled or removed from the queue
  71 + 'onCheck' : function(file, exists) {}, // Triggered when the server is checked for an existing file
  72 + 'onClearQueue' : function(queue) {}, // Triggered during the clearQueue function
  73 + 'onDestroy' : function() {} // Triggered during the destroy function
  74 + 'onDrop' : function(files, numberOfFilesDropped) {}, // Triggered when files are dropped into the file queue
  75 + 'onError' : function(file, fileType, data) {}, // Triggered when an error occurs
  76 + 'onFallback' : function() {}, // Triggered if the HTML5 File API is not supported by the browser
  77 + 'onInit' : function() {}, // Triggered when UploadiFive if initialized
  78 + 'onQueueComplete' : function() {}, // Triggered once when an upload queue is done
  79 + 'onProgress' : function(file, event) {}, // Triggered during each progress update of an upload
  80 + 'onSelect' : function() {}, // Triggered once when files are selected from a dialog box
  81 + 'onUpload' : function(file) {}, // Triggered when an upload queue is started
  82 + 'onUploadComplete' : function(file, data) {}, // Triggered when a file is successfully uploaded
  83 + 'onUploadFile' : function(file) {}, // Triggered for each file being uploaded
  84 + */
  85 + }, options);
  86 +
  87 + // Calculate the file size limit
  88 + if (isNaN(settings.fileSizeLimit)) {
  89 + var fileSizeLimitBytes = parseInt(settings.fileSizeLimit) * 1.024
  90 + if (settings.fileSizeLimit.indexOf('KB') > -1) {
  91 + settings.fileSizeLimit = fileSizeLimitBytes * 1000;
  92 + } else if (settings.fileSizeLimit.indexOf('MB') > -1) {
  93 + settings.fileSizeLimit = fileSizeLimitBytes * 1000000;
  94 + } else if (settings.fileSizeLimit.indexOf('GB') > -1) {
  95 + settings.fileSizeLimit = fileSizeLimitBytes * 1000000000;
  96 + }
  97 + } else {
  98 + settings.fileSizeLimit = settings.fileSizeLimit * 1024;
  99 + }
  100 +
  101 + // Create a template for a file input
  102 + $data.inputTemplate = $('<input type="file">')
  103 + .css({
  104 + 'font-size' : settings.height + 'px',
  105 + 'opacity' : 0,
  106 + 'position' : 'absolute',
  107 + 'right' : '-3px',
  108 + 'top' : '-3px',
  109 + 'z-index' : 999
  110 + });
  111 +
  112 + // Create a new input
  113 + $data.createInput = function() {
  114 +
  115 + // Create a clone of the file input
  116 + var input = $data.inputTemplate.clone();
  117 + // Create a unique name for the input item
  118 + var inputName = input.name = 'input' + $data.inputCount++;
  119 + // Set the multiple attribute
  120 + if (settings.multi) {
  121 + input.attr('multiple', true);
  122 + }
  123 + // Set the accept attribute on the input
  124 + if (settings.fileType) {
  125 + input.attr('accept', settings.fileType);
  126 + }
  127 + // Set the onchange event for the input
  128 + input.bind('change', function() {
  129 + $data.queue.selected = 0;
  130 + $data.queue.replaced = 0;
  131 + $data.queue.errors = 0;
  132 + $data.queue.queued = 0;
  133 + // Add a queue item to the queue for each file
  134 + var limit = this.files.length;
  135 + $data.queue.selected = limit;
  136 + if (($data.queue.count + limit) > settings.queueSizeLimit && settings.queueSizeLimit !== 0) {
  137 + if ($.inArray('onError', settings.overrideEvents) < 0) {
  138 + alert('The maximum number of queue items has been reached (' + settings.queueSizeLimit + '). Please select fewer files.');
  139 + }
  140 + // Trigger the error event
  141 + if (typeof settings.onError === 'function') {
  142 + settings.onError.call($this, 'QUEUE_LIMIT_EXCEEDED');
  143 + }
  144 + } else {
  145 + for (var n = 0; n < limit; n++) {
  146 + file = this.files[n];
  147 + $data.addQueueItem(file);
  148 + }
  149 + $data.inputs[inputName] = this;
  150 + $data.createInput();
  151 + }
  152 + // Upload the file if auto-uploads are enabled
  153 + if (settings.auto) {
  154 + methods.upload.call($this);
  155 + }
  156 + // Trigger the select event
  157 + if (typeof settings.onSelect === 'function') {
  158 + settings.onSelect.call($this, $data.queue);
  159 + }
  160 + });
  161 + // Hide the existing current item and add the new one
  162 + if ($data.currentInput) {
  163 + $data.currentInput.hide();
  164 + }
  165 + $data.button.append(input);
  166 + $data.currentInput = input;
  167 + }
  168 +
  169 + // Remove an input
  170 + $data.destroyInput = function(key) {
  171 + $($data.inputs[key]).remove();
  172 + delete $data.inputs[key];
  173 + $data.inputCount--;
  174 + }
  175 +
  176 + // Drop a file into the queue
  177 + $data.drop = function(e) {
  178 + $data.queue.selected = 0;
  179 + $data.queue.replaced = 0;
  180 + $data.queue.errors = 0;
  181 + $data.queue.queued = 0;
  182 +
  183 + var fileData = e.dataTransfer;
  184 +
  185 + var inputName = fileData.name = 'input' + $data.inputCount++;
  186 + // Add a queue item to the queue for each file
  187 + var limit = fileData.files.length;
  188 + $data.queue.selected = limit;
  189 + if (($data.queue.count + limit) > settings.queueSizeLimit && settings.queueSizeLimit !== 0) {
  190 + // Check if the queueSizeLimit was reached
  191 + if ($.inArray('onError', settings.overrideEvents) < 0) {
  192 + alert('The maximum number of queue items has been reached (' + settings.queueSizeLimit + '). Please select fewer files.');
  193 + }
  194 + // Trigger the onError event
  195 + if (typeof settings.onError === 'function') {
  196 + settings.onError.call($this, 'QUEUE_LIMIT_EXCEEDED');
  197 + }
  198 + } else {
  199 + // Add a queue item for each file
  200 + for (var n = 0; n < limit; n++) {
  201 + file = fileData.files[n];
  202 + $data.addQueueItem(file);
  203 + }
  204 + // Save the data to the inputs object
  205 + $data.inputs[inputName] = fileData;
  206 + }
  207 +
  208 + // Upload the file if auto-uploads are enabled
  209 + if (settings.auto) {
  210 + methods.upload.call($this);
  211 + }
  212 +
  213 + // Trigger the onDrop event
  214 + if (typeof settings.onDrop === 'function') {
  215 + settings.onDrop.call($this, fileData.files, fileData.files.length);
  216 + }
  217 +
  218 + // Stop FireFox from opening the dropped file(s)
  219 + e.preventDefault();
  220 + e.stopPropagation();
  221 + }
  222 +
  223 + // Check if a filename exists in the queue
  224 + $data.fileExistsInQueue = function(file) {
  225 + for (var key in $data.inputs) {
  226 + input = $data.inputs[key];
  227 + limit = input.files.length;
  228 + for (var n = 0; n < limit; n++) {
  229 + existingFile = input.files[n];
  230 + // Check if the filename matches
  231 + if (existingFile.name == file.name && !existingFile.complete) {
  232 + return true;
  233 + }
  234 + }
  235 + }
  236 + return false;
  237 + }
  238 +
  239 + // Remove an existing file in the queue
  240 + $data.removeExistingFile = function(file) {
  241 + for (var key in $data.inputs) {
  242 + input = $data.inputs[key];
  243 + limit = input.files.length;
  244 + for (var n = 0; n < limit; n++) {
  245 + existingFile = input.files[n];
  246 + // Check if the filename matches
  247 + if (existingFile.name == file.name && !existingFile.complete) {
  248 + $data.queue.replaced++;
  249 + methods.cancel.call($this, existingFile, true);
  250 + }
  251 + }
  252 + }
  253 + }
  254 +
  255 + // Create the file item template
  256 + if (settings.itemTemplate == false) {
  257 + $data.queueItem = $('<div class="uploadifive-queue-item">\
  258 + <a class="close" href="#">X</a>\
  259 + <div><span class="filename"></span><span class="fileinfo"></span></div>\
  260 + <div class="progress">\
  261 + <div class="progress-bar"></div>\
  262 + </div>\
  263 + </div>');
  264 + } else {
  265 + $data.queueItem = $(settings.itemTemplate);
  266 + }
  267 +
  268 + // Add an item to the queue
  269 + $data.addQueueItem = function(file) {
  270 + if ($.inArray('onAddQueueItem', settings.overrideEvents) < 0) {
  271 + // Check if the filename already exists in the queue
  272 + $data.removeExistingFile(file);
  273 + // Create a clone of the queue item template
  274 + file.queueItem = $data.queueItem.clone();
  275 + // Add an ID to the queue item
  276 + file.queueItem.attr('id', settings.id + '-file-' + $data.fileID++);
  277 + // Bind the close event to the close button
  278 + file.queueItem.find('.close').bind('click', function() {
  279 + methods.cancel.call($this, file);
  280 + return false;
  281 + });
  282 + var fileName = file.name;
  283 + if (fileName.length > settings.truncateLength && settings.truncateLength != 0) {
  284 + fileName = fileName.substring(0, settings.truncateLength) + '...';
  285 + }
  286 + file.queueItem.find('.filename').html(fileName);
  287 + // Add a reference to the file
  288 + file.queueItem.data('file', file);
  289 + $data.queueEl.append(file.queueItem);
  290 + }
  291 + // Trigger the addQueueItem event
  292 + if (typeof settings.onAddQueueItem === 'function') {
  293 + settings.onAddQueueItem.call($this, file);
  294 + }
  295 + // Check the filesize
  296 + if (file.size > settings.fileSizeLimit && settings.fileSizeLimit != 0) {
  297 + $data.error('FILE_SIZE_LIMIT_EXCEEDED', file);
  298 + } else {
  299 + $data.queue.queued++;
  300 + $data.queue.count++;
  301 + }
  302 + }
  303 +
  304 + // Remove an item from the queue
  305 + $data.removeQueueItem = function(file, instant, delay) {
  306 + // Set the default delay
  307 + if (!delay) delay = 0;
  308 + var fadeTime = instant ? 0 : 500;
  309 + if (file.queueItem) {
  310 + if (file.queueItem.find('.fileinfo').html() != ' - Completed') {
  311 + file.queueItem.find('.fileinfo').html(' - Cancelled');
  312 + }
  313 + file.queueItem.find('.progress-bar').width(0);
  314 + file.queueItem.delay(delay).fadeOut(fadeTime, function() {
  315 + $(this).remove();
  316 + });
  317 + delete file.queueItem;
  318 + $data.queue.count--;
  319 + }
  320 + }
  321 +
  322 + // Count the number of files that need to be uploaded
  323 + $data.filesToUpload = function() {
  324 + var filesToUpload = 0;
  325 + for (var key in $data.inputs) {
  326 + input = $data.inputs[key];
  327 + limit = input.files.length;
  328 + for (var n = 0; n < limit; n++) {
  329 + file = input.files[n];
  330 + if (!file.skip && !file.complete) {
  331 + filesToUpload++;
  332 + }
  333 + }
  334 + }
  335 + return filesToUpload;
  336 + }
  337 +
  338 + // Check if a file exists
  339 + $data.checkExists = function(file) {
  340 + if ($.inArray('onCheck', settings.overrideEvents) < 0) {
  341 + // This request needs to be synchronous
  342 + $.ajaxSetup({
  343 + 'async' : false
  344 + });
  345 + // Send the filename to the check script
  346 + var checkData = $.extend(settings.formData, {filename: file.name});
  347 + $.post(settings.checkScript, checkData, function(fileExists) {
  348 + file.exists = parseInt(fileExists);
  349 + });
  350 + if (file.exists) {
  351 + if (!confirm('A file named ' + file.name + ' already exists in the upload folder.\nWould you like to replace it?')) {
  352 + // If not replacing the file, cancel the upload
  353 + methods.cancel.call($this, file);
  354 + return true;
  355 + }
  356 + }
  357 + }
  358 + // Trigger the check event
  359 + if (typeof settings.onCheck === 'function') {
  360 + settings.onCheck.call($this, file, file.exists);
  361 + }
  362 + return false;
  363 + }
  364 +
  365 + // Upload a single file
  366 + $data.uploadFile = function(file, uploadAll) {
  367 + if (!file.skip && !file.complete && !file.uploading) {
  368 + file.uploading = true;
  369 + $data.uploads.current++;
  370 + $data.uploads.attempted++;
  371 +
  372 + // Create a new AJAX request
  373 + xhr = file.xhr = new XMLHttpRequest();
  374 +
  375 + // Start the upload
  376 + // Use the faster FormData if it exists
  377 + if (typeof FormData === 'function' || typeof FormData === 'object') {
  378 +
  379 + // Create a new FormData object
  380 + var formData = new FormData();
  381 +
  382 + // Add the form data
  383 + formData.append(settings.fileObjName, file);
  384 +
  385 + // Add the rest of the formData
  386 + for (i in settings.formData) {
  387 + formData.append(i, settings.formData[i]);
  388 + }
  389 +
  390 + // Open the AJAX call
  391 + xhr.open(settings.method, settings.uploadScript, true);
  392 +
  393 + // On progress function
  394 + xhr.upload.addEventListener('progress', function(e) {
  395 + if (e.lengthComputable) {
  396 + $data.progress(e, file);
  397 + }
  398 + }, false);
  399 +
  400 + // On complete function
  401 + xhr.addEventListener('load', function(e) {
  402 + if (this.readyState == 4) {
  403 + file.uploading = false;
  404 + if (this.status == 200) {
  405 + if (file.xhr.responseText !== 'Invalid file type.') {
  406 + $data.uploadComplete(e, file, uploadAll);
  407 + } else {
  408 + $data.error(file.xhr.responseText, file, uploadAll);
  409 + }
  410 + } else if (this.status == 404) {
  411 + $data.error('404_FILE_NOT_FOUND', file, uploadAll);
  412 + } else if (this.status == 403) {
  413 + $data.error('403_FORBIDDEN', file, uploadAll);
  414 + } else {
  415 + $data.error('Unknown Error', file, uploadAll);
  416 + }
  417 + }
  418 + });
  419 +
  420 + // Send the form data (multipart/form-data)
  421 + xhr.send(formData);
  422 +
  423 + } else {
  424 +
  425 + // Send as binary
  426 + var reader = new FileReader();
  427 + reader.onload = function(e) {
  428 +
  429 + // Set some file builder variables
  430 + var boundary = '-------------------------' + (new Date).getTime(),
  431 + dashes = '--',
  432 + eol = '\r\n',
  433 + binFile = '';
  434 +
  435 + // Build an RFC2388 String
  436 + binFile += dashes + boundary + eol;
  437 + // Generate the headers
  438 + binFile += 'Content-Disposition: form-data; name="' + settings.fileObjName + '"';
  439 + if (file.name) {
  440 + binFile += '; filename="' + file.name + '"';
  441 + }
  442 + binFile += eol;
  443 + binFile += 'Content-Type: application/octet-stream' + eol + eol;
  444 + binFile += e.target.result + eol;
  445 +
  446 + for (key in settings.formData) {
  447 + binFile += dashes + boundary + eol;
  448 + binFile += 'Content-Disposition: form-data; name="' + key + '"' + eol + eol;
  449 + binFile += settings.formData[key] + eol;
  450 + }
  451 +
  452 + binFile += dashes + boundary + dashes + eol;
  453 +
  454 + // On progress function
  455 + xhr.upload.addEventListener('progress', function(e) {
  456 + $data.progress(e, file);
  457 + }, false);
  458 +
  459 + // On complete function
  460 + xhr.addEventListener('load', function(e) {
  461 + file.uploading = false;
  462 + var status = this.status;
  463 + if (status == 404) {
  464 + $data.error('404_FILE_NOT_FOUND', file, uploadAll);
  465 + } else {
  466 + if (file.xhr.responseText != 'Invalid file type.') {
  467 + $data.uploadComplete(e, file, uploadAll);
  468 + } else {
  469 + $data.error(file.xhr.responseText, file, uploadAll);
  470 + }
  471 + }
  472 + }, false);
  473 +
  474 + // Open the ajax request
  475 + var url = settings.uploadScript;
  476 + if (settings.method == 'get') {
  477 + var params = $(settings.formData).param();
  478 + url += params;
  479 + }
  480 + xhr.open(settings.method, settings.uploadScript, true);
  481 + xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
  482 +
  483 + // Trigger the uploadFile event
  484 + if (typeof settings.onUploadFile === 'function') {
  485 + settings.onUploadFile.call($this, file);
  486 + }
  487 +
  488 + // Send the file for upload
  489 + xhr.sendAsBinary(binFile);
  490 + }
  491 + reader.readAsBinaryString(file);
  492 +
  493 + }
  494 + }
  495 + }
  496 +
  497 + // Update a file upload's progress
  498 + $data.progress = function(e, file) {
  499 + if ($.inArray('onProgress', settings.overrideEvents) < 0) {
  500 + if (e.lengthComputable) {
  501 + var percent = Math.round((e.loaded / e.total) * 100);
  502 + }
  503 + file.queueItem.find('.fileinfo').html(' - ' + percent + '%');
  504 + file.queueItem.find('.progress-bar').css('width', percent + '%');
  505 + }
  506 + // Trigger the progress event
  507 + if (typeof settings.onProgress === 'function') {
  508 + settings.onProgress.call($this, file, e);
  509 + }
  510 + }
  511 +
  512 + // Trigger an error
  513 + $data.error = function(errorType, file, uploadAll) {
  514 + if ($.inArray('onError', settings.overrideEvents) < 0) {
  515 + // Get the error message
  516 + switch(errorType) {
  517 + case '404_FILE_NOT_FOUND':
  518 + errorMsg = '404 Error';
  519 + break;
  520 + case '403_FORBIDDEN':
  521 + errorMsg = '403 Forbidden';
  522 + break;
  523 + case 'FORBIDDEN_FILE_TYPE':
  524 + errorMsg = 'Forbidden File Type';
  525 + break;
  526 + case 'FILE_SIZE_LIMIT_EXCEEDED':
  527 + errorMsg = 'File Too Large';
  528 + break;
  529 + default:
  530 + errorMsg = 'Unknown Error';
  531 + break;
  532 + }
  533 +
  534 + // Add the error class to the queue item
  535 + file.queueItem.addClass('error')
  536 + // Output the error in the queue item
  537 + .find('.fileinfo').html(' - ' + errorMsg);
  538 + // Hide the
  539 + file.queueItem.find('.progress').remove();
  540 + }
  541 + // Trigger the error event
  542 + if (typeof settings.onError === 'function') {
  543 + settings.onError.call($this, errorType, file);
  544 + }
  545 + file.skip = true;
  546 + if (errorType == '404_FILE_NOT_FOUND') {
  547 + $data.uploads.errors++;
  548 + } else {
  549 + $data.queue.errors++;
  550 + }
  551 + if (uploadAll) {
  552 + methods.upload.call($this, null, true);
  553 + }
  554 + }
  555 +
  556 + // Trigger when a single file upload is complete
  557 + $data.uploadComplete = function(e, file, uploadAll) {
  558 + if ($.inArray('onUploadComplete', settings.overrideEvents) < 0) {
  559 + file.queueItem.find('.progress-bar').css('width', '100%');
  560 + file.queueItem.find('.fileinfo').html(' - Completed');
  561 + file.queueItem.find('.progress').slideUp(250);
  562 + file.queueItem.addClass('complete');
  563 + }
  564 + // Trigger the complete event
  565 + if (typeof settings.onUploadComplete === 'function') {
  566 + settings.onUploadComplete.call($this, file, file.xhr.responseText);
  567 + }
  568 + if (settings.removeCompleted) {
  569 + setTimeout(function() { methods.cancel.call($this, file); }, 3000);
  570 + }
  571 + file.complete = true;
  572 + $data.uploads.successful++;
  573 + $data.uploads.count++;
  574 + $data.uploads.current--;
  575 + delete file.xhr;
  576 + if (uploadAll) {
  577 + methods.upload.call($this, null, true);
  578 + }
  579 + }
  580 +
  581 + // Trigger when all the files are done uploading
  582 + $data.queueComplete = function() {
  583 + // Trigger the queueComplete event
  584 + if (typeof settings.onQueueComplete === 'function') {
  585 + settings.onQueueComplete.call($this, $data.uploads);
  586 + }
  587 + }
  588 +
  589 + // ----------------------
  590 + // Initialize UploadiFive
  591 + // ----------------------
  592 +
  593 + // Check if HTML5 is available
  594 + if (window.File && window.FileList && window.Blob && (window.FileReader || window.FormData)) {
  595 + // Assign an ID to the object
  596 + settings.id = 'uploadifive-' + $this.attr('id');
  597 +
  598 + // Wrap the file input in a div with overflow set to hidden
  599 + $data.button = $('<div id="' + settings.id + '" class="uploadifive-button">' + settings.buttonText + '</div>');
  600 + if (settings.buttonClass) $data.button.addClass(settings.buttonClass);
  601 +
  602 + // Style the button wrapper
  603 + $data.button.css({
  604 + 'height' : settings.height,
  605 + 'line-height' : settings.height + 'px',
  606 + 'overflow' : 'hidden',
  607 + 'position' : 'relative',
  608 + 'text-align' : 'center',
  609 + 'width' : settings.width
  610 + });
  611 +
  612 + // Insert the button above the file input
  613 + $this.before($data.button)
  614 + // Add the file input to the button
  615 + .appendTo($data.button)
  616 + // Modify the styles of the file input
  617 + .hide();
  618 +
  619 + // Create a new input
  620 + $data.createInput.call($this);
  621 +
  622 + // Create the queue container
  623 + if (!settings.queueID) {
  624 + settings.queueID = settings.id + '-queue';
  625 + $data.queueEl = $('<div id="' + settings.queueID + '" class="uploadifive-queue" />');
  626 + $data.button.after($data.queueEl);
  627 + } else {
  628 + $data.queueEl = $('#' + settings.queueID);
  629 + }
  630 +
  631 + // Add drag and drop functionality
  632 + if (settings.dnd) {
  633 + var $dropTarget = settings.dropTarget ? $(settings.dropTarget) : $data.queueEl.get(0);
  634 + $dropTarget.addEventListener('dragleave', function(e) {
  635 + // Stop FireFox from opening the dropped file(s)
  636 + e.preventDefault();
  637 + e.stopPropagation();
  638 + }, false);
  639 + $dropTarget.addEventListener('dragenter', function(e) {
  640 + // Stop FireFox from opening the dropped file(s)
  641 + e.preventDefault();
  642 + e.stopPropagation();
  643 + }, false);
  644 + $dropTarget.addEventListener('dragover', function(e) {
  645 + // Stop FireFox from opening the dropped file(s)
  646 + e.preventDefault();
  647 + e.stopPropagation();
  648 + }, false);
  649 + $dropTarget.addEventListener('drop', $data.drop, false);
  650 + }
  651 +
  652 + // Send as binary workaround for Chrome
  653 + if (!XMLHttpRequest.prototype.sendAsBinary) {
  654 + XMLHttpRequest.prototype.sendAsBinary = function(datastr) {
  655 + function byteValue(x) {
  656 + return x.charCodeAt(0) & 0xff;
  657 + }
  658 + var ords = Array.prototype.map.call(datastr, byteValue);
  659 + var ui8a = new Uint8Array(ords);
  660 + this.send(ui8a.buffer);
  661 + }
  662 + }
  663 +
  664 + // Trigger the oninit event
  665 + if (typeof settings.onInit === 'function') {
  666 + settings.onInit.call($this);
  667 + }
  668 +
  669 + } else {
  670 +
  671 + // Trigger the fallback event
  672 + if (typeof settings.onFallback === 'function') {
  673 + settings.onFallback.call($this);
  674 + }
  675 + return false;
  676 +
  677 + }
  678 +
  679 + });
  680 +
  681 + },
  682 +
  683 +
  684 + // Write some data to the console
  685 + debug : function() {
  686 +
  687 + return this.each(function() {
  688 +
  689 + console.log($(this).data('uploadifive'));
  690 +
  691 + });
  692 +
  693 + },
  694 +
  695 + // Clear all the items from the queue
  696 + clearQueue : function() {
  697 +
  698 + this.each(function() {
  699 +
  700 + var $this = $(this),
  701 + $data = $this.data('uploadifive'),
  702 + settings = $data.settings;
  703 +
  704 + for (var key in $data.inputs) {
  705 + input = $data.inputs[key];
  706 + limit = input.files.length;
  707 + for (i = 0; i < limit; i++) {
  708 + file = input.files[i];
  709 + methods.cancel.call($this, file);
  710 + }
  711 + }
  712 + // Trigger the onClearQueue event
  713 + if (typeof settings.onClearQueue === 'function') {
  714 + settings.onClearQueue.call($this, $('#' + $data.settings.queueID));
  715 + }
  716 +
  717 + });
  718 +
  719 + },
  720 +
  721 + // Cancel a file upload in progress or remove a file from the queue
  722 + cancel : function(file, fast) {
  723 +
  724 + this.each(function() {
  725 +
  726 + var $this = $(this),
  727 + $data = $this.data('uploadifive'),
  728 + settings = $data.settings;
  729 +
  730 + // If user passed a queue item ID instead of file...
  731 + if (typeof file === 'string') {
  732 + if (!isNaN(file)) {
  733 + fileID = 'uploadifive-' + $(this).attr('id') + '-file-' + file;
  734 + }
  735 + file = $('#' + fileID).data('file');
  736 + }
  737 +
  738 + file.skip = true;
  739 + $data.filesCancelled++;
  740 + if (file.uploading) {
  741 + $data.uploads.current--;
  742 + file.uploading = false;
  743 + file.xhr.abort();
  744 + delete file.xhr;
  745 + methods.upload.call($this);
  746 + }
  747 + if ($.inArray('onCancel', settings.overrideEvents) < 0) {
  748 + $data.removeQueueItem(file, fast);
  749 + }
  750 +
  751 + // Trigger the cancel event
  752 + if (typeof settings.onCancel === 'function') {
  753 + settings.onCancel.call($this, file);
  754 + }
  755 +
  756 + });
  757 +
  758 + },
  759 +
  760 + // Upload the files in the queue
  761 + upload : function(file, keepVars) {
  762 +
  763 + this.each(function() {
  764 +
  765 + var $this = $(this),
  766 + $data = $this.data('uploadifive'),
  767 + settings = $data.settings;
  768 +
  769 + if (file) {
  770 +
  771 + $data.uploadFile.call($this, file);
  772 +
  773 + } else {
  774 +
  775 + // Check if the upload limit was reached
  776 + if (($data.uploads.count + $data.uploads.current) < settings.uploadLimit || settings.uploadLimit == 0) {
  777 + if (!keepVars) {
  778 + $data.uploads.attempted = 0;
  779 + $data.uploads.successsful = 0;
  780 + $data.uploads.errors = 0;
  781 + var filesToUpload = $data.filesToUpload();
  782 + // Trigger the onUpload event
  783 + if (typeof settings.onUpload === 'function') {
  784 + settings.onUpload.call($this, filesToUpload);
  785 + }
  786 + }
  787 +
  788 + // Loop through the files
  789 + $('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').each(function() {
  790 + _file = $(this).data('file');
  791 + // Check if the simUpload limit was reached
  792 + if (($data.uploads.current >= settings.simUploadLimit && settings.simUploadLimit !== 0) || ($data.uploads.current >= settings.uploadLimit && settings.uploadLimit !== 0) || ($data.uploads.count >= settings.uploadLimit && settings.uploadLimit !== 0)) {
  793 + return false;
  794 + }
  795 + if (settings.checkScript) {
  796 + // Let the loop know that we're already processing this file
  797 + _file.checking = true;
  798 + skipFile = $data.checkExists(_file);
  799 + _file.checking = false;
  800 + if (!skipFile) {
  801 + $data.uploadFile(_file, true);
  802 + }
  803 + } else {
  804 + $data.uploadFile(_file, true);
  805 + }
  806 + });
  807 + if ($('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').size() == 0) {
  808 + $data.queueComplete();
  809 + }
  810 + } else {
  811 + if ($data.uploads.current == 0) {
  812 + if ($.inArray('onError', settings.overrideEvents) < 0) {
  813 + if ($data.filesToUpload() > 0 && settings.uploadLimit != 0) {
  814 + alert('The maximum upload limit has been reached.');
  815 + }
  816 + }
  817 + // Trigger the onError event
  818 + if (typeof settings.onError === 'function') {
  819 + settings.onError.call($this, 'UPLOAD_LIMIT_EXCEEDED', $data.filesToUpload());
  820 + }
  821 + }
  822 + }
  823 +
  824 + }
  825 +
  826 + });
  827 +
  828 + },
  829 +
  830 + // Destroy an instance of UploadiFive
  831 + destroy : function() {
  832 +
  833 + this.each(function() {
  834 +
  835 + var $this = $(this),
  836 + $data = $this.data('uploadifive'),
  837 + settings = $data.settings;
  838 +
  839 + // Clear the queue
  840 + methods.clearQueue.call($this);
  841 + // Destroy the queue if it was created
  842 + if (!settings.queueID) $('#' + settings.queueID).remove();
  843 + // Remove extra inputs
  844 + $this.siblings('input').remove();
  845 + // Show the original file input
  846 + $this.show()
  847 + // Move the file input out of the button
  848 + .insertBefore($data.button);
  849 + // Delete the button
  850 + $data.button.remove();
  851 + // Trigger the destroy event
  852 + if (typeof settings.onDestroy === 'function') {
  853 + settings.onDestroy.call($this);
  854 + }
  855 +
  856 + });
  857 +
  858 + }
  859 +
  860 + }
  861 +
  862 + $.fn.uploadifive = function(method) {
  863 +
  864 + if (methods[method]) {
  865 + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  866 + } else if (typeof method === 'object' || !method) {
  867 + return methods.init.apply(this, arguments);
  868 + } else {
  869 + $.error('The method ' + method + ' does not exist in $.uploadify');
  870 + }
  871 +
  872 + }
  873 +
  874 +})(jQuery);
  1 +/**
  2 + * 在线客服
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +var $ = require('jquery');
  7 +
  8 +var $questionTab = $('.question-tab .tab-item');
  9 +
  10 +$questionTab.on('touchend', function() {
  11 + var clickTab = $(this).data('tab');
  12 +
  13 + clickTab = '[data-tab-name="' + clickTab + '"]';
  14 +
  15 + $questionTab.removeClass('current');
  16 + $(this).addClass('current');
  17 +
  18 + $('.question-list').removeClass('current');
  19 + $(clickTab).addClass('current');
  20 +});
  1 +/**
  2 + * 订单详情页
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +
  7 +var $ = require('jquery'),
  8 + lazyLoad = require('yoho.lazyload'),
  9 + Hammer = require('yoho.hammer');
  10 +
  11 +var orderId = $('#order-detail').data('id');
  12 +
  13 +var optHammer;
  14 +
  15 +lazyLoad();
  16 +
  17 +//订单删除
  18 +optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
  19 +optHammer.on('tap', function(e) {
  20 + var $cur = $(e.target);
  21 +
  22 + if ($cur.hasClass('btn-del')) {
  23 +
  24 + //删除订单
  25 + if (confirm('确定删除订单吗?')) {
  26 + $.ajax({
  27 + type: 'GET',
  28 + url: '/home/delOrder',
  29 + data: {
  30 + id: orderId
  31 + }
  32 + });
  33 + }
  34 + } else if ($cur.hasClass('btn-cancel')) {
  35 +
  36 + //取消订单
  37 + if (confirm('确定取消订单吗?')) {
  38 + $.ajax({
  39 + type: 'GET',
  40 + url: '/home/cancelOrder',
  41 + data: {
  42 + id: orderId
  43 + }
  44 + });
  45 + }
  46 + }
  47 +});
@@ -13,24 +13,125 @@ var $navLi = $('#order-nav > li'), @@ -13,24 +13,125 @@ var $navLi = $('#order-nav > li'),
13 13
14 var $curContainer = $orderContainer.children('.orders').first();//保存当前显示的order-container 14 var $curContainer = $orderContainer.children('.orders').first();//保存当前显示的order-container
15 15
16 -var navHammer; 16 +var winH = $(window).height();
  17 +
  18 +var activeIndex = 0; //当前active的项的index
  19 +
  20 +var orderPage = [1, 0, 0, 0];
  21 +
  22 +var loading = false;
  23 +
  24 +var navHammer, orderHammer;
  25 +
  26 +//加载订单
  27 +function getOrders() {
  28 + var opt = {
  29 + type: activeIndex + 1,
  30 + page: orderPage[activeIndex] + 1
  31 + },
  32 + num;
  33 +
  34 + if (loading) {
  35 + return;
  36 + }
  37 +
  38 +
  39 + $.ajax({
  40 + type: 'GET',
  41 + url: '/home/getOrders',
  42 + data: opt,
  43 + success: function(data) {
  44 + if (data.code === 200) {
  45 + orderPage[opt.type] = opt.page;
  46 +
  47 + if (opt.page === 1) {
  48 + $curContainer.html(data.data);
  49 + lazyLoad($curContainer.find('.lazy'));
  50 + } else {
  51 + num = $curContainer.children('.order').length;
  52 + $curContainer.append(data.data);
  53 +
  54 + //lazyload
  55 + lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy'));
  56 + }
  57 + }
  58 + }
  59 + });
  60 +}
17 61
18 lazyLoad(); 62 lazyLoad();
19 63
  64 +//导航切换
20 navHammer = new Hammer(document.getElementById('order-nav')); 65 navHammer = new Hammer(document.getElementById('order-nav'));
21 navHammer.on('tap', function(e) { 66 navHammer.on('tap', function(e) {
22 - var $cur = $(e.target).closest('li'),  
23 - index; 67 + var $cur = $(e.target).closest('li');
24 68
25 if ($cur.length === 0 || $cur.hasClass('active')) { 69 if ($cur.length === 0 || $cur.hasClass('active')) {
26 return; 70 return;
27 } 71 }
28 72
29 - index = $cur.index(); 73 + activeIndex = +$cur.index();
30 74
31 $navLi.filter('.active').removeClass('active'); 75 $navLi.filter('.active').removeClass('active');
32 $cur.addClass('active'); 76 $cur.addClass('active');
33 77
34 $curContainer.addClass('hide'); 78 $curContainer.addClass('hide');
35 - $curContainer = $orderContainer.children(':eq(' + index + ')').removeClass('hide'); 79 + $curContainer = $orderContainer.children(':eq(' + activeIndex + ')').removeClass('hide');
  80 +
  81 + if (orderPage[activeIndex] > 0) {
  82 + return;
  83 + } else {
  84 + getOrders();
  85 + }
  86 +
  87 +});
  88 +
  89 +//点击订单区域跳转订单详情页
  90 +orderHammer = new Hammer(document.getElementById('order-container'));
  91 +orderHammer.on('tap', function(e) {
  92 + var $cur = $(e.target),
  93 + $order,
  94 + id,
  95 + url;
  96 +
  97 + if ($cur.closest('.locHref').length > 0) {
  98 + return;
  99 + }
  100 +
  101 + $order = $cur.closest('.order');
  102 + id = $order.data('id');
  103 +
  104 + if ($cur.closest('.del').length > 0) {
  105 +
  106 + //Order delete
  107 + $.ajax({
  108 + type: 'GET',
  109 + url: '/home/delOrder',
  110 + data: {
  111 + id: id
  112 + }
  113 + });
  114 + } else if ($cur.closest('.cancel').length > 0) {
  115 +
  116 + //Order cancel
  117 + $.ajax({
  118 + type: 'GET',
  119 + url: '/home/cancelOrder',
  120 + data: {
  121 + id: id
  122 + }
  123 + });
  124 + } else {
  125 +
  126 + //Location to order detail
  127 + url = $order.data('href');
  128 + location.href = url;
  129 + }
  130 +});
  131 +
  132 +$(window).scroll(function() {
  133 + if ($(window).scrollTop() + winH >
  134 + $(document).height() - 0.25 * $orderContainer.height()) {
  135 + getOrders();
  136 + }
36 }); 137 });
@@ -4,34 +4,28 @@ @@ -4,34 +4,28 @@
4 * @date: 2015/11/12 4 * @date: 2015/11/12
5 */ 5 */
6 6
  7 +
7 var $ = require('jquery'), 8 var $ = require('jquery'),
8 Hammer = require('yoho.hammer'), 9 Hammer = require('yoho.hammer'),
9 lazyLoad = require('yoho.lazyload'); 10 lazyLoad = require('yoho.lazyload');
10 11
11 -var $navLi = $('#fav-tab > li'),  
12 - $favContainer = $('.fav-content');  
13 -  
14 -var $curContainer = $favContainer.children('.fav-type').first();//保存当前显示的$favContainer  
15 -  
16 -var favTabHammer; 12 +require('./jquery.uploadifive');
17 13
18 -//lazyLoad(); 14 +$('#upload-img').uploadifive({
  15 + 'auto': false,
  16 + 'buttonClass': 'nav-btn',
  17 + 'formData': {
19 18
20 -favTabHammer = new Hammer(document.getElementById('fav-tab'));  
21 -favTabHammer.on('tap', function(e) {  
22 - console.log(1);  
23 - var $cur = $(e.target).closest('li'),  
24 - index; 19 + },
  20 + 'fileType': 'image/*',
  21 + 'uploadScript': 'url',
  22 + 'fileObjName': 'imgName',
  23 + 'fileSizeLimit': 1024,
  24 + 'onAddQueueItem': function (file) {
  25 + console.log(file);
  26 + alert(1);
  27 + },
  28 + 'onQueueComplete': function (file) {
25 29
26 - if ($cur.length === 0 || $cur.hasClass('active')) {  
27 - return;  
28 } 30 }
29 -  
30 - index = $cur.index();  
31 -  
32 - $navLi.filter('.active').removeClass('active');  
33 - $cur.addClass('active');  
34 -  
35 - $curContainer.addClass('hide');  
36 - $curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide');  
37 -}); 31 +});
1 var $ = require('jquery'), 1 var $ = require('jquery'),
2 - Hammer = require('yoho.hammer');  
3 -  
4 -Swiper = require('yoho.iswiper'),  
5 -lazyLoad = require('yoho.lazyload'); 2 + Hammer = require('yoho.hammer'),
  3 + Swiper = require('yoho.iswiper'),
  4 + lazyLoad = require('yoho.lazyload');
6 5
7 var page = 1, 6 var page = 1,
8 winH, 7 winH,
9 hotnav, 8 hotnav,
  9 + listTop,
  10 + navSwiper,
  11 + notab = 0,
10 sort = '', 12 sort = '',
11 id = ''; 13 id = '';
12 14
13 -function hotrank(page, sort, tab_id) { 15 +function hotrank(page, sort, tabId, notab) {
14 $.ajax({ 16 $.ajax({
15 type: 'GET', 17 type: 'GET',
16 - url: '/product/newsale/selectHotrank', 18 + url: '/product/newsale/selectHotrank?' + sort,
17 dataType: 'html', 19 dataType: 'html',
18 data: { 20 data: {
19 page: page, 21 page: page,
20 - sort: sort,  
21 - tab_id: tab_id 22 + tab_id: tabId,
  23 + notab: notab
22 }, 24 },
23 success: function(data) { 25 success: function(data) {
24 if (page === 1) { 26 if (page === 1) {
25 - $('#hotRank').html(''); 27 + $('.rank-main').remove();
26 } 28 }
27 $('#hotRank').append(data); 29 $('#hotRank').append(data);
28 lazyLoad($('img.lazy')); 30 lazyLoad($('img.lazy'));
29 $('#yoho-footer').css('position', 'static'); 31 $('#yoho-footer').css('position', 'static');
  32 + $('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
30 navSwiper = new Swiper('.s-goods-nav', { 33 navSwiper = new Swiper('.s-goods-nav', {
31 grabCursor: true, 34 grabCursor: true,
32 slidesPerView: 'auto', 35 slidesPerView: 'auto',
@@ -38,9 +41,13 @@ function hotrank(page, sort, tab_id) { @@ -38,9 +41,13 @@ function hotrank(page, sort, tab_id) {
38 $('.s-goods-nav .nav-item').each(function(index) { 41 $('.s-goods-nav .nav-item').each(function(index) {
39 hotnav = new Hammer($('.s-goods-nav .nav-item')[index]); 42 hotnav = new Hammer($('.s-goods-nav .nav-item')[index]);
40 hotnav.on('tap', function(e) { 43 hotnav.on('tap', function(e) {
41 - id = $('.s-goods-nav .nav-item').eq(index).data('id'),  
42 - sort = parseInt($('.s-goods-nav .nav-item').eq(index).data('sort').split('=')[1]);  
43 - hotrank(page, sort, id); 44 + var navItme = $('.s-goods-nav .nav-item').eq(index);
  45 +
  46 + id = navItme.data('id') ? navItme.data('id') : '';
  47 + sort = navItme.data('sort') ? navItme.data('sort') : '';
  48 + page = 1;
  49 + notab = 1;
  50 + hotrank(page, sort, id, notab);
44 }); 51 });
45 }); 52 });
46 } 53 }
@@ -55,7 +62,8 @@ $(window).scroll(function () { @@ -55,7 +62,8 @@ $(window).scroll(function () {
55 return; 62 return;
56 } 63 }
57 page = 2; 64 page = 2;
58 - hotrank(page, sort, id); 65 + notab = 1;
  66 + hotrank(page, sort, id, notab);
59 67
60 }); 68 });
61 -hotrank(page, sort, id); 69 +hotrank(page, sort, id, notab);
  1 +/**
  2 + * 为您优选
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +
  7 +
  8 +var Swiper = require('yoho.iswiper');
  9 +
  10 +var recommendSwiper;
  11 +
  12 +recommendSwiper = new Swiper('.swiper-recommend', {
  13 +
  14 + // lazyLoading: true,
  15 + // lazyLoadingInPrevNext: true,
  16 + slidesPerView: 'auto'
  17 +});
@@ -62,4 +62,15 @@ @@ -62,4 +62,15 @@
62 text-overflow: ellipsis; 62 text-overflow: ellipsis;
63 text-align: center; 63 text-align: center;
64 } 64 }
  65 +
  66 + .nav-btn {
  67 + display: block;
  68 + height: 100%;
  69 + position: absolute;
  70 + top: 0;
  71 + right: 0;
  72 + font-size: pxToRem(26px);
  73 + color: #b0b0b0;
  74 + padding-right: pxToRem(32px);
  75 + }
65 } 76 }
@@ -43,7 +43,7 @@ $fav: sprite-map("me/fav/*.png",$spacing: 5px); @@ -43,7 +43,7 @@ $fav: sprite-map("me/fav/*.png",$spacing: 5px);
43 43
44 //收藏主体 44 //收藏主体
45 .fav-content { 45 .fav-content {
46 - padding: 0 pxToRem(30px); 46 + //padding: 0 pxToRem(30px);
47 47
48 .fav-null { 48 .fav-null {
49 font-size: pxToRem(22px); 49 font-size: pxToRem(22px);
@@ -74,5 +74,185 @@ $fav: sprite-map("me/fav/*.png",$spacing: 5px); @@ -74,5 +74,185 @@ $fav: sprite-map("me/fav/*.png",$spacing: 5px);
74 display: block; 74 display: block;
75 font-size: pxToRem(26px); 75 font-size: pxToRem(26px);
76 } 76 }
  77 +
  78 + .fav-product-list {
  79 + list-style: none;
  80 + margin-left: pxToRem(30px);
  81 +
  82 + li {
  83 + height: auto;
  84 + overflow: hidden;
  85 + margin-top: pxToRem(20px);
  86 + }
  87 +
  88 + .fav-img-box {
  89 + width: pxToRem(90px);
  90 + height: pxToRem(120px);
  91 + float: left;
  92 + margin-right: pxToRem(24px);
  93 +
  94 + img {
  95 + display: block;
  96 + overflow: hidden;
  97 + width: 100%;
  98 + height: 100%;
  99 + }
  100 + }
  101 +
  102 + .fav-info-list {
  103 + color: #444;
  104 + font-size: pxToRem(24px);
  105 + border-bottom: 1px solid #e0e0e0;
  106 + padding-bottom: pxToRem(20px);
  107 + height: pxToRem(120px);
  108 + overflow: hidden;
  109 + position: relative;
  110 +
  111 + h2 {
  112 + width: pxToRem(430px);
  113 + @include ellipsis();
  114 + }
  115 +
  116 + .fav-price {
  117 +
  118 + .new-price {
  119 + color: #d1021c;
  120 + }
  121 +
  122 + .price-underline {
  123 + text-decoration: line-through;
  124 + }
  125 + }
  126 +
  127 + .save-price {
  128 + $width: pxToRem(image_width(sprite-file($fav, save-price)));
  129 + $height: pxToRem(image_height(sprite-file($fav, save-price)));
  130 +
  131 + position: absolute;
  132 + bottom: pxToRem(20px);
  133 + left: 0;
  134 + width: 100%;
  135 +
  136 + &.save-price-number {
  137 + text-indent: $width + pxToRem(10px);
  138 +
  139 + &:before {
  140 + content: '';
  141 + display: block;
  142 +
  143 + @include rem-sprite($fav, save-price);
  144 + width: $width;
  145 + height: $height;
  146 +
  147 + position: absolute;
  148 + top: 50%;
  149 + left: 0;
  150 + margin-top: -$height / 2;
  151 +
  152 + }
  153 + }
  154 +
  155 + span {
  156 + color: #d1021c;
  157 +
  158 + &.sell-out {
  159 + padding: pxToRem(5px) pxToRem(18px);
  160 + color: #fffefe;
  161 + @include border-radius(pxToRem(20px));
  162 + background: #7f7f7f;
  163 + font-size: pxToRem(22px);
  164 + }
  165 +
  166 + &.del-fav {
  167 + $width: pxToRem(image_width(sprite-file($fav, fav-del)));
  168 + $height: pxToRem(image_height(sprite-file($fav, fav-del)));
  169 +
  170 + @include rem-sprite($fav, fav-del);
  171 + width: $width;
  172 + height: $height;
  173 +
  174 + position: absolute;
  175 + top: 50%;
  176 + right: pxToRem(30px);
  177 + margin-top: -$height / 2;
  178 + }
  179 + }
  180 + }
  181 + }
  182 + }
  183 + //品牌收藏
  184 + .fav-brand-swiper {
  185 +
  186 + .swiper-header {
  187 + height: pxToRem(60px);
  188 + padding: pxToRem(20px) pxToRem(30px);
  189 + display: inline-block;
  190 +
  191 + .swiper-logo {
  192 + height: 100%;
  193 + display: inline-block;
  194 + float: left;
  195 + margin-right: pxToRem(45px);
  196 +
  197 + > img {
  198 + max-height: 100%;
  199 + vertical-align: middle;
  200 + }
  201 + }
  202 +
  203 + .brand-info {
  204 + float: left;
  205 +
  206 + .brand-name {
  207 + font-size: pxToRem(28px);
  208 +
  209 + b {
  210 + color: #b0b0b0;
  211 + font-weight: normal;
  212 + }
  213 + }
  214 +
  215 + .brand-update {
  216 + font-size: pxToRem(22px);
  217 +
  218 + b {
  219 + color: #b0b0b0;
  220 + font-weight: normal;
  221 + }
  222 +
  223 + .brand-new {
  224 + color: #86bf4a;
  225 + margin-right: pxToRem(24px);
  226 + }
  227 + .brand-discount {
  228 + color: #d1021c;
  229 + }
  230 + }
  231 + }
  232 + }
  233 + .swiper-container {
  234 + height: pxToRem(300px);
  235 + margin: 0 pxToRem(30px);
  236 +
  237 + .swiper-slide {
  238 + width: pxToRem(225px);
  239 + //width: (225/580)*100%;
  240 + height: 100%;
  241 + float: left;
  242 + padding-right: pxToRem(30px);
  243 +
  244 + &:nth-last-of-type(1) {
  245 + padding-right: 0;
  246 + }
  247 +
  248 + img {
  249 + display: block;
  250 + width: 100%;
  251 + height: 100%;
  252 + overflow: hidden;
  253 + }
  254 + }
  255 + }
  256 + }
77 } 257 }
78 } 258 }
1 -@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest", "address";  
  1 +@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service";
  2 +
  1 +@function rem($n) {
  2 + @return $n / 40 * 1rem;
  3 +}
  4 +
  5 +.online-service-page{
  6 + background: #f0f0f0;
  7 +
  8 + .question {
  9 + background: #fff;
  10 + }
  11 +
  12 + .question-title {
  13 + padding: rem(20) rem(30);
  14 + font-size: rem(28);
  15 + line-height: 1;
  16 + color: #b0b0b0;
  17 + }
  18 +
  19 + .question-tab {
  20 + padding: rem(10) rem(30) rem(30);
  21 + font-size: rem(32);
  22 + line-height: rem(58);
  23 + text-align: center;
  24 + color: #b0b0b0;
  25 +
  26 + .current {
  27 + color: #444;
  28 + }
  29 +
  30 + .line {
  31 + margin: 0 rem(32);
  32 + border-left: 1px solid #b0b0b0;
  33 + }
  34 + }
  35 +
  36 + .question-list {
  37 + display: none;
  38 + border-top: 1px solid #ccc;
  39 + border-bottom: 1px solid #ccc;
  40 +
  41 + &.current {
  42 + display: block;
  43 + }
  44 +
  45 + li {
  46 + margin-left: rem(30);
  47 + width: rem(610);
  48 + font-size: rem(28);
  49 + line-height: rem(90);
  50 + border-bottom: 1px solid #ccc;
  51 +
  52 + a {
  53 + display: block;
  54 + color: #444;
  55 + }
  56 +
  57 + .iconfont {
  58 + float: right;
  59 + margin-right: rem(30);
  60 + color: #ccc;
  61 + }
  62 +
  63 + &:last-child {
  64 + border-bottom: none;
  65 + }
  66 + }
  67 + }
  68 +
  69 + .connect-info {
  70 + margin-top: 30px;
  71 + font-size: rem(28);
  72 + line-height: rem(50);
  73 + background: #fff;
  74 + border-top: 1px solid #ccc;
  75 + border-bottom: 1px solid #ccc;
  76 +
  77 + p {
  78 + margin-top: rem(25);
  79 + margin-left: rem(-72);
  80 + line-height: 1.5;
  81 + }
  82 +
  83 + .iconfont {
  84 + font-size: rem(46);
  85 + }
  86 +
  87 + .icon-yoho-enter {
  88 + color: #ccc;
  89 + float: right;
  90 + }
  91 +
  92 + .connect-item {
  93 + position: relative;
  94 + a {
  95 + display: block;
  96 + padding: rem(20) rem(30) rem(20) rem(94);
  97 + color: #444;
  98 + }
  99 + &:after {
  100 + content: '';
  101 + position: absolute;
  102 + right: 0;
  103 + bottom: 0;
  104 + width: rem(548);
  105 + height: 1px;
  106 + background: #ccc;
  107 + }
  108 + &:last-child {
  109 + &:after {
  110 + content: none;
  111 + }
  112 + }
  113 + }
  114 + .icon {
  115 + display: inline-block;
  116 + margin-right: rem(28);
  117 + margin-left: rem(-70);
  118 + vertical-align:middle;
  119 + }
  120 + }
  121 +}
  122 +
  123 +.online-service-detail-page {
  124 + background: #f0f0f0;
  125 +
  126 + .qa-list {
  127 + .question-item {
  128 + margin-bottom: rem(32);
  129 + border-top: 1px solid #c8c7cc;
  130 + border-bottom: 1px solid #c8c7cc;
  131 + color: #444;
  132 + background: #fff;
  133 + &:last-child {
  134 + margin-bottom: 0;
  135 + }
  136 + }
  137 + %qa {
  138 + margin-left: rem(30);
  139 + padding: 0 rem(40) 0 rem(10);
  140 + font-size: rem(30);
  141 + line-height: rem(76);
  142 + font-weight: bold;
  143 + }
  144 + .question {
  145 + @extend %qa;
  146 + position: relative;
  147 + &:after {
  148 + content: '';
  149 + position: absolute;
  150 + left: 0;
  151 + bottom: 0;
  152 + width: 100%;
  153 + border-top: 1px solid #c8c7cc;
  154 + }
  155 + }
  156 + .answer {
  157 + @extend %qa;
  158 + }
  159 + }
  160 +}
  1 +.order-detail-page {
  2 + background: #f0f0f0;
  3 +
  4 + .block {
  5 + position: relative;
  6 + background: #fff;
  7 + padding: 20rem / $pxConvertRem 30rem / $pxConvertRem;
  8 +
  9 + .iconfont {
  10 + position: absolute;
  11 + left: 30rem / $pxConvertRem;
  12 + top: 50%;
  13 + font-size: 40rem / $pxConvertRem;
  14 + margin-top: -30rem / $pxConvertRem;
  15 + }
  16 + }
  17 +
  18 + .sub {
  19 + position: relative;
  20 +
  21 + .iconfont {
  22 + left: 0;
  23 + }
  24 + }
  25 +
  26 + .logistics {
  27 + display: block;
  28 +
  29 + .icon-right {
  30 + right: 25rem / $pxConvertRem;
  31 + left: auto;
  32 + color: #b0b0b0;
  33 + }
  34 +
  35 + .sub-content {
  36 + border-top: 1px solid #e0e0e0;
  37 + margin-top: 20rem / $pxConvertRem;
  38 + padding-top: 20rem / $pxConvertRem;
  39 + }
  40 + }
  41 +
  42 + .owner-info {
  43 + border-bottom: 1px solid #e0e0e0;
  44 + line-height: 1.5;
  45 + }
  46 +
  47 + .beside-icon {
  48 + margin-left: 60rem / $pxConvertRem;
  49 + }
  50 +
  51 + .name-phone {
  52 + font-size: 30rem / $pxConvertRem;
  53 +
  54 + span {
  55 + float: right;
  56 + }
  57 + }
  58 +
  59 + .address {
  60 + font-size: 24rem / $pxConvertRem;
  61 + margin-top: 10rem / $pxConvertRem;
  62 + }
  63 +
  64 + .order-status {
  65 + margin: 20rem / $pxConvertRem 0;
  66 + border-top: 1px solid #e0e0e0;
  67 + border-bottom: 1px solid #e0e0e0;
  68 + padding-right: 0;
  69 + }
  70 +
  71 + .sub-content span {
  72 + display: block;
  73 + color: #b0b0b0;
  74 + font-size: 24rem / $pxConvertRem;
  75 + }
  76 +
  77 + .sub-content .sub-title {
  78 + display: block;
  79 + color: #000;
  80 + font-size: 26rem / $pxConvertRem;
  81 + }
  82 +
  83 + .goods {
  84 + padding: 0;
  85 + margin-top: 20rem / $pxConvertRem;
  86 + border-top: 1px solid #e0e0e0;
  87 + border-bottom: 1px solid #e0e0e0;
  88 + }
  89 +
  90 + .cost {
  91 + margin-bottom: 100rem / $pxConvertRem; /*排除被固定底部遮挡的影响*/
  92 +
  93 + li {
  94 + font-size: 28rem / $pxConvertRem;
  95 +
  96 + span {
  97 + float: right;
  98 + }
  99 +
  100 + &:last-child span {
  101 + color: #f00;
  102 + }
  103 + }
  104 + }
  105 +
  106 + .opt {
  107 + position: fixed;
  108 + bottom: 0;
  109 + left: 0;
  110 + right: 0;
  111 + text-align: right;
  112 + border-top: 1px solid #e0e0e0;
  113 + }
  114 +
  115 + .btn {
  116 + display: inline-block;
  117 + box-sizing: border-box;
  118 + width: 140rem / $pxConvertRem;
  119 + height: 60rem / $pxConvertRem;
  120 + line-height: 60rem / $pxConvertRem;
  121 + @include border-radius(5px);
  122 + font-size: 26rem / $pxConvertRem;
  123 + text-align: center;
  124 + border: 1px solid #000;
  125 + }
  126 +
  127 + .btn-pay {
  128 + color: #fff;
  129 + border: none;
  130 + background: #d0021b;
  131 + margin-left: 10rem / $pxConvertRem;
  132 + }
  133 +}
@@ -2,11 +2,16 @@ @@ -2,11 +2,16 @@
2 background: #f0f0f0; 2 background: #f0f0f0;
3 3
4 .order { 4 .order {
  5 + display: block;
5 background: #fff; 6 background: #fff;
6 margin: 30rem / $pxConvertRem 0; 7 margin: 30rem / $pxConvertRem 0;
7 border-top: 1px solid #e0e0e0; 8 border-top: 1px solid #e0e0e0;
8 border-bottom: 1px solid #e0e0e0; 9 border-bottom: 1px solid #e0e0e0;
9 10
  11 + &:last-child {
  12 + margin-bottom: 0;
  13 + }
  14 +
10 .header, .footer { 15 .header, .footer {
11 height: 90rem / $pxConvertRem; 16 height: 90rem / $pxConvertRem;
12 line-height: 90rem / $pxConvertRem; 17 line-height: 90rem / $pxConvertRem;
@@ -18,7 +23,7 @@ @@ -18,7 +23,7 @@
18 border-bottom: 1px solid #e0e0e0; 23 border-bottom: 1px solid #e0e0e0;
19 } 24 }
20 25
21 - .trading-status { 26 + .order-status {
22 float: right; 27 float: right;
23 } 28 }
24 29
@@ -37,7 +42,7 @@ @@ -37,7 +42,7 @@
37 border-top: 1px solid #e0e0e0; 42 border-top: 1px solid #e0e0e0;
38 text-align: right; 43 text-align: right;
39 44
40 - > .btn { 45 + .btn {
41 display: inline-block; 46 display: inline-block;
42 box-sizing: border-box; 47 box-sizing: border-box;
43 height: 60rem / $pxConvertRem; 48 height: 60rem / $pxConvertRem;
@@ -45,19 +50,34 @@ @@ -45,19 +50,34 @@
45 width: 140rem / $pxConvertRem; 50 width: 140rem / $pxConvertRem;
46 font-size: 24rem / $pxConvertRem; 51 font-size: 24rem / $pxConvertRem;
47 text-align: center; 52 text-align: center;
48 - }  
49 -  
50 - .cancel {  
51 border: 1px solid #000; 53 border: 1px solid #000;
  54 + @include border-radius(5px);
52 } 55 }
53 56
54 .pay { 57 .pay {
55 background: #d0021b; 58 background: #d0021b;
56 color: #fff; 59 color: #fff;
  60 + border: none;
57 margin-left: 20rem / $pxConvertRem; 61 margin-left: 20rem / $pxConvertRem;
58 } 62 }
59 } 63 }
60 } 64 }
  65 +
  66 + .no-order {
  67 + text-align: center;
  68 + color: #f0f0f0;
  69 +
  70 + .iconfont {
  71 + font-size: 50px;
  72 + }
  73 +
  74 + .walk-way {
  75 + display: block;
  76 + color: #fff;
  77 + background: #fff;
  78 + @include border-radius(5px);
  79 + }
  80 + }
61 } 81 }
62 82
63 .order-nav { 83 .order-nav {
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 width: 100%; 2 width: 100%;
3 height: auto; 3 height: auto;
4 overflow: hidden; 4 overflow: hidden;
  5 + margin-top: 20rem / $pxConvertRem;
5 background-color:#fff; 6 background-color:#fff;
6 border-bottom:1px solid #e0e0e0; 7 border-bottom:1px solid #e0e0e0;
7 ul{ 8 ul{
  1 +@import "compass/layout";
  2 +
1 $suggest: sprite-map("me/suggest/*.png",$spacing: 5px); 3 $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
2 4
3 .yoho-suggest-page { 5 .yoho-suggest-page {
@@ -102,4 +104,97 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px); @@ -102,4 +104,97 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
102 } 104 }
103 } 105 }
104 } 106 }
  107 +
  108 + //发表意见
  109 + .create-new-suggest {
  110 + display: block;
  111 + color: #444;
  112 + width: 100%;
  113 + height: pxToRem(88px);
  114 + line-height: pxToRem(88px);
  115 + text-align: center;
  116 + font-size: pxToRem(30px);
  117 + border-top: 1px solid #e0e0e0;
  118 + border-bottom: 1px solid #e0e0e0;
  119 +
  120 + > span {
  121 + color: #b0b0b0;
  122 + font-size: pxToRem(26px);
  123 + }
  124 + }
  125 +}
  126 +
  127 +// 提交页面
  128 +.yoho-suggest-sub-page {
  129 + width: 100%;
  130 + //height: 100%;
  131 + background: #f0f0f0;
  132 +
  133 + .suggest-sub-form {
  134 + background: #fff;
  135 + width: 100%;
  136 +
  137 + #suggest-textarea {
  138 + @include box-sizing();
  139 + width: 100%;
  140 + max-width: 100%;
  141 + min-width: 100%;
  142 + height: pxToRem(255px);
  143 + max-height: pxToRem(255px);
  144 + min-height: pxToRem(255px);
  145 + padding: pxToRem(30px);
  146 + font-size: pxToRem(26px);
  147 + line-height: pxToRem(48px);
  148 + //color: #b0b0b0;
  149 + color: #000;
  150 + display: block;
  151 + background: #fff;
  152 + border: none;
  153 + outline: none;
  154 + }
  155 +
  156 + .img-form {
  157 + padding: 0 pxToRem(30px);
  158 +
  159 + .img-add {
  160 + display: block;
  161 + width: pxToRem(130px);
  162 + height: pxToRem(130px);
  163 + border: 1px dashed #e0e0e0;
  164 + position: relative;
  165 +
  166 + &:after {
  167 + $width: pxToRem(image_width(sprite-file($suggest, suggest-add)));
  168 + $height: pxToRem(image_height(sprite-file($suggest, suggest-add)));
  169 + content: '';
  170 + display: block;
  171 +
  172 + @include rem-sprite($suggest, suggest-add);
  173 + width: $width;
  174 + height: $height;
  175 +
  176 + position: absolute;
  177 + top: 50%;
  178 + left: 50%;
  179 + margin-top: -$height / 2;
  180 + margin-left: -$width / 2;
  181 + }
  182 +
  183 + > input[type="file"] {
  184 + position: absolute;
  185 + //@include stretch();
  186 + @include opacity(0.2);
  187 + border: none;
  188 + outline: none;
  189 + display: block;
  190 +
  191 + width: pxToRem(130px);
  192 + height: pxToRem(130px);
  193 +
  194 + top: 0;
  195 + left: 0;
  196 + }
  197 + }
  198 + }
  199 + }
105 } 200 }
@@ -4,7 +4,6 @@ $borderC:#e0e0e0; @@ -4,7 +4,6 @@ $borderC:#e0e0e0;
4 $tableCellC:#eee; 4 $tableCellC:#eee;
5 $basicBtnC:#eb0313; 5 $basicBtnC:#eb0313;
6 6
7 -  
8 .good-detail-page { 7 .good-detail-page {
9 8
10 /* basic component */ 9 /* basic component */
@@ -213,7 +212,9 @@ $basicBtnC:#eb0313; @@ -213,7 +212,9 @@ $basicBtnC:#eb0313;
213 font-size: pxToRem(28px); 212 font-size: pxToRem(28px);
214 color: $mainFontC; 213 color: $mainFontC;
215 line-height: pxToRem(88px); 214 line-height: pxToRem(88px);
216 - border-bottom: 1px solid $borderC; 215 +
  216 + border-bottom: 2px solid $borderC;
  217 +
217 .iconfont{ 218 .iconfont{
218 // padding-right:28rem/$pxConvertRem; 219 // padding-right:28rem/$pxConvertRem;
219 font-size: inherit; 220 font-size: inherit;
@@ -263,6 +264,20 @@ $basicBtnC:#eb0313; @@ -263,6 +264,20 @@ $basicBtnC:#eb0313;
263 background-color: #fff; 264 background-color: #fff;
264 border-bottom: 1px solid $borderC; 265 border-bottom: 1px solid $borderC;
265 .user-name{ 266 .user-name{
  267 + font-size: px2rem(24);
  268 + line-height: px2rem(62);
  269 + color:$mainFontC;
  270 + padding-left: px2rem(28);
  271 + padding-right: px2rem(18);
  272 + }
  273 + .goods-spec,
  274 + .comment-time{
  275 + font-size: px2rem(24);
  276 + line-height: px2rem(62);
  277 + }
  278 + .detail-content{
  279 + font-size: px2rem(28);
  280 + line-height: px2rem(36);
266 font-size: pxToRem(24px); 281 font-size: pxToRem(24px);
267 line-height: pxToRem(62px); 282 line-height: pxToRem(62px);
268 color:$mainFontC; 283 color:$mainFontC;
@@ -284,6 +299,11 @@ $basicBtnC:#eb0313; @@ -284,6 +299,11 @@ $basicBtnC:#eb0313;
284 } 299 }
285 .detail-content, 300 .detail-content,
286 .comment-time{ 301 .comment-time{
  302 + padding-left: px2rem(28);
  303 +
  304 + }
  305 + .detail-content{
  306 + padding-right: px2rem(28);
287 padding-left: pxToRem(28px); 307 padding-left: pxToRem(28px);
288 308
289 } 309 }
@@ -297,20 +317,23 @@ $basicBtnC:#eb0313; @@ -297,20 +317,23 @@ $basicBtnC:#eb0313;
297 } 317 }
298 318
299 .comment-content-footer{ 319 .comment-content-footer{
300 - min-height: pxToRem(88px);  
301 - text-align: center;  
302 - background-color: #fff;  
303 -  
304 - border-bottom: 1px solid $borderC;  
305 - line-height: pxToRem(88px);  
306 - font-size: pxToRem(28px);  
307 - a{  
308 - color: #e0e0e0;  
309 - .iconfont{  
310 - font-size: inherit;  
311 - }  
312 - }  
313 -} 320 +
  321 + min-height: pxToRem(88px);
  322 + text-align: center;
  323 + background-color: #fff;
  324 +
  325 + border-bottom: 2px solid $borderC;
  326 + line-height: pxToRem(88px);
  327 + font-size: pxToRem(28px);
  328 +
  329 + a{
  330 + color: #e0e0e0;
  331 + .iconfont{
  332 + font-size: inherit;
  333 + }
  334 + }
  335 + }
  336 +
314 337
315 } 338 }
316 339
@@ -38,15 +38,15 @@ @@ -38,15 +38,15 @@
38 text-align: center; 38 text-align: center;
39 font-size: 22rem / $pxConvertRem; 39 font-size: 22rem / $pxConvertRem;
40 color: #fff; 40 color: #fff;
41 - // background: image-url("sale-icon/rank.png") no-repeat; 41 + background: url("../img/me/employ/rank.png") no-repeat;
42 background-position: center top; 42 background-position: center top;
43 background-size: auto 100%; 43 background-size: auto 100%;
44 44
45 &.top { 45 &.top {
46 - // background: image-url("sale-icon/rank-t.png") no-repeat; 46 + background: url("../img/me/employ/rank-t.png") no-repeat;
47 background-position: center top; 47 background-position: center top;
48 background-size: 100%; 48 background-size: 100%;
49 - line-height: 58rem / $pxConvertRem; 49 + line-height: 54rem / $pxConvertRem;
50 } 50 }
51 } 51 }
52 52
1 -@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank";  
  1 +@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank", "_recommend-for-you.scss";
@@ -7,9 +7,41 @@ @@ -7,9 +7,41 @@
7 </ul> 7 </ul>
8 <div class="fav-content"> 8 <div class="fav-content">
9 <div class="fav-type"> 9 <div class="fav-type">
10 - {{# hasFavProduct}} 10 + <ul class="fav-product-list">
  11 + {{# hasFavProduct}}
  12 + <li>
  13 + <div class="fav-img-box">
  14 + <img src="{{imgUrl}}" alt=""/>
  15 + </div>
  16 + <div class="fav-info-list">
  17 + <h2>{{title}}</h2>
  18 + <div class="fav-price">
  19 + {{# discountPrice}}
  20 + <span class="new-price">{{.}}</span>
  21 + {{/ discountPrice}}
  22 + <span class="fav-price {{# discountPrice}}price-underline{{/ discountPrice}}">{{price}}</span>
  23 + </div>
11 24
12 - {{/ hasFavProduct}} 25 + {{# savePrice}}
  26 + <div class="save-price save-price-number">
  27 + 比收藏时降价了<span>{{.}}</span>
  28 + <span class="del-fav"></span>
  29 + </div>
  30 + {{/ savePrice}}
  31 +
  32 + {{^ savePrice}}
  33 + <div class="save-price">
  34 + {{# sellOut}}
  35 + <span class="sell-out">已售罄</span>
  36 + {{/ sellOut}}
  37 + <span class="del-fav"></span>
  38 + </div>
  39 + {{/ savePrice}}
  40 +
  41 + </div>
  42 + </li>
  43 + {{/ hasFavProduct}}
  44 + </ul>
13 45
14 {{^ hasFavProduct}} 46 {{^ hasFavProduct}}
15 <span class="fav-null">您暂无收藏任何商品</span> 47 <span class="fav-null">您暂无收藏任何商品</span>
@@ -18,7 +50,41 @@ @@ -18,7 +50,41 @@
18 </div> 50 </div>
19 <div class="fav-type hide"> 51 <div class="fav-type hide">
20 {{# hasFavBrand}} 52 {{# hasFavBrand}}
21 - 53 + <div class="fav-brand-swiper">
  54 + <div class="swiper-header">
  55 + <div class="swiper-logo">
  56 + <img src="{{brandImg}}" alt=""/>
  57 + </div>
  58 + <div class="brand-info">
  59 + <span class="brand-name">{{brandName}}</span>
  60 + <div class="brand-update">
  61 + {{# update}}
  62 + <span class="brand-new">上新<b>{{.}}</b></span>
  63 + {{/ update}}
  64 + {{# discount}}
  65 + <span class="brand-discount">折扣<b>{{.}}</b></span>
  66 + {{/ discount}}
  67 + </div>
  68 + </div>
  69 + <a href="{{link}}"></a>
  70 + </div>
  71 + <div id="swiper-container-{{id}}" class="swiper-container" data-id="{{id}}">
  72 + <ul class="swiper-wrapper swiper-wrapper-{{id}}">
  73 + {{# productList}}
  74 + <li class="swiper-slide">
  75 + <img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
  76 + <div class="brand-product">
  77 + <p class="{{# discount}}price-discount{{/ discount}}">
  78 + {{price}}
  79 + {{# discount}}<span>{{.}}{{/ discount}}<span>
  80 + </p>
  81 + </div>
  82 + <div class="swiper-lazy-preloader"></div>
  83 + </li>
  84 + {{/ productList}}
  85 + </ul>
  86 + </div>
  87 + </div>
22 {{/ hasFavBrand}} 88 {{/ hasFavBrand}}
23 89
24 {{^ hasFavBrand}} 90 {{^ hasFavBrand}}
@@ -33,60 +33,60 @@ @@ -33,60 +33,60 @@
33 </div> 33 </div>
34 <div class="order-type clearfix"> 34 <div class="order-type clearfix">
35 <a class="type-item" href="/home/order"> 35 <a class="type-item" href="/home/order">
36 - <span class="iconfont">&#xe620;</span>  
37 - <br>代付款 36 + <span class="iconfont">&#xe634;</span>
  37 + <br>待付款
38 </a> 38 </a>
39 <a class="type-item" href="/home/order"> 39 <a class="type-item" href="/home/order">
40 - <span class="iconfont">&#xe620;</span>  
41 - <br>代发货 40 + <span class="iconfont">&#xe63b;</span>
  41 + <br>待发货
42 </a> 42 </a>
43 <a class="type-item" href="/home/order"> 43 <a class="type-item" href="/home/order">
44 - <span class="iconfont">&#xe620;</span>  
45 - <br>代收货 44 + <span class="iconfont">&#xe633;</span>
  45 + <br>待收货
46 </a> 46 </a>
47 </div> 47 </div>
48 </div> 48 </div>
49 <div class="group-list"> 49 <div class="group-list">
50 <div class="list-item"> 50 <div class="list-item">
51 - <span class="iconfont icon">&#xe620;</span> 51 + <span class="iconfont icon">&#xe637;</span>
52 地址管理 52 地址管理
53 <span class="iconfont num">3 &#xe604;</span> 53 <span class="iconfont num">3 &#xe604;</span>
54 </div> 54 </div>
55 </div> 55 </div>
56 <div class="group-list"> 56 <div class="group-list">
57 <div class="list-item"> 57 <div class="list-item">
58 - <span class="iconfont icon">&#xe620;</span> 58 + <span class="iconfont icon">&#xe63a;</span>
59 优惠券 59 优惠券
60 <span class="iconfont num">{{coupon_num}} &#xe604;</span> 60 <span class="iconfont num">{{coupon_num}} &#xe604;</span>
61 </div> 61 </div>
62 <div class="list-item"> 62 <div class="list-item">
63 - <span class="iconfont icon">&#xe620;</span> 63 + <span class="iconfont icon">&#xe635;</span>
64 YOHO 64 YOHO
65 <span class="iconfont num">{{yoho_coin_num}} &#xe604;</span> 65 <span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
66 </div> 66 </div>
67 </div> 67 </div>
68 <div class="group-list"> 68 <div class="group-list">
69 <div class="list-item"> 69 <div class="list-item">
70 - <span class="iconfont icon">&#xe620;</span> 70 + <span class="iconfont icon">&#xe636;</span>
71 消息 71 消息
72 <span class="iconfont num">{{inbox_total}} &#xe604;</span> 72 <span class="iconfont num">{{inbox_total}} &#xe604;</span>
73 </div> 73 </div>
74 </div> 74 </div>
75 <div class="group-list"> 75 <div class="group-list">
76 <div class="list-item"> 76 <div class="list-item">
77 - <span class="iconfont icon">&#xe620;</span> 77 + <span class="iconfont icon">&#xe63c;</span>
78 在线客服 78 在线客服
79 <span class="iconfont num">&#xe604;</span> 79 <span class="iconfont num">&#xe604;</span>
80 </div> 80 </div>
81 </div> 81 </div>
82 <div class="group-list"> 82 <div class="group-list">
83 <div class="list-item"> 83 <div class="list-item">
84 - <span class="iconfont icon">&#xe620;</span> 84 + <span class="iconfont icon">&#xe639;</span>
85 帮助 85 帮助
86 <span class="iconfont num">&#xe604;</span> 86 <span class="iconfont num">&#xe604;</span>
87 </div> 87 </div>
88 </div> 88 </div>
89 89
90 - {{> me/recommend-for-you}} 90 + {{> product/recommend-for-you}}
91 </div> 91 </div>
92 {{> layout/footer}} 92 {{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="online-service-page yoho-page">
  3 + {{# service}}
  4 + <div class="question">
  5 + <div class="question-title">问题查询</div>
  6 + <div class="question-tab">
  7 + {{#tab}}
  8 + <span class="tab-item {{#current}}current{{/current}}" data-tab="{{tabid}}">{{tabname}}</span>
  9 + {{#iscut}}<span class="line"></span>{{/iscut}}
  10 + {{/tab}}
  11 + </div>
  12 + {{#question}}
  13 + <ul class="question-list {{#current}}current{{/current}}" data-tab-name="{{name}}">
  14 + {{#list}}
  15 + <li class="question-item">
  16 + <a href="{{link}}" title="{{title}}">
  17 + {{title}}
  18 + <span class="iconfont icon-yoho-enter">&#xe604;</span>
  19 + </a>
  20 + </li>
  21 + {{/list}}
  22 + </ul>
  23 + {{/question}}
  24 + </div>
  25 + {{/ service}}
  26 + <div class="connect-info">
  27 + <div class="connect-item connect-online">
  28 + <a href="http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&amp;configID=123576&amp;jid=9277320930" target="_blank" title="在线客服">
  29 + <span class="icon iconfont icon-chat">&#xe63c;</span>
  30 + 在线客服
  31 + <span class="iconfont icon-yoho-enter">&#xe604;</span>
  32 + </a>
  33 + </div>
  34 + <div class="connect-item connect-tel">
  35 + <a href="tel:400-889-9649" title="电话客服">
  36 + <span class="icon iconfont icon-tel">&#xe63e;</span>
  37 + 电话客服
  38 + <p>
  39 + 400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
  40 + </p>
  41 + </a>
  42 +
  43 + </div>
  44 + </div>
  45 +</div>
  46 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="online-service-detail-page yoho-page">
  3 + <div class="qa-list">
  4 + {{# list}}
  5 + <div class="question-item">
  6 + <div class="question">Q:{{q}}</div>
  7 + <div class="answer">{{a}}</div>
  8 + </div>
  9 + {{/ list}}
  10 + </div>
  11 +</div>
  12 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="order-detail-page yoho-page">
  3 + {{# orderDetail}}
  4 + <div id="order-detail" data-id="{{orderNum}}">
  5 + <section class="owner-info block">
  6 + <span class="iconfont">&#xe631;</span>
  7 + <div class="beside-icon">
  8 + <p class="name-phone">
  9 + {{name}}
  10 + <span>{{phoneNum}}</span>
  11 + </p>
  12 + <p class="address">
  13 + {{address}}
  14 + </p>
  15 + </div>
  16 + </section>
  17 +
  18 + <section class="order-status block">
  19 + <div class="status sub">
  20 + <span class="iconfont">&#xe632;</span>
  21 + <p class="beside-icon sub-content">
  22 + <span class="sub-title">{{orderStatus}}</span>
  23 + <span>订单编号:{{orderNum}}</span>
  24 + <span>下单时间:{{orderTime}}</span>
  25 + </p>
  26 + </div>
  27 + {{#if unreceived}}
  28 + <a class="logistics sub" href="{{logisticsUrl}}">
  29 + <span class="iconfont">&#xe630;</span>
  30 + <p class="beside-icon sub-content">
  31 + <span class="sub-title">物流信息</span>
  32 + <span>物流公司:{{logisticsCompany}}</span>
  33 + <span>快递单号:{{logisticsNum}}</span>
  34 + </p>
  35 + <span class="iconfont icon-right">&#xe614;</span>
  36 + </a>
  37 + {{/if}}
  38 + </section>
  39 +
  40 + <section class="goods block">
  41 + {{# goods}}
  42 + {{> me/order/good}}
  43 + {{/ goods}}
  44 + </section>
  45 +
  46 + <ul class="cost block">
  47 + <li>
  48 + 商品总金额
  49 + <span>¥{{sumPrice}}</span>
  50 + </li>
  51 + <li>
  52 + 活动金额
  53 + <span>-¥{{salePrice}}</span>
  54 + </li>
  55 + <li>
  56 + 运费
  57 + <span>+¥{{freight}}</span>
  58 + </li>
  59 + <li>
  60 + YOHO币
  61 + <span>-¥{{yohoCoin}}</span>
  62 + </li>
  63 + <li>
  64 + 实付金额
  65 + <span>¥{{price}}</span>
  66 + </li>
  67 + </ul>
  68 +
  69 + <div class="opt block">
  70 + {{#unless unreceived}}
  71 + {{#unless unpaid}}
  72 + <span class="btn btn-del">删除订单</span>
  73 + {{/unless}}
  74 + {{/unless}}
  75 +
  76 + {{#if unpaid}}
  77 + <span class="btn btn-cancel">取消订单</span>
  78 + <a href="{{payUrl}}">
  79 + <span class="btn btn-pay">立即付款</span>
  80 + </a>
  81 + {{/if}}
  82 +
  83 + {{#if unreceived}}
  84 + <a href="{{logisticsUrl}}">
  85 + <span class="btn btn-check-logistics">查看物流</span>
  86 + </a>
  87 + {{/if}}
  88 + </div>
  89 + </div>
  90 + {{/ orderDetail}}
  91 +</div>
  92 +{{> layout/footer}}
@@ -18,9 +18,7 @@ @@ -18,9 +18,7 @@
18 18
19 <div id="order-container" class="order-container"> 19 <div id="order-container" class="order-container">
20 <div class="all orders"> 20 <div class="all orders">
21 - {{#each orders}}  
22 - {{> me/order/order}}  
23 - {{/each}} 21 + {{> me/order/orders}}
24 </div> 22 </div>
25 <div class="unpaid orders hide"></div> 23 <div class="unpaid orders hide"></div>
26 <div class="unshipped orders hide"></div> 24 <div class="unshipped orders hide"></div>
@@ -33,6 +33,9 @@ @@ -33,6 +33,9 @@
33 </div> 33 </div>
34 {{/ suggestContent}} 34 {{/ suggestContent}}
35 </div> 35 </div>
  36 + <a class="create-new-suggest" href="#">
  37 + 反馈问题<span>(功能意见,界面意见)</span>
  38 + </a>
36 {{/ suggest}} 39 {{/ suggest}}
37 </div> 40 </div>
38 {{> layout/footer}} 41 {{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="yoho-suggest-sub-page yoho-page">
  3 + {{# suggestSub}}
  4 + <div class="suggest-sub-form">
  5 + <textarea name="" id="suggest-textarea" placeholder="请输入意见反馈,我们会以消息形式回复您的建议或意见,改进产品体验,谢谢!"></textarea>
  6 + <div class="img-form">
  7 + <span class="img-add">
  8 + <input id="upload-img" type="file" name="fileselect[]" multiple />
  9 + </span>
  10 + </div>
  11 + </div>
  12 + {{/ suggestSub}}
  13 +</div>
  14 +{{> layout/footer}}
  1 +{{#if tabs}}
1 <div class="s-goods-nav goods-nav"> 2 <div class="s-goods-nav goods-nav">
2 <ul class="swiper-wrapper clearfix"> 3 <ul class="swiper-wrapper clearfix">
3 - {{# tabs}} 4 + {{# tabs}}
4 {{# title}} 5 {{# title}}
5 <li class="swiper-slide nav-item" data-sort="{{ params}}" data-id="{{ id}}"> 6 <li class="swiper-slide nav-item" data-sort="{{ params}}" data-id="{{ id}}">
6 <span>{{ name}}</span> 7 <span>{{ name}}</span>
7 </li> 8 </li>
8 {{/ title}} 9 {{/ title}}
9 - {{/ tabs}} 10 + {{/ tabs}}
10 </ul> 11 </ul>
11 </div> 12 </div>
12 - 13 +{{/if}}
13 <div class="rank-main"> 14 <div class="rank-main">
14 <ul> 15 <ul>
15 {{# goods}} 16 {{# goods}}
1 {{> home/floor_header_more}} 1 {{> home/floor_header_more}}
2 <div class="goods-category"> 2 <div class="goods-category">
3 {{# big_image}} 3 {{# big_image}}
  4 + {{#if list}}
  5 + <div class="category-swiper">
  6 + <ul class="swiper-wrapper">
  7 + {{# list}}
  8 + <li class="swiper-slide">
  9 + <a href="{{url}}">
  10 + <img class="lazy" data-original="{{img}}" alt="{{title}}">
  11 + </a>
  12 + </li>
  13 + {{/ list}}
  14 + </ul>
  15 + <div class="swiper-pagination">
  16 + <div class="pagination-inner clearfix">
  17 + </div>
  18 + </div>
  19 + </div>
  20 + {{^}}
4 <div class="category-swiper"> 21 <div class="category-swiper">
5 - <ul class="swiper-wrapper">  
6 - {{# list}}  
7 - <li class="swiper-slide">  
8 - <a href="{{url}}">  
9 - <img class="lazy" data-original="{{img}}" alt="{{title}}">  
10 - </a>  
11 - </li>  
12 - {{/ list}}  
13 - </ul>  
14 - <div class="swiper-pagination">  
15 - <div class="pagination-inner clearfix">  
16 - </div>  
17 - </div> 22 + <a href={{url}}>
  23 + <img class="lazy" data-original="{{img}}" alt="{{title}}">
  24 + </a>
18 </div> 25 </div>
  26 + {{/if}}
19 {{/ big_image}} 27 {{/ big_image}}
20 <ul class="category-list clearfix"> 28 <ul class="category-list clearfix">
21 {{# list}} 29 {{# list}}
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="float-layer hide" id="float-layer-app"> 2 <div class="float-layer hide" id="float-layer-app">
3 <div class="float-layer-left"> 3 <div class="float-layer-left">
4 <span class="yoho-icon iconfont">&#xe60d;</span> 4 <span class="yoho-icon iconfont">&#xe60d;</span>
5 - <p>新用户首单减10</p> 5 + <p>新用户送千元礼包</p>
6 </div> 6 </div>
7 <a href="javascript:void(0);" id="float-layer-close" > 7 <a href="javascript:void(0);" id="float-layer-close" >
8 <i class="close-icon iconfont">&#xe623;</i> 8 <i class="close-icon iconfont">&#xe623;</i>
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 a.async=1; 28 a.async=1;
29 a.src=j; 29 a.src=j;
30 m.parentNode.insertBefore(a,m); 30 m.parentNode.insertBefore(a,m);
31 - })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.12/yas.js','_yas'); 31 + })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.13/yas.js','_yas');
32 </script> 32 </script>
33 {{> layout/use}} 33 {{> layout/use}}
34 {{> layout/analysis}} 34 {{> layout/analysis}}
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 a.async=1; 28 a.async=1;
29 a.src=j; 29 a.src=j;
30 m.parentNode.insertBefore(a,m); 30 m.parentNode.insertBefore(a,m);
31 - })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.12/yas.js','_yas'); 31 + })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.13/yas.js','_yas');
32 </script> 32 </script>
33 33
34 {{> layout/use}} 34 {{> layout/use}}
@@ -9,5 +9,8 @@ @@ -9,5 +9,8 @@
9 {{#navTitle}} 9 {{#navTitle}}
10 <p class="nav-title">{{.}}</p> 10 <p class="nav-title">{{.}}</p>
11 {{/navTitle}} 11 {{/navTitle}}
  12 + {{# navBtn}}
  13 + <span class="nav-btn">{{.}}</span>
  14 + {{/ navBtn}}
12 </header> 15 </header>
13 {{/pageHeader}} 16 {{/pageHeader}}
@@ -201,7 +201,6 @@ @@ -201,7 +201,6 @@
201 </script> 201 </script>
202 {{/if}} 202 {{/if}}
203 {{!-- 个人中心 --}} 203 {{!-- 个人中心 --}}
204 -{{!-- 个人中心首页 --}}  
205 {{#if myIndexPage}} 204 {{#if myIndexPage}}
206 <script> 205 <script>
207 seajs.use('js/me/index'); 206 seajs.use('js/me/index');
@@ -212,16 +211,30 @@ @@ -212,16 +211,30 @@
212 seajs.use('js/me/order'); 211 seajs.use('js/me/order');
213 </script> 212 </script>
214 {{/if}} 213 {{/if}}
215 -  
216 -{{!-- 个人中心: 商品收藏&品牌收藏 --}} 214 +{{#if orderDetailPage}}
  215 +<script>
  216 + seajs.use('js/me/order-detail');
  217 +</script>
  218 +{{/if}}
217 {{#if favPage}} 219 {{#if favPage}}
  220 +{{!-- 个人中心: 收藏 --}}
218 <script> 221 <script>
219 seajs.use('js/me/fav'); 222 seajs.use('js/me/fav');
220 </script> 223 </script>
221 {{/if}} 224 {{/if}}
222 - 225 +{{!-- 个人中心: 意见反馈 --}}
  226 +{{#if suggestPage}}
  227 +<script>
  228 + seajs.use('js/me/suggest');
  229 +</script>
  230 +{{/if}}
223 {{#if couponsPage}} 231 {{#if couponsPage}}
224 <script> 232 <script>
225 seajs.use('js/me/coupons'); 233 seajs.use('js/me/coupons');
226 </script> 234 </script>
  235 +{{/if}}
  236 +{{#if onlineServicePage}}
  237 +<script>
  238 + seajs.use('js/me/online-service');
  239 +</script>
227 {{/if}} 240 {{/if}}
1 -<div class="order" data-id="{{orderNum}}"> 1 +<div class="order" data-id="{{orderNum}}" data-href="{{detailUrl}}">
2 <header class="header"> 2 <header class="header">
3 订单编号:{{orderNum}} 3 订单编号:{{orderNum}}
4 - <span class="trading-status">{{tradingStatus}}</span> 4 + <span class="order-status">{{orderStatus}}</span>
5 </header> 5 </header>
6 <section class="order-goods"> 6 <section class="order-goods">
7 {{# goods}} 7 {{# goods}}
@@ -12,16 +12,27 @@ @@ -12,16 +12,27 @@
12 共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span> 12 共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
13 </footer> 13 </footer>
14 14
15 - {{#if unpaid}}  
16 - <div class="order-opt"> 15 + {{!-- 对应订单状态的操作逻辑 --}}
  16 +
  17 + {{!-- 完成和取消订单显示删除按钮 --}}
  18 + <div class="order-opt">
  19 + {{#unless unpaid}}
  20 + {{#unless unreceived}}
  21 + <span class="btn del">删除订单</span>
  22 + {{/unless}}
  23 + {{/unless}}
  24 +
  25 + {{#if unpaid}}
17 <span class="btn cancel">取消订单</span> 26 <span class="btn cancel">取消订单</span>
18 - <span class="btn pay">立即付款</span>  
19 - </div>  
20 - {{/if}} 27 + <a class="locHref" href="{{payUrl}}">
  28 + <span class="btn pay">立即付款</span>
  29 + </a>
  30 + {{/if}}
21 31
22 - {{#with unreceived}}  
23 - <div class="order-opt">  
24 - <a class="check-logistics" href="{{.}}">查看物流</a>  
25 - </div>  
26 - {{/with}} 32 + {{#if unreceived}}
  33 + <a class="locHref" href="{{logisticsUrl}}">
  34 + <span class="btn check-logistics">查看物流</span>
  35 + </a>
  36 + {{/if}}
  37 + </div>
27 </div> 38 </div>
  1 +{{#if walkwayUrl}}
  2 + <div class="no-order">
  3 + <span class="iconfont">&#xe632;</span>
  4 + <span>你还没有订单</span>
  5 + <a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
  6 + </div>
  7 +{{^}}
  8 + {{#each orders}}
  9 + {{> me/order/order}}
  10 + {{/each}}
  11 +{{/if}}
@@ -2,17 +2,17 @@ @@ -2,17 +2,17 @@
2 <div class="recommend-for-you"> 2 <div class="recommend-for-you">
3 <div class="title">为您优选新品</div> 3 <div class="title">为您优选新品</div>
4 <div class="swiper-recommend"> 4 <div class="swiper-recommend">
5 - <div class="swiper-wrapper"> 5 + <ul class="swiper-wrapper">
6 {{#recommendList}} 6 {{#recommendList}}
7 - <div class="swiper-slider"> 7 + <li class="swiper-slider">
8 <img class="img-box" src="{{thumb}}"> 8 <img class="img-box" src="{{thumb}}">
9 <div class="price"> 9 <div class="price">
10 <span class="sale-price"{{salePrice}}</span> 10 <span class="sale-price"{{salePrice}}</span>
11 <span class="old-price"{{price}}</span> 11 <span class="old-price"{{price}}</span>
12 </div> 12 </div>
13 - </div> 13 + </li>
14 {{/recommendList}} 14 {{/recommendList}}
15 - </div> 15 + </ul>
16 </div> 16 </div>
17 </div> 17 </div>
18 {{/ recommendForYou}} 18 {{/ recommendForYou}}
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use home\GradeModel; 4 use home\GradeModel;
  5 +use home\OrderModel;
5 use Plugin\Helpers; 6 use Plugin\Helpers;
6 7
7 /** 8 /**
@@ -15,24 +16,24 @@ use Plugin\Helpers; @@ -15,24 +16,24 @@ use Plugin\Helpers;
15 */ 16 */
16 class HomeController extends AbstractAction 17 class HomeController extends AbstractAction
17 { 18 {
  19 +
18 /** 20 /**
19 * 个人中心入口 21 * 个人中心入口
20 */ 22 */
21 - public function indexAction()  
22 - {  
23 - // 设置网站标题 23 + public function indexAction() {
  24 + // 设置网站标题
24 $this->setTitle('个人中心'); 25 $this->setTitle('个人中心');
25 - $this->setNavHeader('个人中心', true, SITE_MAIN); 26 + $this->setNavHeader('个人中心', true, SITE_MAIN);
26 27
27 // $uid = $this->getUid(); 28 // $uid = $this->getUid();
28 - $uid = 967016; 29 + $uid = 8826435;
29 $data = \Index\UserModel::getUserProfileData($uid); 30 $data = \Index\UserModel::getUserProfileData($uid);
30 $data += \Index\UserModel::getInfoNumData($uid); 31 $data += \Index\UserModel::getInfoNumData($uid);
31 32
32 - // 优选新品数据  
33 - $channel = Helpers::getChannelByCookie();  
34 - $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);  
35 - // print_r($data); 33 + // 优选新品数据
  34 + $channel = Helpers::getChannelByCookie();
  35 + $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
  36 + // print_r($data);
36 37
37 $data['myIndexPage'] = true; 38 $data['myIndexPage'] = true;
38 $data['pageFooter'] = true; 39 $data['pageFooter'] = true;
@@ -45,10 +46,15 @@ class HomeController extends AbstractAction @@ -45,10 +46,15 @@ class HomeController extends AbstractAction
45 */ 46 */
46 public function ordersAction() 47 public function ordersAction()
47 { 48 {
48 - // $uid = $this->getUid();  
49 - // $type = $this->get('type', 1); 49 + // 设置网站标题
  50 + $this->setTitle('我的订单');
  51 + $this->setNavHeader('我的订单', true, SITE_MAIN);
50 52
51 - // $orders = \Index\UserModel::getUserOrderData(967016, $type); 53 + $uid = $this->getUid();
  54 + $uid = 8826435;
  55 + $type = $this->get('type', 1);
  56 +
  57 + $order = \Index\UserModel::getUserOrderData($uid, $type);
52 58
53 $order = array( 59 $order = array(
54 'orders' => array( 60 'orders' => array(
@@ -84,22 +90,20 @@ class HomeController extends AbstractAction @@ -84,22 +90,20 @@ class HomeController extends AbstractAction
84 ); 90 );
85 91
86 $this->_view->display('order', array('order' => $order, 'orderPage' => true)); 92 $this->_view->display('order', array('order' => $order, 'orderPage' => true));
87 - // print_r($orders);  
88 } 93 }
89 94
90 - /**  
91 - * 用户收藏的商品  
92 - */  
93 - public function favoriteAction()  
94 - {  
95 - $uid = $this->getUid(); 95 + /**
  96 + * 用户收藏的商品
  97 + */
  98 + public function favoriteAction() {
  99 + $uid = $this->getUid();
96 100
97 - $favProducts = \Index\UserModel::getFavProductData($uid); 101 + $favProducts = \Index\UserModel::getFavProductData($uid);
98 102
99 - //print_r($favProducts); 103 + //print_r($favProducts);
100 104
101 $this->_view->display('favorite', array( 105 $this->_view->display('favorite', array(
102 - 'favPage' => true, 106 + 'favPage' => true, //加载js
103 'pageHeader' => array( 107 'pageHeader' => array(
104 'navBack' => true, 108 'navBack' => true,
105 'navTitle' => '我的收藏', 109 'navTitle' => '我的收藏',
@@ -107,166 +111,307 @@ class HomeController extends AbstractAction @@ -107,166 +111,307 @@ class HomeController extends AbstractAction
107 ), 111 ),
108 'pageFooter' => true, 112 'pageFooter' => true,
109 'favorite' => true, 113 'favorite' => true,
110 - 'hasFavProduct' => false,  
111 - 'hasFavBrand' => false 114 + 'hasFavProduct' => array(
  115 + '0' => array(
  116 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  117 + 'title' => 'adidas Originals ZX FLUXM22508 ',
  118 + 'price' => '¥800',
  119 + 'discountPrice' => false,
  120 + 'savePrice' => false,
  121 + 'sellOut' => true
  122 + ),
  123 + '1' => array(
  124 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  125 + 'title' => 'adidas Originals ZX FLUXM22508 ',
  126 + 'price' => '¥800',
  127 + 'discountPrice' => '¥500',
  128 + 'savePrice' => '¥300',
  129 + 'sellOut' => false
  130 + )
  131 + ),
  132 + 'hasFavBrand' => array(
  133 + '0' => array(
  134 + 'id'=> '1',
  135 + 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  136 + 'brandName' => 'VANS',
  137 + 'update' => 12,
  138 + 'discount' => 10,
  139 + 'link' => '#',
  140 + 'productList' => array(
  141 + '0' => array(
  142 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  143 + 'price' => '¥240',
  144 + 'discount' => '¥240'
  145 + ),
  146 + '1' => array(
  147 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  148 + 'price' => '¥240',
  149 + 'discount' => '¥240'
  150 + ),
  151 + '2' => array(
  152 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  153 + 'price' => '¥240',
  154 + 'discount' => '¥240'
  155 + ),
  156 + '3' => array(
  157 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  158 + 'price' => '¥240',
  159 + 'discount' => '¥240'
  160 + )
  161 + )
  162 + ),
  163 + '1' => array(
  164 + 'id'=> '2',
  165 + 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  166 + 'brandName' => 'VANS',
  167 + 'update' => 12,
  168 + 'discount' => 10,
  169 + 'link' => '#',
  170 + 'productList' => array(
  171 + '0' => array(
  172 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  173 + 'price' => '¥240',
  174 + 'discount' => '¥240'
  175 + ),
  176 + '1' => array(
  177 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  178 + 'price' => '¥240',
  179 + 'discount' => '¥240'
  180 + ),
  181 + '2' => array(
  182 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  183 + 'price' => '¥240',
  184 + 'discount' => '¥240'
  185 + ),
  186 + '3' => array(
  187 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  188 + 'price' => '¥240',
  189 + 'discount' => '¥240'
  190 + )
  191 + )
  192 + ),
  193 + '2' => array(
  194 + 'id'=> '3',
  195 + 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  196 + 'brandName' => 'VANS',
  197 + 'update' => 12,
  198 + 'discount' => 10,
  199 + 'link' => '#',
  200 + 'productList' => array(
  201 + 'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  202 + 'price' => '¥240',
  203 + 'discount' => false
  204 + )
  205 + )
  206 + )
112 )); 207 ));
113 - } 208 + }
114 209
115 - /**  
116 - * 用户收藏的品牌  
117 - */  
118 - public function favoritebrandAction()  
119 - {  
120 - $uid = $this->getUid();  
121 - $gender = Helpers::getGenderByCookie(); 210 + /**
  211 + * 用户收藏的品牌
  212 + */
  213 + public function favoritebrandAction() {
  214 + $uid = $this->getUid();
  215 + $gender = Helpers::getGenderByCookie();
122 216
123 - $favBrands = \Index\UserModel::getFavBrandData($uid, $gender); 217 + $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
124 218
125 - print_r($favBrands);  
126 - } 219 + print_r($favBrands);
  220 + }
127 221
128 - /**  
129 - * 个人信息  
130 - */  
131 - public function personalDetailsAction()  
132 - { 222 + /**
  223 + * 个人信息
  224 + */
  225 + public function personalDetailsAction() {
133 $this->setTitle('个人信息'); 226 $this->setTitle('个人信息');
134 - $this->setNavHeader('个人信息', true, SITE_MAIN); 227 + $this->setNavHeader('个人信息', true, SITE_MAIN);
135 228
136 - // $uid = $this->getUid();  
137 - $uid = 967016;  
138 - $data = \Index\UserModel::getUserProfileData($uid);  
139 - $data['pageFooter'] = true; 229 + // $uid = $this->getUid();
  230 + $uid = 967016;
  231 + $data = \Index\UserModel::getUserProfileData($uid);
  232 + $data['pageFooter'] = true;
140 $this->_view->display('personal-details', $data); 233 $this->_view->display('personal-details', $data);
  234 + }
141 235
  236 + /**
  237 + * YOHO币
  238 + */
  239 + public function currencyAction() {
  240 + // $uid = $this->getUid();
  241 + $this->setNavHeader('YOHO币', true, false);
142 242
143 - }  
144 -  
145 - /**  
146 - * YOHO币  
147 - */  
148 - public function currencyAction()  
149 - {  
150 - // $uid = $this->getUid();  
151 - $this->setNavHeader('YOHO币', true, false);  
152 -  
153 - $uid = 967016;  
154 - $currency = \Index\UserModel::getYohoCoinData($uid);  
155 -  
156 - $this->_view->display('currency', $currency);  
157 - } 243 + $uid = 967016;
  244 + $currency = \Index\UserModel::getYohoCoinData($uid);
158 245
159 - /**  
160 - * 优惠券  
161 - */  
162 - public function couponsAction()  
163 - { 246 + $this->setTitle('优惠券');
  247 + $this->setNavHeader('优惠券', true, SITE_MAIN);
164 // $uid = $this->getUid(); 248 // $uid = $this->getUid();
165 -  
166 - $uid = 967016;  
167 - $status = $this->get('status', 0); 249 + $uid = 8826435;
168 $coupons = array( 250 $coupons = array(
169 - 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status), 251 + 'couponsUrl' => array(
  252 + \Index\UserModel::getCouponData($uid, 0),
  253 + \Index\UserModel::getCouponData($uid, 1),
  254 + ),
170 'couponsPage' => true 255 'couponsPage' => true
171 ); 256 );
  257 +
  258 + print_r($coupons);
172 $this->_view->display('coupons', $coupons); 259 $this->_view->display('coupons', $coupons);
  260 + }
173 261
174 - } 262 + /**
  263 + * 优惠券
  264 + */
  265 + public function couponsAction() {
175 266
176 - /**  
177 - * 我的消息  
178 - */  
179 - public function messageAction()  
180 - {  
181 - // $uid = $this->getUid();  
182 - $page = $this->get('page', 0);  
183 - $size = $this->get('size', 10); 267 + $this->setTitle('优惠券');
  268 + $this->setNavHeader('优惠券', true, SITE_MAIN);
  269 + // $uid = $this->getUid();
  270 + $uid = 8826435;
  271 + $status = $this->get('status', 0);
  272 + $coupons = array(
  273 + 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
  274 + 'couponsPage' => true
  275 + );
  276 +
  277 + print_r($coupons);
  278 + $this->_view->display('coupons', $coupons);
  279 + }
184 280
185 - $uid = 967016;  
186 - $messages = \Index\UserModel::getMessageData($uid, $page, $size); 281 + /**
  282 + * 我的消息
  283 + */
  284 + public function messageAction() {
  285 + // $uid = $this->getUid();
  286 + $page = $this->get('page', 0);
  287 + $size = $this->get('size', 10);
187 288
188 - print_r($messages); 289 + $uid = 967016;
  290 + $messages = \Index\UserModel::getMessageData($uid, $page, $size);
189 291
190 - } 292 + print_r($messages);
  293 + }
191 294
192 - /**  
193 - * 地址管理  
194 - */  
195 - public function addressAction()  
196 - {  
197 - // 设置网站标题 295 + /**
  296 + * 地址管理
  297 + */
  298 + public function addressAction() {
  299 + // 设置网站标题
198 $this->setTitle('地址管理'); 300 $this->setTitle('地址管理');
199 $this->setNavHeader('地址管理', true, SITE_MAIN); 301 $this->setNavHeader('地址管理', true, SITE_MAIN);
200 302
201 // $uid = $this->getUid(); 303 // $uid = $this->getUid();
202 $uid = 967016; 304 $uid = 967016;
203 305
204 - $address = \Index\UserModel::getAddressData($uid); 306 + $address = \Index\UserModel::getAddressData($uid);
  307 + $addressList = \Index\UserModel::getAddressListData($uid);
205 308
206 - // print_r($address); 309 + // print_r($address);
207 310
208 $this->_view->display('address', array( 311 $this->_view->display('address', array(
209 'addressPage' => true, 312 'addressPage' => true,
210 'pageFooter' => true, 313 'pageFooter' => true,
211 - 'address' => $address 314 + 'address' => $address,
  315 + 'addressList' => $addressList
212 )); 316 ));
213 - } 317 + }
214 318
215 /** 319 /**
216 - * 修改地址 320 + * 修改地址或者添加新地址
217 */ 321 */
218 - public function editAddressAction()  
219 - {  
220 - // 设置网站标题  
221 - $this->setTitle('修改地址');  
222 - $this->setNavHeader('修改地址', true, SITE_MAIN); 322 + public function saveAddressAction() {
  323 + $result = array();
  324 +
  325 + if ($this->isAjax()) {
  326 + // $uid = $this->getUid();
  327 + $uid = 967016;
  328 + $address = $this->post('address', '');
  329 + $area_code = $this->post('area_code', '');
  330 + $consignee = $this->post('consignee', '');
  331 + $email = $this->post('email', '');
  332 + $id = $this->post('id', null);
  333 + $mobile = $this->post('mobile', '');
  334 + $zip_code = $this->post('zip_code', '');
  335 +
  336 + $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
  337 + }
  338 +
  339 + if (empty($result)) {
  340 + echo ' ';
  341 + } else {
  342 + $this->echoJson($result);
  343 + }
  344 + }
223 345
224 - // $uid = $this->getUid();  
225 - $uid = 967016; 346 + /**
  347 + * 设置默认地址
  348 + */
  349 + public function defaultAddressAction() {
  350 + $result = array();
  351 +
  352 + if ($this->isAjax()) {
  353 + // $uid = $this->getUid();
  354 + $uid = 967016;
  355 + $id = $this->post('id', '');
  356 +
  357 + $result = \Index\UserModel::setDefaultAddress($uid, $id);
  358 + }
  359 +
  360 + if (empty($result)) {
  361 + echo ' ';
  362 + } else {
  363 + $this->echoJson($result);
  364 + }
  365 + }
226 366
227 - $address = \Index\UserModel::getAddressData($uid); 367 + //在线客服
  368 + public function onlineServiceAction() {
  369 + // 设置网站标题
  370 + $this->setTitle('在线客服');
  371 + $this->setNavHeader('在线客服', true, SITE_MAIN);
228 372
229 - // print_r($address); 373 + $service = home\OnlineModel::getOnlineServiceInfo();
230 374
231 - $this->_view->display('edit_address', array(  
232 - 'editAddressPage' => true,  
233 - 'pageFooter' => true,  
234 - 'address' => $address 375 + $this->_view->display('online_service', array(
  376 + 'onlineServicePage' => true,
  377 + // 'pageFooter' => true,
  378 + 'service' => $service
235 )); 379 ));
236 } 380 }
237 381
238 - /**  
239 - * 在线客服  
240 - */  
241 - public function onlineServiceAction()  
242 - {  
243 - $service = \Index\UserModel::getOnlineServiceData();  
244 -  
245 - print_r($service);  
246 - } 382 + //在线客服-具体详情
  383 + public function onlineServiceDetailAction() {
  384 + $service = array();
  385 + $cateId = $this->get('cateId', 0);
  386 + $cateName = $this->get('cateName', '');
  387 + if ($cateId > 0) {
  388 + $service = home\OnlineModel::getOnlineServiceDetail($cateId);
  389 + }
  390 + $this->setTitle('在线客服');
  391 + $this->setNavHeader($cateName, true, '');
  392 + $this->_view->display('online_service_detail', $service);
  393 + }
247 394
248 - /**  
249 - * 我的逛  
250 - */  
251 - public function myGuangAction()  
252 - {  
253 - echo 'My Guang';  
254 - } 395 + /**
  396 + * 我的逛
  397 + */
  398 + public function myGuangAction() {
  399 + echo 'My Guang';
  400 + }
255 401
256 - /**  
257 - * 意见反馈  
258 - */  
259 - public function suggestAction()  
260 - {  
261 - $udid = $this->getUdid();  
262 - $page = $this->get('page', 1);  
263 - $limit = $this->get('limit', 30); 402 + /**
  403 + * 意见反馈
  404 + */
  405 + public function suggestAction() {
  406 + $udid = $this->getUdid();
  407 + $page = $this->get('page', 1);
  408 + $limit = $this->get('limit', 30);
264 409
265 - $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit); 410 + $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
266 411
267 - //print_r($suggest); 412 + //print_r($suggest);
268 $this->_view->display('suggest', array( 413 $this->_view->display('suggest', array(
269 - 'suggestPage' => true, 414 + 'suggestPage' => true, //加载js
270 'pageHeader' => array( 415 'pageHeader' => array(
271 'navBack' => true, 416 'navBack' => true,
272 'navTitle' => '意见反馈' 417 'navTitle' => '意见反馈'
@@ -294,8 +439,33 @@ class HomeController extends AbstractAction @@ -294,8 +439,33 @@ class HomeController extends AbstractAction
294 'bad' => false) 439 'bad' => false)
295 ) 440 )
296 )); 441 ));
  442 + }
297 443
298 - } 444 +
  445 + /**
  446 + * 意见反馈-提交表单
  447 + */
  448 + public function suggest_subAction()
  449 + {
  450 + $udid = $this->getUdid();
  451 + $page = $this->get('page', 1);
  452 + $limit = $this->get('limit', 30);
  453 +
  454 + $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
  455 +
  456 + //print_r($suggest);
  457 + $this->_view->display('suggest_sub', array(
  458 + 'suggestPage' => true, //加载js
  459 + 'pageHeader' => array(
  460 + 'navBack' => true,
  461 + 'navTitle' => '反馈问题',
  462 + 'navBtn' => '提交'
  463 + ),
  464 + 'suggestSub' => true,
  465 + 'pageFooter' => true
  466 + ));
  467 +
  468 + }
299 469
300 /** 470 /**
301 * 异步保存意见反馈数据 471 * 异步保存意见反馈数据
@@ -306,45 +476,131 @@ class HomeController extends AbstractAction @@ -306,45 +476,131 @@ class HomeController extends AbstractAction
306 $uid = $this->getUid(); 476 $uid = $this->getUid();
307 $content = $this->post('content', ''); 477 $content = $this->post('content', '');
308 $suggest_type = $this->get('suggest_type', 2); 478 $suggest_type = $this->get('suggest_type', 2);
  479 + $result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
  480 +
  481 + $this->echoJson($result);
  482 + }
  483 + }
  484 +
  485 + /**
  486 + * 会员等级展示页
  487 + */
  488 + public function gradeAction() {
  489 + //设置网站seo信息
  490 + $this->setTitle('会员等级');
  491 + //显示网站导航头部信息
  492 + $this->setNavHeader('会员等级');
  493 +
  494 + $gender = Helpers::getGenderByCookie();
  495 + $channel = Helpers::getChannelByCookie();
  496 + $uid = $this->getUid();
  497 + $uid = '7566245'; //临时测试用
  498 + $data = GradeModel::getGrade($gender, $channel, $uid);
  499 + $data['pageFooter'] = true;
  500 + $this->_view->display('vip-grade', $data);
  501 + }
  502 +
  503 + /*
  504 + * 会员特权查看页
  505 + */
  506 + public function preferentialAction() {
  507 + //设置网站seo信息
  508 + $this->setTitle('会员等级');
  509 + //显示网站导航头部信息
  510 + $this->setNavHeader('会员特权详情');
  511 +
  512 + $channel = Helpers::getChannelByCookie();
  513 + $uid = $this->getUid();
  514 + $data = GradeModel::getPreferential($channel, $uid);
  515 + $data['pageFooter'] = true;
  516 + $this->_view->display('privilege', $data);
  517 + }
  518 +
  519 + /*
  520 + * 我的订单页面
  521 + */
  522 + public function orderAction() {
  523 + //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
  524 + $type = $this->get('type', 1);
  525 + $page = $this->get('page', 1);
  526 + $limit = $this->get('limit', 10);
  527 + $gender = Helpers::getGenderByCookie();
  528 + $yh_channel = $this->get('yh_channel', 1);
  529 + $uid = $this->getUid();
  530 + $uid = '7566245'; //测试用
  531 + $this -> setTitle('我的订单');
  532 + $this -> setNavHeader('我的订单');
  533 + //调用模型层getOrder方法获得并处理数据
  534 + $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
  535 + //如果没有订单数据,就给一个随便逛逛链接
  536 + $order = array();
  537 + if (!empty($data)) {
  538 + $order['orders'] = $data;
  539 + } else {
  540 + $order['walkwayUrl'] = 'http://www.baidu.com';
  541 + }
  542 +
  543 + //渲染模板
  544 + $this->_view->display('order', array(
  545 + 'order' => $order,
  546 + 'orderPage' => true,
  547 + 'pageFooter' => true
  548 + ));
  549 + }
309 550
310 - $result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type); 551 + /*
  552 + * 我的订单-处理ajax请求页面(切换订单状态)
  553 + */
  554 + public function getOrdersAction() {
311 555
312 - $this->echoJson($result);  
313 - } 556 + //判断是不是ajax请求
  557 + if (!$this->isAjax()) {
  558 + $this->error();
  559 + }
  560 + self::orderAction();
  561 + }
314 562
315 - }  
316 -  
317 - /**  
318 - * 会员等级展示页  
319 - */  
320 - public function gradeAction(){  
321 - //设置网站seo信息  
322 - $this->setTitle('会员等级');  
323 - //显示网站导航头部信息  
324 - $this->setNavHeader('会员等级');  
325 -  
326 - $gender = Helpers::getGenderByCookie();  
327 - $channel = Helpers::getChannelByCookie();  
328 - $uid = $this -> getUid();  
329 - $uid = '7566245';//临时测试用  
330 - $data = GradeModel::getGrade($gender,$channel,$uid);  
331 - $data['pageFooter'] = true;  
332 - $this -> _view -> display('vip-grade',$data);  
333 - }  
334 - /*  
335 - *会员特权查看页  
336 - */  
337 - public function preferentialAction(){  
338 - //设置网站seo信息  
339 - $this->setTitle('会员等级');  
340 - //显示网站导航头部信息  
341 - $this->setNavHeader('会员特权详情');  
342 -  
343 - $channel = Helpers::getChannelByCookie();  
344 - $uid = $this -> getUid();  
345 - $data = GradeModel::getPreferential($channel,$uid);  
346 - $data['pageFooter'] = true;  
347 - $this -> _view -> display('privilege',$data);  
348 - }  
349 - 563 + public function orderDetailAction()
  564 + {
  565 + $data = array(
  566 + 'name' => '毛毛莉Lydia',
  567 + 'phoneNum' => '18600001133',
  568 + 'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
  569 + 'orderStatus' => '订单取消',
  570 + 'orderNum' => '418358063',
  571 + 'orderTime' => '2014-03-10 17:25:10',
  572 +
  573 + 'orderCancel' => true,
  574 +
  575 + 'goods' => array(
  576 + array(
  577 + 'id' => 1,
  578 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  579 + 'name' => 'Adidas Originals ZX FLUXM22508',
  580 + 'color' => '黄',
  581 + 'size' => '43',
  582 + 'price' => '699.00',
  583 + 'count' => '2'
  584 + ),
  585 + array(
  586 + 'id' => 1,
  587 + 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  588 + 'name' => 'B.Duck浴室玩伴mini浮水鸭',
  589 + 'gift' => true,
  590 + 'color' => '黄',
  591 + 'size' => '43',
  592 + 'price' => '0.00',
  593 + 'count' => '1'
  594 + )
  595 + ),
  596 +
  597 + 'sumPrice' => 799,
  598 + 'salePrice' => 80,
  599 + 'freight' => 5,
  600 + 'coupon' => 0,
  601 + 'yohoCoin' => 5,
  602 + 'price' => 719
  603 + );
  604 + $this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
  605 + }
350 } 606 }
@@ -26,43 +26,41 @@ class GradeModel @@ -26,43 +26,41 @@ class GradeModel
26 } 26 }
27 } 27 }
28 //调用接口获取数据 28 //调用接口获取数据
29 - $data = GradeData::getGradeData($channel, $uid);  
30 -  
31 - if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {  
32 - switch (intval($data['data']['current_vip_level'])) {  
33 - case 0://普通会员  
34 - $result['vipGrade']['vip0'] = true;  
35 - break;  
36 - case 1://银卡会员  
37 - $result['vipGrade']['vip1'] = true;  
38 - break;  
39 - case 2://金卡会员  
40 - $result['vipGrade']['vip2'] = true;  
41 - break;  
42 - case 3://白金会员  
43 - $result['vipGrade']['vip3'] = true;  
44 - break;  
45 - }  
46 -  
47 - //今年总消费  
48 - $result['vipGrade']['costOfThisYear'] = $data['data']['current_year_cost'];  
49 - //升级下一等级会员的进度;  
50 - $result['vipGrade']['percent'] = 100*(round($data['data']['current_total_cost'] / $data['data']['next_need_cost'], 2));  
51 - //距离升级所需消费金额  
52 -  
53 - if ($data['data']['current_vip_level'] != 3) {  
54 - $result['vipGrade']['costGap'] = $data['data']['upgrade_need_cost'];  
55 - }  
56 - //消费总计  
57 - $result['vipGrade']['sumCost'] = $data['data']['current_total_cost'];  
58 - //username 调用获取用户基本信息数据,获得username;  
59 - $userProfile = GradeData::getUserProfileData($gender,$uid,$channel);  
60 - $result['vipGrade']['name'] = $userProfile['data']['username'];  
61 - //跳转url(会员特权详情)  
62 - $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential',null);  
63 - //当前vip等级享受的特权  
64 - $result['vipGrade']['privilege'] = $data['data']['enjoy_preferential']; 29 + $data = GradeData::getGradeData($gender, $channel, $uid);
  30 + switch (intval($data['grade']['current_vip_level'])) {
  31 + case 0://普通会员
  32 + $result['vipGrade']['vip0'] = true;
  33 + break;
  34 + case 1://银卡会员
  35 + $result['vipGrade']['vip1'] = true;
  36 + break;
  37 + case 2://金卡会员
  38 + $result['vipGrade']['vip2'] = true;
  39 + break;
  40 + case 3://白金会员
  41 + $result['vipGrade']['vip3'] = true;
  42 + break;
  43 + }
  44 +
  45 + //今年总消费
  46 + $result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
  47 + //升级下一等级会员的进度;
  48 + $result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2));
  49 + //距离升级所需消费金额
  50 +
  51 + if ($data['grade']['current_vip_level'] != 3) {
  52 + $result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost'];
65 } 53 }
  54 + //消费总计
  55 + $result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
  56 + //username 调用获取用户基本信息数据,获得username;
  57 + //$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
  58 + $result['vipGrade']['name'] = $data['userProfile']['username'];
  59 + //跳转url(会员特权详情)
  60 + $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null);
  61 + //当前vip等级享受的特权
  62 + $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
  63 +
66 64
67 if (USE_CACHE) { 65 if (USE_CACHE) {
68 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. 66 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
@@ -74,7 +72,7 @@ class GradeModel @@ -74,7 +72,7 @@ class GradeModel
74 Cache::set(CacheConfig::KEY_ACTION_HOME_GRADE, $result); 72 Cache::set(CacheConfig::KEY_ACTION_HOME_GRADE, $result);
75 } 73 }
76 } 74 }
77 - 75 +
78 return $result; 76 return $result;
79 } 77 }
80 78
@@ -97,7 +95,7 @@ class GradeModel @@ -97,7 +95,7 @@ class GradeModel
97 if (isset($data['code']) && $data['code'] == 200) { 95 if (isset($data['code']) && $data['code'] == 200) {
98 $result['vipGrade']['privilege'] = $data['data']; 96 $result['vipGrade']['privilege'] = $data['data'];
99 } 97 }
100 - 98 +
101 99
102 if (USE_CACHE) { 100 if (USE_CACHE) {
103 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. 101 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
@@ -109,7 +107,7 @@ class GradeModel @@ -109,7 +107,7 @@ class GradeModel
109 Cache::set(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, $result); 107 Cache::set(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, $result);
110 } 108 }
111 } 109 }
112 - 110 +
113 return $result; 111 return $result;
114 } 112 }
115 113
  1 +<?php
  2 +
  3 +namespace home;
  4 +
  5 +use LibModels\Wap\Home\OrderData;
  6 +use Plugin\Helpers;
  7 +use Configs\CacheConfig;
  8 +
  9 +/*
  10 + * To change this license header, choose License Headers in Project Properties.
  11 + * To change this template file, choose Tools | Templates
  12 + * and open the template in the editor.
  13 + */
  14 +
  15 +/**
  16 + * Description of Order
  17 + *
  18 + */
  19 +class OrderModel
  20 +{
  21 +
  22 + /**
  23 + * 订单相关数据处理
  24 + */
  25 + public function getOrder($type = 1, $page = 1, $limit, $gender, $yh_channel, $uid) {
  26 + $result = array();
  27 + if (USE_CACHE) {
  28 + $key = CacheConfig::KEY_ACTION_HOME_ORDER_ORDER;
  29 + // 先尝试获取一级缓存(master), 有数据则直接返回.
  30 + $result = Cache::get($key, 'master');
  31 + if (!empty($result)) {
  32 + return $result;
  33 + }
  34 + }
  35 + //调用接口获得数据
  36 + $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
  37 + //检查数据返回是否正常,正常则处理数据
  38 + if ($data['code'] == 200 && isset($data['data'])) {
  39 + foreach ($data['data']['order_list'] as $key => $vo) {
  40 + //订单号,支付状态,订单商品数量,订单总价格
  41 + $result[$key]['orderNum'] = $vo['order_code'];
  42 + $result[$key]['orderStatus'] = $vo['status_str'];
  43 + $result[$key]['count'] = count($vo['order_goods']);
  44 + $result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost'];
  45 + //订单商品列表数据
  46 + $result[$key]['goods'] = self::formatOrderGoods($vo['order_goods']);
  47 + //订单status判断订单处于什么状态。
  48 + do {
  49 + //订单取消状态
  50 + if ($vo['is_cancel'] === 'Y') {
  51 + $result[$key]['canceled'] = true;
  52 + break;
  53 + }
  54 + //支付方式不是货到付款时,计算订单状态
  55 + if ($vo['payment_type'] != 2) {
  56 + switch ($vo['status']) {
  57 + case 0:
  58 + $result[$key]['unpaid'] = true;
  59 + break;
  60 + case 1:
  61 + case 2:
  62 + case 3:
  63 + case 4:
  64 + case 5:
  65 + $result[$key]['unreceived'] = true;
  66 + $result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
  67 + break;
  68 + case 6:
  69 + $result[$key]['completed'] = true;
  70 + break;
  71 + default:
  72 + break;
  73 + }
  74 + } elseif ($vo['payment_type'] == 2) {
  75 + //订单为货到付款订单时,订单没有未支付状态
  76 + switch ($vo['status']) {
  77 + case 0 || 1 || 2 || 3 || 4 || 5:
  78 + $result[$key]['unreceived'] = true;
  79 + //此处备注,接口没有返回logisticsUrl数据
  80 + $resault[$key]['logisticsUrl'] = "备注:暂无logisticsUrl数据";
  81 + break;
  82 + case 6:
  83 + $result[$key]['completed'] = true;
  84 + break;
  85 + default:
  86 + break;
  87 + }
  88 + }
  89 + } while (false);
  90 + }
  91 + }
  92 +
  93 + if (USE_CACHE) {
  94 + // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
  95 + if (empty($result)) {
  96 + $result = Cache::get($key, 'slave');
  97 + }
  98 + // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
  99 + else {
  100 + Cache::set($key, $result);
  101 + }
  102 + }
  103 + return $result;
  104 + }
  105 +
  106 + //格式化订单商品
  107 + static function formatOrderGoods($orderGoods) {
  108 + $arr = array();
  109 + foreach ($orderGoods as $key => $vo) {
  110 + $arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
  111 + $arr[$key]['name'] = $vo['product_name'];
  112 + $arr[$key]['color'] = $vo['color_name'];
  113 + $arr[$key]['size'] = $vo['size_name'];
  114 + $arr[$key]['price'] = $vo['goods_price'];
  115 + $arr[$key]['count'] = $vo['buy_number'];
  116 + if ($vo['goods_type'] == 'gift') {
  117 + $arr[$key]['gift'] = true;
  118 + } elseif ($vo['goods_type'] == 'price_gift') {
  119 + $arr[$key]['advanceBuy'] = true;
  120 + }
  121 + }
  122 + return $arr;
  123 + }
  124 +
  125 +}
@@ -103,8 +103,6 @@ class UserModel @@ -103,8 +103,6 @@ class UserModel
103 103
104 // 处理用户订单数据 104 // 处理用户订单数据
105 if (isset($orderData['data']) && !empty($orderData['data'])) { 105 if (isset($orderData['data']) && !empty($orderData['data'])) {
106 - $result = $orderData['data'];  
107 -  
108 $oneOrder = array(); 106 $oneOrder = array();
109 foreach ($orderData['data']['order_list'] as $val) { 107 foreach ($orderData['data']['order_list'] as $val) {
110 $oneOrder = array(); 108 $oneOrder = array();
@@ -120,21 +118,18 @@ class UserModel @@ -120,21 +118,18 @@ class UserModel
120 $oneGoods = array(); 118 $oneGoods = array();
121 $oneGoods['id'] = 1; 119 $oneGoods['id'] = 1;
122 $oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80); 120 $oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
123 - $oneGoods['name'] = $val['product_name'];  
124 - $oneGoods['color'] = $val['color_name'];  
125 - $oneGoods['size'] = $val['size_name'];  
126 - $oneGoods['size_name'] = $val['size_name'];  
127 - $oneGoods['price'] = $val['goods_price'];  
128 - $oneGoods['count'] = $val['buy_number'];  
129 -  
130 - $result['goods'][] = $oneGoods; 121 + $oneGoods['name'] = $goods['product_name'];
  122 + $oneGoods['color'] = $goods['color_name'];
  123 + $oneGoods['size'] = $goods['size_name'];
  124 + $oneGoods['price'] = $goods['goods_price'];
  125 + $oneGoods['count'] = $goods['buy_number'];
  126 +
  127 + $oneOrder[] = $oneGoods;
131 } 128 }
132 129
133 $result['orders'][] = $oneOrder; 130 $result['orders'][] = $oneOrder;
134 } 131 }
135 -  
136 } 132 }
137 - print_r($result);  
138 133
139 return $result; 134 return $result;
140 } 135 }
@@ -218,7 +213,7 @@ class UserModel @@ -218,7 +213,7 @@ class UserModel
218 213
219 // 处理优惠券数据 214 // 处理优惠券数据
220 if (isset($coupons['data']) && !empty($coupons['data'])) { 215 if (isset($coupons['data']) && !empty($coupons['data'])) {
221 - $result = $coupons['data']; 216 + $result = $coupons['data']['info'];
222 } 217 }
223 218
224 return $result; 219 return $result;
@@ -246,6 +241,96 @@ class UserModel @@ -246,6 +241,96 @@ class UserModel
246 } 241 }
247 242
248 /** 243 /**
  244 + * 处理地址列表数据
  245 + *
  246 + * @param int $uid 用户ID
  247 + * @return array|mixed 处理之后的地址列表数据
  248 + */
  249 + public static function getAddressListData($uid)
  250 + {
  251 + $result = array();
  252 +
  253 + // 调用接口获取地址列表数据
  254 + $address = UserData::addressListData($uid);
  255 +
  256 + // 处理地址数据
  257 + if (isset($address['data']) && !empty($address['data'])) {
  258 + $result = $address['data'];
  259 + }
  260 +
  261 + return $result;
  262 + }
  263 +
  264 + /**
  265 + * 保存地址数据
  266 + *
  267 + * @param int $uid 用户ID
  268 + * @param string $address 地址信息
  269 + * @param int $area_code 城市码
  270 + * @param string $consignee 收货人
  271 + * @param string $email 邮箱地址
  272 + * @param int $id 地址唯一标识符id
  273 + * @param string $mobile 手机号码
  274 + * @param string $zip_code 邮编
  275 + * @return array|mixed 处理之后的地址列表数据
  276 + */
  277 + public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
  278 + {
  279 + $result = array();
  280 +
  281 + // 参数验证
  282 + if (empty($uid)) {
  283 + $result['code'] = 400;
  284 + $result['message'] = '用户不可用';
  285 + } else if (empty($address)) {
  286 + $result['code'] = 401;
  287 + $result['message'] = '请输入可用的地址信息';
  288 + } else if (empty($area_code)) {
  289 + $result['code'] = 402;
  290 + $result['message'] = '地区码不可用';
  291 + } else if (empty($consignee)) {
  292 + $result['code'] = 403;
  293 + $result['message'] = '请输入收件人姓名';
  294 + } else if (!empty($email) && Helpers::verifyEmail($email)) {
  295 + $result['code'] = 404;
  296 + $result['message'] = '输入的邮箱地址格式不正确';
  297 + } else if (!empty($mobile) && Helpers::verifyMobile($mobile)) {
  298 + $result['code'] = 404;
  299 + $result['message'] = '输入的手机号码格式不正确';
  300 + } else {
  301 + // 调用接口保存地址数据
  302 + $address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
  303 + // 处理返回结果
  304 + if (isset($address['code']) && $address['code'] == 200) {
  305 + $result = $address['data'];
  306 + }
  307 + }
  308 +
  309 + return $result;
  310 + }
  311 +
  312 + /**
  313 + * 设置默认地址
  314 + *
  315 + * @param int $uid 用户ID
  316 + * @param int $id 地址唯一标识符id
  317 + * @return array|mixed 处理之后的返回数据
  318 + */
  319 + public static function setDefaultAddress($uid, $id)
  320 + {
  321 + $result = array('code' => 400, 'message' => '错误');
  322 +
  323 + // 调用接口设置默认地址
  324 + $address = UserData::setDefaultAddress($uid, $id);
  325 + // 处理返回结果
  326 + if ($address && isset($address['code'])) {
  327 + $result = $address;
  328 + }
  329 +
  330 + return $result;
  331 + }
  332 +
  333 + /**
249 * 处理意见反馈数据 334 * 处理意见反馈数据
250 * 335 *
251 * @param string $udid 客户端唯一标识 336 * @param string $udid 客户端唯一标识
@@ -227,19 +227,25 @@ class NewsaleModel @@ -227,19 +227,25 @@ class NewsaleModel
227 return $result; 227 return $result;
228 } 228 }
229 229
230 - /**  
231 - * 筛选出来的热销排行榜商品数据处理  
232 - *  
233 - * @param array $data 筛选出来的原数据  
234 - * @return array 处理之后的数据  
235 - */  
236 - public static function selectTopData($data) 230 + /**
  231 + * 筛选出来的热销排行榜商品数据处理
  232 + *
  233 + * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
  234 + * @param string|null $sort 品类ID查询参数
  235 + * @param integer|null $tab_id Tab的ID
  236 + * @param boolean $notab 时候返回顶部tab的数据,默认返回
  237 + * @param integer $limit 查询返回的最大限制数
  238 + * @param integer $page 分页第几页
  239 + * @return array 处理之后的数据
  240 + */
  241 + public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
237 { 242 {
238 $result = array(); 243 $result = array();
239 244
  245 + $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
  246 +
240 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { 247 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
241 - $result = NewSaleProcess::newSaleData($data['data']);  
242 - unset($result['filter']); 248 + $result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
243 } 249 }
244 250
245 return $result; 251 return $result;
  1 +<?php
  2 +
  3 +namespace home;
  4 +
  5 +use LibModels\Wap\Home\OnlineData;
  6 +use Action\AbstractAction;
  7 +use Plugin\Helpers;
  8 +
  9 +/**
  10 + * 在线客服相关数据处理
  11 + */
  12 +class OnlineModel
  13 +{
  14 +
  15 + //获取在线帮助分类
  16 + public static function getOnlineServiceInfo($clientType = 'iphone')
  17 + {
  18 + //调用接口获取数据
  19 + $res = OnlineData::getOnlineServiceInfo($clientType);
  20 + $cateInfo = $res['data'];
  21 + $question = array();
  22 + $tab = array();
  23 + if ($cateInfo)
  24 + {
  25 + foreach ($cateInfo as $key => $value)
  26 + {
  27 + //强制截成3个tab
  28 + if ($key > 2)
  29 + {
  30 + break;
  31 + }
  32 + $tab[$key]['tabid'] = 'tab' . $value['id'];
  33 + $tab[$key]['tabname'] = $value['category_name'];
  34 + $tab[$key]['iscut'] = true;
  35 + $tab[$key]['current'] = (!$key) ? TRUE : FALSE;
  36 + $question[$key]['name'] = 'tab' . $value['id'];
  37 + $question[$key]['current'] = (!$key) ? TRUE : FALSE;
  38 + $sub = $value['sub'];
  39 + $qTmp = array();
  40 + if ($sub)
  41 + {
  42 + foreach ($sub as $sk => $sv)
  43 + {
  44 + $qTmp[$sk]['title'] = $sv['category_name'];
  45 + $qTmp[$sk]['link'] = '/home/onlineservicedetail?cateId=' . $sv['id'].'&cateName='.$sv['category_name'];
  46 + }
  47 + }
  48 + $question[$key]['list'] = $qTmp;
  49 + }
  50 + $question[0]['current'] = true;
  51 + $tab[count($tab) - 1]['iscut'] = false;
  52 + }
  53 + //处理返回信息
  54 + $result = array(
  55 + 'header' => array('title' => '在线客服'),
  56 + 'tab' => $tab,
  57 + 'question' => $question
  58 + );
  59 +
  60 + return $result;
  61 + }
  62 +
  63 + //加载分类下的问题和解决方法
  64 + public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
  65 + {
  66 + $result = array();
  67 + if (!$cateId)
  68 + {
  69 + return $result;
  70 + }
  71 + $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType);
  72 + $questionInfo = $res['data'];
  73 + if ($questionInfo)
  74 + {
  75 + $list = array();
  76 + if ($questionInfo)
  77 + {
  78 + foreach ($questionInfo as $qk => $qv)
  79 + {
  80 + $list[$qk]['q'] = $qv['title'];
  81 + $list[$qk]['a'] = $qv['content'];
  82 + }
  83 + }
  84 + //处理返回信息
  85 + $result = array(
  86 + 'header' => array('title' => '在线客服'),
  87 + 'list' => $list
  88 + );
  89 + }
  90 + return $result;
  91 + }
  92 +
  93 +}
@@ -41,6 +41,7 @@ class BrandController extends AbstractAction @@ -41,6 +41,7 @@ class BrandController extends AbstractAction
41 } 41 }
42 42
43 // 渲染模板 43 // 渲染模板
  44 + print_r(Category\BrandModel::getBrandByChannel($channel));
44 $this->_view->display('index', Category\BrandModel::getBrandByChannel($channel)); 45 $this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
45 } 46 }
46 47
@@ -106,12 +106,11 @@ class NewsaleController extends AbstractAction @@ -106,12 +106,11 @@ class NewsaleController extends AbstractAction
106 $tab_id = $this->get('tab_id', null); 106 $tab_id = $this->get('tab_id', null);
107 $limit = $this->get('limit', 50); 107 $limit = $this->get('limit', 50);
108 $page = $this->get('page', 1); 108 $page = $this->get('page', 1);
  109 + $notab = (boolean)$this->get('notab', false);
109 110
110 // 获取性别 111 // 获取性别
111 $gender = Helpers::getGenderByCookie(); 112 $gender = Helpers::getGenderByCookie();
112 -  
113 - $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);  
114 - $result = \Product\NewsaleModel::selectTopData($data); 113 + $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
115 } 114 }
116 115
117 if (empty($result)) { 116 if (empty($result)) {