Authored by Lynnic

update

Showing 71 changed files with 3259 additions and 411 deletions
... ... @@ -947,18 +947,20 @@
order: {
orders: [
...
]
],
//没有订单的情况不传orders
walkWayUrl: '' //随便逛逛url
}
}
//订单
{
detailUrl: '',
orderNum: '',
tradingStatus: '',
orderStatus: '',
goods: [
{
id: '',
thumb: '',
gift: true, //是否赠品
advanceBuy: true, //是否加价购
... ... @@ -974,9 +976,52 @@
sumCost: '199.00',
//status
completed: true, //已完成
canceled: true, //已取消
unpaid: true, //or 未支付
unshipped: true, //or 未发货
unreceived: '', //or 未收货,查看物流URL
unreceived: '', //or 待收货(未发货/未收货),查看物流URL
//待收货时传递物流参数
logisticsUrl: ''
}
### 订单详情页
{
orderDetail: {
orderNum: '', //订单号
name: '', //收货人姓名
phoneNum: '',
address: '',
orderStatus: '订单成功', //订单取消...等订单状态
orderNum: '',
orderTime: '',
//订单状态
canceled: true, //是否是取消的订单
completed: true, //是否是已完成订单
unpaid: true, //是否是未支付订单
unreceived: true, //是否是未收货订单
//如果是待收货(未发货和未收货),传物流信息参数
logisticsUrl: '',
logisticsCompany: '',
logisticsNum: '',
//end
goods: [
{
... //订单商品
}
],
sumPrice: '',
salePrice: '',
freight: '',
yohoCoin: '',
price: ''
}
}
### YOHO币
... ...
framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -18,14 +18,15 @@ class Yohobuy
{
/* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL = 'http://api2.open.yohobuy.com/';
const API_URL2 = 'http://api.open.yohobuy.com/';
const SERVICE_URL = 'http://service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://test2.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**
* 私钥列表
... ...
... ... @@ -42,5 +42,6 @@ class CacheConfig
const KEY_ACTION_HOME_PREFERENTIAL = 'key_action_home_preferential';//会员特权详情
const KEY_ACTION_GUANG_PLUSTAR_DATA = 'key_action_guang_plustar_data'; // 逛PLUSTAR
const KEY_ACTION_GUANG_DETAIL_DATA = 'key_action_guang_detail_data'; // 逛内容详情
const KEY_ACTION_HOME_ORDER_ORDER = 'key_action_home_order_order';//订单列表
}
... ...
... ... @@ -15,17 +15,30 @@ class GradeData
/**
* 获取会员等级数据
* @param string $yh_channel 频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他
* @param strint $gender 用户性别
* @param string $uid 用户id
* @return array 接口返回的会员等级数据
*/
public function getGradeData($channel, $uid) {
public function getGradeData($gender, $channel, $uid) {
$urlList = array();
//获取会员等级数据
$param = Yohobuy::param();
$param['yh_channel'] = $channel;
$param['uid'] = $uid;
$param['method'] = 'app.Passport.vip';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
$urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
//获取用户基本信息数据(用来得到username)
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['uid'] = $uid;
$param['yh_channel'] = $channel;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
$urlList['userProfile'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
return Yohobuy::getMulti($urlList);
}
/**
... ... @@ -44,18 +57,4 @@ class GradeData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取用户基本信息数据
*/
public function getUserProfileData($gender, $uid, $channel) {
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['uid'] = $uid;
$param['yh_channel'] = $channel;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get("http://api.open.yohobuy.com/",$param);
}
}
... ...
<?php
namespace LibModels\Wap\Home;
use Api\Sign;
use Api\Yohobuy;
/**
* 在线客服数据模型
*
* @name OnlineData
* @package LibModels/Wap/Home
* @copyright yoho.inc
* @version 1.0 (2015-11-13)
* @author xiaowei
*/
class OnlineData
{
const ONLINE_URI = 'operations/api/v1/help/';
//获取帮助列表(分类)
public static function getOnlineServiceInfo($clientType='iphone')
{
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getCategory', array('client_type'=>$clientType));
}
//获取问题详情
public static function getOnlineServiceDetail($cateId, $clientType = 'iphone')
{
return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getHelp', array('category_id'=>$cateId,'client_type'=>$clientType));
}
}
... ...
<?php
namespace LibModels\Wap\Home;
use Api\Yohobuy;
use Api\Sign;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of OrderData
*
* @author Administrator
*/
class OrderData
{
/*
* 获取订单数据
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
public function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
//构建必传参数
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['limit'] = $limit;
$param['method'] = 'app.SpaceOrders.get';
$param['page'] = $page;
$param['type'] = $type;
$param['uid'] = $uid;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL2, $param);
}
}
... ...
... ... @@ -161,7 +161,7 @@ class UserData
public static function couponData($uid, $status, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.lists';
$param['method'] = 'app.coupons.li';
$param['uid'] = $uid;
$param['status'] = $status;
$param['page'] = $page;
... ... @@ -188,6 +188,76 @@ class UserData
}
/**
* 获取三级地址列表数据
*
* @param int $uid 用户ID
* @return array 地址接口返回的数据
*/
public static function addressListData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.getlist';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 保存地址数据
*
* @param int $uid 用户ID
* @param string $address 地址信息
* @param int $area_code 城市码
* @param string $consignee 收货人
* @param string $email 邮箱地址
* @param int $id 地址唯一标识符id
* @param string $mobile 手机号码
* @param string $zip_code 邮编
* @return array 地址接口返回的数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$param = Yohobuy::param();
$param['address'] = $address;
$param['area_code'] = $area_code;
$param['consignee'] = $consignee;
$param['email'] = $email;
if ($id !== null) { // 修改
$param['id'] = $id;
$param['method'] = 'app.address.update';
} else { // 添加
$param['method'] = 'app.address.add';
}
$param['mobile'] = $mobile;
$param['zip_code'] = $zip_code;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function setDefaultAddress($uid, $id)
{
$param = Yohobuy::param();
$param['id'] = $id;
$param['method'] = 'app.address.setdefault';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 意见反馈数据
*
* @param string $udid 客户端唯一标识
... ...
... ... @@ -298,7 +298,12 @@ class FloorProcess
$one['img'] = Helpers::getImageUrl($one['src'], 640, 403);
unset($one['src']);
}
$result['big_image']['list'] = $data['big_image'];
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['list'] = $data['big_image'];
unset($data['big_image']);
}
foreach ($data['list'] as $kk => &$one) {
if ($kk == 0) {
... ... @@ -318,8 +323,6 @@ class FloorProcess
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
unset($data['big_image']);
$result['goodsCategory'] = $data;
return $result;
... ...
... ... @@ -50,4 +50,47 @@ class NewSaleProcess
return $result;
}
/**
* 处理热销排行榜数据
*
* @param array $products 接口传回的数据
* @param boolean $notab 是否传回tab数据
* @param int $limit 查询返回的最大限制数
* @param int $page 分页第几页
* @return array 处理之后的数据
*/
public static function topData($products, $notab, $limit, $page)
{
$result = array();
// 处理Tabs
if (!$notab && isset($products['tabs'])) {
$result['tabs'] = array();
foreach ($products['tabs'] as $key => $one) {
$tabItem = array();
$tabItem['title'] = $one;
$tabItem['dataId'] = $key;
if ($key === 1) {
$tabItem['focus'] = true;
}
$result['tabs'][] = $tabItem;
}
}
// 处理商品
if (isset($products['product_list'])) {
$count = count($products['product_list']);
$one = array();
foreach ($products['product_list'] as $key => $single) {
$one = Helpers::formatProduct($single, true, false, false, 75, 114);
$one['rank'] = $limit * ($page -1) + $key + 1;
$result['goods'][] = $one;
}
}
return $result;
}
}
... ...
... ... @@ -14,6 +14,7 @@ fonts_dir = "font"
output_style = :expanded
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
sourcemap = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015
Created by FontForge 20120731 at Mon Nov 16 18:08:15 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015
bbox="-0.75 -224 3943 812.871"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E62F"
unicode-range="U+0078-E63E"
/>
<missing-glyph horiz-adv-x="374"
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" />
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
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
t-65.5 -105.5t-75.5 -87.5t-76 -70.5t-66.5 -50.5t-47.5 -31.5t-18 -10v225h38z" />
<glyph glyph-name="uniE630" unicode="&#xe630;"
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
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
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
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
t21.5 52.5t-21.5 52.5t-52.5 22z" />
<glyph glyph-name="uniE631" unicode="&#xe631;"
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
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
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
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
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
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
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" />
<glyph glyph-name="uniE632" unicode="&#xe632;"
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
h-595v755h364v-206q0 -14 9.5 -24t23.5 -10h198v-515zM313 300h397v69h-397v-69z" />
<glyph glyph-name="uniE633" unicode="&#xe633;" horiz-adv-x="1304"
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
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
q0 -29 -14 -53t-38.5 -38t-52.5 -14q-43 0 -74 31t-31 74t31 74t74 31t74 -31t31 -74z" />
<glyph glyph-name="uniE634" unicode="&#xe634;" horiz-adv-x="1476"
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
v-60h-331v60z" />
<glyph glyph-name="uniE635" unicode="&#xe635;"
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
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
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
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" />
<glyph glyph-name="uniE636" unicode="&#xe636;"
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" />
<glyph glyph-name="uniE637" unicode="&#xe637;"
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
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
t-93.5 -115.5z" />
<glyph glyph-name="uniE638" unicode="&#xe638;" horiz-adv-x="1335"
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
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
M147 665h310v-311h-310v311z" />
<glyph glyph-name="uniE639" unicode="&#xe639;"
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
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
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
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" />
<glyph glyph-name="uniE63A" unicode="&#xe63a;"
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
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
zM381 278h66v-109h-66v109zM381 431h66v-109h-66v109zM381 126h66v-66h-66v66z" />
<glyph glyph-name="uniE63B" unicode="&#xe63b;" horiz-adv-x="1199"
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
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
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" />
<glyph glyph-name="uniE63C" unicode="&#xe63c;" horiz-adv-x="1048"
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
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
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
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
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" />
<glyph glyph-name="uniE63E" unicode="&#xe63e;"
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
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
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
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
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
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
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
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
q-6 -21 -34 -21z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -148,7 +148,7 @@ function rePosFooter() {
window._ozuid = uid;//暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '1.0.12', 'yohobuy_m', uid, '');
window._yas(1 * new Date(), '1.0.13', 'yohobuy_m', uid, '');
}
}());
... ...
... ... @@ -5,6 +5,8 @@
*/
require('./order');
require('./order-detail');
require('./fav');
require('./index');
require('./coupons');
\ No newline at end of file
require('./coupons');
require('./online-service');
\ No newline at end of file
... ...
... ... @@ -6,8 +6,10 @@
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
lazyLoad = require('yoho.lazyload'),
Swiper = require('yoho.iswiper');
//导航
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content');
... ... @@ -15,11 +17,15 @@ var $curContainer = $favContainer.children('.fav-type').first();//保存当前
var favTabHammer;
//轮播图
var $swiperList = $('.swiper-container'),
swiperArray = [],
swiperObj = {};
//lazyLoad();
favTabHammer = new Hammer(document.getElementById('fav-tab'));
favTabHammer.on('tap', function(e) {
console.log(1);
var $cur = $(e.target).closest('li'),
index;
... ... @@ -34,4 +40,20 @@ favTabHammer.on('tap', function(e) {
$curContainer.addClass('hide');
$curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide');
if (index === 1) {
//导航
for (var i = 0; i < $swiperList.length; i++) {
var id = $swiperList.eq(i).attr('data-id');
swiperObj[id] = new Swiper('#swiper-container-' + id, {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
wrapperClass: 'swiper-wrapper-' + id,
lazyLoading: true,
watchSlidesVisibility: true
});
}
}
});
... ...
... ... @@ -4,12 +4,4 @@
* @date: 2015/11/12
*/
var Swiper = require('yoho.iswiper');
var recommendSwiper;
recommendSwiper = new Swiper('.swiper-recommend', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
slidesPerView: 'auto'
});
\ No newline at end of file
require('../product/recommend-for-you.js');
\ No newline at end of file
... ...
/*
UploadiFive 1.2.2
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the UploadiFive Standard License <http://www.uploadify.com/uploadifive-standard-license>
*/
var jQuery = require('jquery');
;(function($) {
var methods = {
init : function(options) {
return this.each(function() {
// Create a reference to the jQuery DOM object
var $this = $(this);
$this.data('uploadifive', {
inputs : {}, // The object that contains all the file inputs
inputCount : 0, // The total number of file inputs created
fileID : 0,
queue : {
count : 0, // Total number of files in the queue
selected : 0, // Number of files selected in the last select operation
replaced : 0, // Number of files replaced in the last select operation
errors : 0, // Number of files that returned an error in the last select operation
queued : 0, // Number of files added to the queue in the last select operation
cancelled : 0 // Total number of files that have been cancelled or removed from the queue
},
uploads : {
current : 0, // Number of files currently being uploaded
attempts : 0, // Number of file uploads attempted in the last upload operation
successful : 0, // Number of files successfully uploaded in the last upload operation
errors : 0, // Number of files returning errors in the last upload operation
count : 0 // Total number of files uploaded successfully
}
});
var $data = $this.data('uploadifive');
// Set the default options
var settings = $data.settings = $.extend({
'auto' : true, // Automatically upload a file when it's added to the queue
'buttonClass' : false, // A class to add to the UploadiFive button
'buttonText' : 'Select Files', // The text that appears on the UploadiFive button
'checkScript' : false, // Path to the script that checks for existing file names
'dnd' : true, // Allow drag and drop into the queue
'dropTarget' : false, // Selector for the drop target
'fileObjName' : 'Filedata', // The name of the file object to use in your server-side script
'fileSizeLimit' : 0, // Maximum allowed size of files to upload
'fileType' : false, // Type of files allowed (image, etc), separate with a pipe character |
'formData' : {}, // Additional data to send to the upload script
'height' : 30, // The height of the button
'itemTemplate' : false, // The HTML markup for the item in the queue
'method' : 'post', // The method to use when submitting the upload
'multi' : true, // Set to true to allow multiple file selections
'overrideEvents' : [], // An array of events to override
'queueID' : false, // The ID of the file queue
'queueSizeLimit' : 0, // The maximum number of files that can be in the queue
'removeCompleted' : false, // Set to true to remove files that have completed uploading
'simUploadLimit' : 0, // The maximum number of files to upload at once
'truncateLength' : 0, // The length to truncate the file names to
'uploadLimit' : 0, // The maximum number of files you can upload
'uploadScript' : 'uploadifive.php', // The path to the upload script
'width' : 100 // The width of the button
/*
// Events
'onAddQueueItem' : function(file) {}, // Triggered for each file that is added to the queue
'onCancel' : function(file) {}, // Triggered when a file is cancelled or removed from the queue
'onCheck' : function(file, exists) {}, // Triggered when the server is checked for an existing file
'onClearQueue' : function(queue) {}, // Triggered during the clearQueue function
'onDestroy' : function() {} // Triggered during the destroy function
'onDrop' : function(files, numberOfFilesDropped) {}, // Triggered when files are dropped into the file queue
'onError' : function(file, fileType, data) {}, // Triggered when an error occurs
'onFallback' : function() {}, // Triggered if the HTML5 File API is not supported by the browser
'onInit' : function() {}, // Triggered when UploadiFive if initialized
'onQueueComplete' : function() {}, // Triggered once when an upload queue is done
'onProgress' : function(file, event) {}, // Triggered during each progress update of an upload
'onSelect' : function() {}, // Triggered once when files are selected from a dialog box
'onUpload' : function(file) {}, // Triggered when an upload queue is started
'onUploadComplete' : function(file, data) {}, // Triggered when a file is successfully uploaded
'onUploadFile' : function(file) {}, // Triggered for each file being uploaded
*/
}, options);
// Calculate the file size limit
if (isNaN(settings.fileSizeLimit)) {
var fileSizeLimitBytes = parseInt(settings.fileSizeLimit) * 1.024
if (settings.fileSizeLimit.indexOf('KB') > -1) {
settings.fileSizeLimit = fileSizeLimitBytes * 1000;
} else if (settings.fileSizeLimit.indexOf('MB') > -1) {
settings.fileSizeLimit = fileSizeLimitBytes * 1000000;
} else if (settings.fileSizeLimit.indexOf('GB') > -1) {
settings.fileSizeLimit = fileSizeLimitBytes * 1000000000;
}
} else {
settings.fileSizeLimit = settings.fileSizeLimit * 1024;
}
// Create a template for a file input
$data.inputTemplate = $('<input type="file">')
.css({
'font-size' : settings.height + 'px',
'opacity' : 0,
'position' : 'absolute',
'right' : '-3px',
'top' : '-3px',
'z-index' : 999
});
// Create a new input
$data.createInput = function() {
// Create a clone of the file input
var input = $data.inputTemplate.clone();
// Create a unique name for the input item
var inputName = input.name = 'input' + $data.inputCount++;
// Set the multiple attribute
if (settings.multi) {
input.attr('multiple', true);
}
// Set the accept attribute on the input
if (settings.fileType) {
input.attr('accept', settings.fileType);
}
// Set the onchange event for the input
input.bind('change', function() {
$data.queue.selected = 0;
$data.queue.replaced = 0;
$data.queue.errors = 0;
$data.queue.queued = 0;
// Add a queue item to the queue for each file
var limit = this.files.length;
$data.queue.selected = limit;
if (($data.queue.count + limit) > settings.queueSizeLimit && settings.queueSizeLimit !== 0) {
if ($.inArray('onError', settings.overrideEvents) < 0) {
alert('The maximum number of queue items has been reached (' + settings.queueSizeLimit + '). Please select fewer files.');
}
// Trigger the error event
if (typeof settings.onError === 'function') {
settings.onError.call($this, 'QUEUE_LIMIT_EXCEEDED');
}
} else {
for (var n = 0; n < limit; n++) {
file = this.files[n];
$data.addQueueItem(file);
}
$data.inputs[inputName] = this;
$data.createInput();
}
// Upload the file if auto-uploads are enabled
if (settings.auto) {
methods.upload.call($this);
}
// Trigger the select event
if (typeof settings.onSelect === 'function') {
settings.onSelect.call($this, $data.queue);
}
});
// Hide the existing current item and add the new one
if ($data.currentInput) {
$data.currentInput.hide();
}
$data.button.append(input);
$data.currentInput = input;
}
// Remove an input
$data.destroyInput = function(key) {
$($data.inputs[key]).remove();
delete $data.inputs[key];
$data.inputCount--;
}
// Drop a file into the queue
$data.drop = function(e) {
$data.queue.selected = 0;
$data.queue.replaced = 0;
$data.queue.errors = 0;
$data.queue.queued = 0;
var fileData = e.dataTransfer;
var inputName = fileData.name = 'input' + $data.inputCount++;
// Add a queue item to the queue for each file
var limit = fileData.files.length;
$data.queue.selected = limit;
if (($data.queue.count + limit) > settings.queueSizeLimit && settings.queueSizeLimit !== 0) {
// Check if the queueSizeLimit was reached
if ($.inArray('onError', settings.overrideEvents) < 0) {
alert('The maximum number of queue items has been reached (' + settings.queueSizeLimit + '). Please select fewer files.');
}
// Trigger the onError event
if (typeof settings.onError === 'function') {
settings.onError.call($this, 'QUEUE_LIMIT_EXCEEDED');
}
} else {
// Add a queue item for each file
for (var n = 0; n < limit; n++) {
file = fileData.files[n];
$data.addQueueItem(file);
}
// Save the data to the inputs object
$data.inputs[inputName] = fileData;
}
// Upload the file if auto-uploads are enabled
if (settings.auto) {
methods.upload.call($this);
}
// Trigger the onDrop event
if (typeof settings.onDrop === 'function') {
settings.onDrop.call($this, fileData.files, fileData.files.length);
}
// Stop FireFox from opening the dropped file(s)
e.preventDefault();
e.stopPropagation();
}
// Check if a filename exists in the queue
$data.fileExistsInQueue = function(file) {
for (var key in $data.inputs) {
input = $data.inputs[key];
limit = input.files.length;
for (var n = 0; n < limit; n++) {
existingFile = input.files[n];
// Check if the filename matches
if (existingFile.name == file.name && !existingFile.complete) {
return true;
}
}
}
return false;
}
// Remove an existing file in the queue
$data.removeExistingFile = function(file) {
for (var key in $data.inputs) {
input = $data.inputs[key];
limit = input.files.length;
for (var n = 0; n < limit; n++) {
existingFile = input.files[n];
// Check if the filename matches
if (existingFile.name == file.name && !existingFile.complete) {
$data.queue.replaced++;
methods.cancel.call($this, existingFile, true);
}
}
}
}
// Create the file item template
if (settings.itemTemplate == false) {
$data.queueItem = $('<div class="uploadifive-queue-item">\
<a class="close" href="#">X</a>\
<div><span class="filename"></span><span class="fileinfo"></span></div>\
<div class="progress">\
<div class="progress-bar"></div>\
</div>\
</div>');
} else {
$data.queueItem = $(settings.itemTemplate);
}
// Add an item to the queue
$data.addQueueItem = function(file) {
if ($.inArray('onAddQueueItem', settings.overrideEvents) < 0) {
// Check if the filename already exists in the queue
$data.removeExistingFile(file);
// Create a clone of the queue item template
file.queueItem = $data.queueItem.clone();
// Add an ID to the queue item
file.queueItem.attr('id', settings.id + '-file-' + $data.fileID++);
// Bind the close event to the close button
file.queueItem.find('.close').bind('click', function() {
methods.cancel.call($this, file);
return false;
});
var fileName = file.name;
if (fileName.length > settings.truncateLength && settings.truncateLength != 0) {
fileName = fileName.substring(0, settings.truncateLength) + '...';
}
file.queueItem.find('.filename').html(fileName);
// Add a reference to the file
file.queueItem.data('file', file);
$data.queueEl.append(file.queueItem);
}
// Trigger the addQueueItem event
if (typeof settings.onAddQueueItem === 'function') {
settings.onAddQueueItem.call($this, file);
}
// Check the filesize
if (file.size > settings.fileSizeLimit && settings.fileSizeLimit != 0) {
$data.error('FILE_SIZE_LIMIT_EXCEEDED', file);
} else {
$data.queue.queued++;
$data.queue.count++;
}
}
// Remove an item from the queue
$data.removeQueueItem = function(file, instant, delay) {
// Set the default delay
if (!delay) delay = 0;
var fadeTime = instant ? 0 : 500;
if (file.queueItem) {
if (file.queueItem.find('.fileinfo').html() != ' - Completed') {
file.queueItem.find('.fileinfo').html(' - Cancelled');
}
file.queueItem.find('.progress-bar').width(0);
file.queueItem.delay(delay).fadeOut(fadeTime, function() {
$(this).remove();
});
delete file.queueItem;
$data.queue.count--;
}
}
// Count the number of files that need to be uploaded
$data.filesToUpload = function() {
var filesToUpload = 0;
for (var key in $data.inputs) {
input = $data.inputs[key];
limit = input.files.length;
for (var n = 0; n < limit; n++) {
file = input.files[n];
if (!file.skip && !file.complete) {
filesToUpload++;
}
}
}
return filesToUpload;
}
// Check if a file exists
$data.checkExists = function(file) {
if ($.inArray('onCheck', settings.overrideEvents) < 0) {
// This request needs to be synchronous
$.ajaxSetup({
'async' : false
});
// Send the filename to the check script
var checkData = $.extend(settings.formData, {filename: file.name});
$.post(settings.checkScript, checkData, function(fileExists) {
file.exists = parseInt(fileExists);
});
if (file.exists) {
if (!confirm('A file named ' + file.name + ' already exists in the upload folder.\nWould you like to replace it?')) {
// If not replacing the file, cancel the upload
methods.cancel.call($this, file);
return true;
}
}
}
// Trigger the check event
if (typeof settings.onCheck === 'function') {
settings.onCheck.call($this, file, file.exists);
}
return false;
}
// Upload a single file
$data.uploadFile = function(file, uploadAll) {
if (!file.skip && !file.complete && !file.uploading) {
file.uploading = true;
$data.uploads.current++;
$data.uploads.attempted++;
// Create a new AJAX request
xhr = file.xhr = new XMLHttpRequest();
// Start the upload
// Use the faster FormData if it exists
if (typeof FormData === 'function' || typeof FormData === 'object') {
// Create a new FormData object
var formData = new FormData();
// Add the form data
formData.append(settings.fileObjName, file);
// Add the rest of the formData
for (i in settings.formData) {
formData.append(i, settings.formData[i]);
}
// Open the AJAX call
xhr.open(settings.method, settings.uploadScript, true);
// On progress function
xhr.upload.addEventListener('progress', function(e) {
if (e.lengthComputable) {
$data.progress(e, file);
}
}, false);
// On complete function
xhr.addEventListener('load', function(e) {
if (this.readyState == 4) {
file.uploading = false;
if (this.status == 200) {
if (file.xhr.responseText !== 'Invalid file type.') {
$data.uploadComplete(e, file, uploadAll);
} else {
$data.error(file.xhr.responseText, file, uploadAll);
}
} else if (this.status == 404) {
$data.error('404_FILE_NOT_FOUND', file, uploadAll);
} else if (this.status == 403) {
$data.error('403_FORBIDDEN', file, uploadAll);
} else {
$data.error('Unknown Error', file, uploadAll);
}
}
});
// Send the form data (multipart/form-data)
xhr.send(formData);
} else {
// Send as binary
var reader = new FileReader();
reader.onload = function(e) {
// Set some file builder variables
var boundary = '-------------------------' + (new Date).getTime(),
dashes = '--',
eol = '\r\n',
binFile = '';
// Build an RFC2388 String
binFile += dashes + boundary + eol;
// Generate the headers
binFile += 'Content-Disposition: form-data; name="' + settings.fileObjName + '"';
if (file.name) {
binFile += '; filename="' + file.name + '"';
}
binFile += eol;
binFile += 'Content-Type: application/octet-stream' + eol + eol;
binFile += e.target.result + eol;
for (key in settings.formData) {
binFile += dashes + boundary + eol;
binFile += 'Content-Disposition: form-data; name="' + key + '"' + eol + eol;
binFile += settings.formData[key] + eol;
}
binFile += dashes + boundary + dashes + eol;
// On progress function
xhr.upload.addEventListener('progress', function(e) {
$data.progress(e, file);
}, false);
// On complete function
xhr.addEventListener('load', function(e) {
file.uploading = false;
var status = this.status;
if (status == 404) {
$data.error('404_FILE_NOT_FOUND', file, uploadAll);
} else {
if (file.xhr.responseText != 'Invalid file type.') {
$data.uploadComplete(e, file, uploadAll);
} else {
$data.error(file.xhr.responseText, file, uploadAll);
}
}
}, false);
// Open the ajax request
var url = settings.uploadScript;
if (settings.method == 'get') {
var params = $(settings.formData).param();
url += params;
}
xhr.open(settings.method, settings.uploadScript, true);
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
// Trigger the uploadFile event
if (typeof settings.onUploadFile === 'function') {
settings.onUploadFile.call($this, file);
}
// Send the file for upload
xhr.sendAsBinary(binFile);
}
reader.readAsBinaryString(file);
}
}
}
// Update a file upload's progress
$data.progress = function(e, file) {
if ($.inArray('onProgress', settings.overrideEvents) < 0) {
if (e.lengthComputable) {
var percent = Math.round((e.loaded / e.total) * 100);
}
file.queueItem.find('.fileinfo').html(' - ' + percent + '%');
file.queueItem.find('.progress-bar').css('width', percent + '%');
}
// Trigger the progress event
if (typeof settings.onProgress === 'function') {
settings.onProgress.call($this, file, e);
}
}
// Trigger an error
$data.error = function(errorType, file, uploadAll) {
if ($.inArray('onError', settings.overrideEvents) < 0) {
// Get the error message
switch(errorType) {
case '404_FILE_NOT_FOUND':
errorMsg = '404 Error';
break;
case '403_FORBIDDEN':
errorMsg = '403 Forbidden';
break;
case 'FORBIDDEN_FILE_TYPE':
errorMsg = 'Forbidden File Type';
break;
case 'FILE_SIZE_LIMIT_EXCEEDED':
errorMsg = 'File Too Large';
break;
default:
errorMsg = 'Unknown Error';
break;
}
// Add the error class to the queue item
file.queueItem.addClass('error')
// Output the error in the queue item
.find('.fileinfo').html(' - ' + errorMsg);
// Hide the
file.queueItem.find('.progress').remove();
}
// Trigger the error event
if (typeof settings.onError === 'function') {
settings.onError.call($this, errorType, file);
}
file.skip = true;
if (errorType == '404_FILE_NOT_FOUND') {
$data.uploads.errors++;
} else {
$data.queue.errors++;
}
if (uploadAll) {
methods.upload.call($this, null, true);
}
}
// Trigger when a single file upload is complete
$data.uploadComplete = function(e, file, uploadAll) {
if ($.inArray('onUploadComplete', settings.overrideEvents) < 0) {
file.queueItem.find('.progress-bar').css('width', '100%');
file.queueItem.find('.fileinfo').html(' - Completed');
file.queueItem.find('.progress').slideUp(250);
file.queueItem.addClass('complete');
}
// Trigger the complete event
if (typeof settings.onUploadComplete === 'function') {
settings.onUploadComplete.call($this, file, file.xhr.responseText);
}
if (settings.removeCompleted) {
setTimeout(function() { methods.cancel.call($this, file); }, 3000);
}
file.complete = true;
$data.uploads.successful++;
$data.uploads.count++;
$data.uploads.current--;
delete file.xhr;
if (uploadAll) {
methods.upload.call($this, null, true);
}
}
// Trigger when all the files are done uploading
$data.queueComplete = function() {
// Trigger the queueComplete event
if (typeof settings.onQueueComplete === 'function') {
settings.onQueueComplete.call($this, $data.uploads);
}
}
// ----------------------
// Initialize UploadiFive
// ----------------------
// Check if HTML5 is available
if (window.File && window.FileList && window.Blob && (window.FileReader || window.FormData)) {
// Assign an ID to the object
settings.id = 'uploadifive-' + $this.attr('id');
// Wrap the file input in a div with overflow set to hidden
$data.button = $('<div id="' + settings.id + '" class="uploadifive-button">' + settings.buttonText + '</div>');
if (settings.buttonClass) $data.button.addClass(settings.buttonClass);
// Style the button wrapper
$data.button.css({
'height' : settings.height,
'line-height' : settings.height + 'px',
'overflow' : 'hidden',
'position' : 'relative',
'text-align' : 'center',
'width' : settings.width
});
// Insert the button above the file input
$this.before($data.button)
// Add the file input to the button
.appendTo($data.button)
// Modify the styles of the file input
.hide();
// Create a new input
$data.createInput.call($this);
// Create the queue container
if (!settings.queueID) {
settings.queueID = settings.id + '-queue';
$data.queueEl = $('<div id="' + settings.queueID + '" class="uploadifive-queue" />');
$data.button.after($data.queueEl);
} else {
$data.queueEl = $('#' + settings.queueID);
}
// Add drag and drop functionality
if (settings.dnd) {
var $dropTarget = settings.dropTarget ? $(settings.dropTarget) : $data.queueEl.get(0);
$dropTarget.addEventListener('dragleave', function(e) {
// Stop FireFox from opening the dropped file(s)
e.preventDefault();
e.stopPropagation();
}, false);
$dropTarget.addEventListener('dragenter', function(e) {
// Stop FireFox from opening the dropped file(s)
e.preventDefault();
e.stopPropagation();
}, false);
$dropTarget.addEventListener('dragover', function(e) {
// Stop FireFox from opening the dropped file(s)
e.preventDefault();
e.stopPropagation();
}, false);
$dropTarget.addEventListener('drop', $data.drop, false);
}
// Send as binary workaround for Chrome
if (!XMLHttpRequest.prototype.sendAsBinary) {
XMLHttpRequest.prototype.sendAsBinary = function(datastr) {
function byteValue(x) {
return x.charCodeAt(0) & 0xff;
}
var ords = Array.prototype.map.call(datastr, byteValue);
var ui8a = new Uint8Array(ords);
this.send(ui8a.buffer);
}
}
// Trigger the oninit event
if (typeof settings.onInit === 'function') {
settings.onInit.call($this);
}
} else {
// Trigger the fallback event
if (typeof settings.onFallback === 'function') {
settings.onFallback.call($this);
}
return false;
}
});
},
// Write some data to the console
debug : function() {
return this.each(function() {
console.log($(this).data('uploadifive'));
});
},
// Clear all the items from the queue
clearQueue : function() {
this.each(function() {
var $this = $(this),
$data = $this.data('uploadifive'),
settings = $data.settings;
for (var key in $data.inputs) {
input = $data.inputs[key];
limit = input.files.length;
for (i = 0; i < limit; i++) {
file = input.files[i];
methods.cancel.call($this, file);
}
}
// Trigger the onClearQueue event
if (typeof settings.onClearQueue === 'function') {
settings.onClearQueue.call($this, $('#' + $data.settings.queueID));
}
});
},
// Cancel a file upload in progress or remove a file from the queue
cancel : function(file, fast) {
this.each(function() {
var $this = $(this),
$data = $this.data('uploadifive'),
settings = $data.settings;
// If user passed a queue item ID instead of file...
if (typeof file === 'string') {
if (!isNaN(file)) {
fileID = 'uploadifive-' + $(this).attr('id') + '-file-' + file;
}
file = $('#' + fileID).data('file');
}
file.skip = true;
$data.filesCancelled++;
if (file.uploading) {
$data.uploads.current--;
file.uploading = false;
file.xhr.abort();
delete file.xhr;
methods.upload.call($this);
}
if ($.inArray('onCancel', settings.overrideEvents) < 0) {
$data.removeQueueItem(file, fast);
}
// Trigger the cancel event
if (typeof settings.onCancel === 'function') {
settings.onCancel.call($this, file);
}
});
},
// Upload the files in the queue
upload : function(file, keepVars) {
this.each(function() {
var $this = $(this),
$data = $this.data('uploadifive'),
settings = $data.settings;
if (file) {
$data.uploadFile.call($this, file);
} else {
// Check if the upload limit was reached
if (($data.uploads.count + $data.uploads.current) < settings.uploadLimit || settings.uploadLimit == 0) {
if (!keepVars) {
$data.uploads.attempted = 0;
$data.uploads.successsful = 0;
$data.uploads.errors = 0;
var filesToUpload = $data.filesToUpload();
// Trigger the onUpload event
if (typeof settings.onUpload === 'function') {
settings.onUpload.call($this, filesToUpload);
}
}
// Loop through the files
$('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').each(function() {
_file = $(this).data('file');
// Check if the simUpload limit was reached
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)) {
return false;
}
if (settings.checkScript) {
// Let the loop know that we're already processing this file
_file.checking = true;
skipFile = $data.checkExists(_file);
_file.checking = false;
if (!skipFile) {
$data.uploadFile(_file, true);
}
} else {
$data.uploadFile(_file, true);
}
});
if ($('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').size() == 0) {
$data.queueComplete();
}
} else {
if ($data.uploads.current == 0) {
if ($.inArray('onError', settings.overrideEvents) < 0) {
if ($data.filesToUpload() > 0 && settings.uploadLimit != 0) {
alert('The maximum upload limit has been reached.');
}
}
// Trigger the onError event
if (typeof settings.onError === 'function') {
settings.onError.call($this, 'UPLOAD_LIMIT_EXCEEDED', $data.filesToUpload());
}
}
}
}
});
},
// Destroy an instance of UploadiFive
destroy : function() {
this.each(function() {
var $this = $(this),
$data = $this.data('uploadifive'),
settings = $data.settings;
// Clear the queue
methods.clearQueue.call($this);
// Destroy the queue if it was created
if (!settings.queueID) $('#' + settings.queueID).remove();
// Remove extra inputs
$this.siblings('input').remove();
// Show the original file input
$this.show()
// Move the file input out of the button
.insertBefore($data.button);
// Delete the button
$data.button.remove();
// Trigger the destroy event
if (typeof settings.onDestroy === 'function') {
settings.onDestroy.call($this);
}
});
}
}
$.fn.uploadifive = function(method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('The method ' + method + ' does not exist in $.uploadify');
}
}
})(jQuery);
\ No newline at end of file
... ...
/**
* 在线客服
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/16
*/
var $ = require('jquery');
var $questionTab = $('.question-tab .tab-item');
$questionTab.on('touchend', function() {
var clickTab = $(this).data('tab');
clickTab = '[data-tab-name="' + clickTab + '"]';
$questionTab.removeClass('current');
$(this).addClass('current');
$('.question-list').removeClass('current');
$(clickTab).addClass('current');
});
... ...
/**
* 订单详情页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/16
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload'),
Hammer = require('yoho.hammer');
var orderId = $('#order-detail').data('id');
var optHammer;
lazyLoad();
//订单删除
optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
optHammer.on('tap', function(e) {
var $cur = $(e.target);
if ($cur.hasClass('btn-del')) {
//删除订单
if (confirm('确定删除订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: orderId
}
});
}
} else if ($cur.hasClass('btn-cancel')) {
//取消订单
if (confirm('确定取消订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: orderId
}
});
}
}
});
\ No newline at end of file
... ...
... ... @@ -13,24 +13,125 @@ var $navLi = $('#order-nav > li'),
var $curContainer = $orderContainer.children('.orders').first();//保存当前显示的order-container
var navHammer;
var winH = $(window).height();
var activeIndex = 0; //当前active的项的index
var orderPage = [1, 0, 0, 0];
var loading = false;
var navHammer, orderHammer;
//加载订单
function getOrders() {
var opt = {
type: activeIndex + 1,
page: orderPage[activeIndex] + 1
},
num;
if (loading) {
return;
}
$.ajax({
type: 'GET',
url: '/home/getOrders',
data: opt,
success: function(data) {
if (data.code === 200) {
orderPage[opt.type] = opt.page;
if (opt.page === 1) {
$curContainer.html(data.data);
lazyLoad($curContainer.find('.lazy'));
} else {
num = $curContainer.children('.order').length;
$curContainer.append(data.data);
//lazyload
lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy'));
}
}
}
});
}
lazyLoad();
//导航切换
navHammer = new Hammer(document.getElementById('order-nav'));
navHammer.on('tap', function(e) {
var $cur = $(e.target).closest('li'),
index;
var $cur = $(e.target).closest('li');
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
activeIndex = +$cur.index();
$navLi.filter('.active').removeClass('active');
$cur.addClass('active');
$curContainer.addClass('hide');
$curContainer = $orderContainer.children(':eq(' + index + ')').removeClass('hide');
$curContainer = $orderContainer.children(':eq(' + activeIndex + ')').removeClass('hide');
if (orderPage[activeIndex] > 0) {
return;
} else {
getOrders();
}
});
//点击订单区域跳转订单详情页
orderHammer = new Hammer(document.getElementById('order-container'));
orderHammer.on('tap', function(e) {
var $cur = $(e.target),
$order,
id,
url;
if ($cur.closest('.locHref').length > 0) {
return;
}
$order = $cur.closest('.order');
id = $order.data('id');
if ($cur.closest('.del').length > 0) {
//Order delete
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: id
}
});
} else if ($cur.closest('.cancel').length > 0) {
//Order cancel
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: id
}
});
} else {
//Location to order detail
url = $order.data('href');
location.href = url;
}
});
$(window).scroll(function() {
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $orderContainer.height()) {
getOrders();
}
});
\ No newline at end of file
... ...
... ... @@ -4,34 +4,28 @@
* @date: 2015/11/12
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content');
var $curContainer = $favContainer.children('.fav-type').first();//保存当前显示的$favContainer
var favTabHammer;
require('./jquery.uploadifive');
//lazyLoad();
$('#upload-img').uploadifive({
'auto': false,
'buttonClass': 'nav-btn',
'formData': {
favTabHammer = new Hammer(document.getElementById('fav-tab'));
favTabHammer.on('tap', function(e) {
console.log(1);
var $cur = $(e.target).closest('li'),
index;
},
'fileType': 'image/*',
'uploadScript': 'url',
'fileObjName': 'imgName',
'fileSizeLimit': 1024,
'onAddQueueItem': function (file) {
console.log(file);
alert(1);
},
'onQueueComplete': function (file) {
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
$navLi.filter('.active').removeClass('active');
$cur.addClass('active');
$curContainer.addClass('hide');
$curContainer = $favContainer.children(':eq(' + index + ')').removeClass('hide');
});
});
\ No newline at end of file
... ...
var $ = require('jquery'),
Hammer = require('yoho.hammer');
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload');
Hammer = require('yoho.hammer'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload');
var page = 1,
winH,
hotnav,
listTop,
navSwiper,
notab = 0,
sort = '',
id = '';
function hotrank(page, sort, tab_id) {
function hotrank(page, sort, tabId, notab) {
$.ajax({
type: 'GET',
url: '/product/newsale/selectHotrank',
url: '/product/newsale/selectHotrank?' + sort,
dataType: 'html',
data: {
page: page,
sort: sort,
tab_id: tab_id
tab_id: tabId,
notab: notab
},
success: function(data) {
if (page === 1) {
$('#hotRank').html('');
$('.rank-main').remove();
}
$('#hotRank').append(data);
lazyLoad($('img.lazy'));
$('#yoho-footer').css('position', 'static');
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
navSwiper = new Swiper('.s-goods-nav', {
grabCursor: true,
slidesPerView: 'auto',
... ... @@ -38,9 +41,13 @@ function hotrank(page, sort, tab_id) {
$('.s-goods-nav .nav-item').each(function(index) {
hotnav = new Hammer($('.s-goods-nav .nav-item')[index]);
hotnav.on('tap', function(e) {
id = $('.s-goods-nav .nav-item').eq(index).data('id'),
sort = parseInt($('.s-goods-nav .nav-item').eq(index).data('sort').split('=')[1]);
hotrank(page, sort, id);
var navItme = $('.s-goods-nav .nav-item').eq(index);
id = navItme.data('id') ? navItme.data('id') : '';
sort = navItme.data('sort') ? navItme.data('sort') : '';
page = 1;
notab = 1;
hotrank(page, sort, id, notab);
});
});
}
... ... @@ -55,7 +62,8 @@ $(window).scroll(function () {
return;
}
page = 2;
hotrank(page, sort, id);
notab = 1;
hotrank(page, sort, id, notab);
});
hotrank(page, sort, id);
hotrank(page, sort, id, notab);
... ...
/**
* 为您优选
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/16
*/
var Swiper = require('yoho.iswiper');
var recommendSwiper;
recommendSwiper = new Swiper('.swiper-recommend', {
// lazyLoading: true,
// lazyLoadingInPrevNext: true,
slidesPerView: 'auto'
});
\ No newline at end of file
... ...
... ... @@ -62,4 +62,15 @@
text-overflow: ellipsis;
text-align: center;
}
.nav-btn {
display: block;
height: 100%;
position: absolute;
top: 0;
right: 0;
font-size: pxToRem(26px);
color: #b0b0b0;
padding-right: pxToRem(32px);
}
}
\ No newline at end of file
... ...
... ... @@ -43,7 +43,7 @@ $fav: sprite-map("me/fav/*.png",$spacing: 5px);
//收藏主体
.fav-content {
padding: 0 pxToRem(30px);
//padding: 0 pxToRem(30px);
.fav-null {
font-size: pxToRem(22px);
... ... @@ -74,5 +74,185 @@ $fav: sprite-map("me/fav/*.png",$spacing: 5px);
display: block;
font-size: pxToRem(26px);
}
.fav-product-list {
list-style: none;
margin-left: pxToRem(30px);
li {
height: auto;
overflow: hidden;
margin-top: pxToRem(20px);
}
.fav-img-box {
width: pxToRem(90px);
height: pxToRem(120px);
float: left;
margin-right: pxToRem(24px);
img {
display: block;
overflow: hidden;
width: 100%;
height: 100%;
}
}
.fav-info-list {
color: #444;
font-size: pxToRem(24px);
border-bottom: 1px solid #e0e0e0;
padding-bottom: pxToRem(20px);
height: pxToRem(120px);
overflow: hidden;
position: relative;
h2 {
width: pxToRem(430px);
@include ellipsis();
}
.fav-price {
.new-price {
color: #d1021c;
}
.price-underline {
text-decoration: line-through;
}
}
.save-price {
$width: pxToRem(image_width(sprite-file($fav, save-price)));
$height: pxToRem(image_height(sprite-file($fav, save-price)));
position: absolute;
bottom: pxToRem(20px);
left: 0;
width: 100%;
&.save-price-number {
text-indent: $width + pxToRem(10px);
&:before {
content: '';
display: block;
@include rem-sprite($fav, save-price);
width: $width;
height: $height;
position: absolute;
top: 50%;
left: 0;
margin-top: -$height / 2;
}
}
span {
color: #d1021c;
&.sell-out {
padding: pxToRem(5px) pxToRem(18px);
color: #fffefe;
@include border-radius(pxToRem(20px));
background: #7f7f7f;
font-size: pxToRem(22px);
}
&.del-fav {
$width: pxToRem(image_width(sprite-file($fav, fav-del)));
$height: pxToRem(image_height(sprite-file($fav, fav-del)));
@include rem-sprite($fav, fav-del);
width: $width;
height: $height;
position: absolute;
top: 50%;
right: pxToRem(30px);
margin-top: -$height / 2;
}
}
}
}
}
//品牌收藏
.fav-brand-swiper {
.swiper-header {
height: pxToRem(60px);
padding: pxToRem(20px) pxToRem(30px);
display: inline-block;
.swiper-logo {
height: 100%;
display: inline-block;
float: left;
margin-right: pxToRem(45px);
> img {
max-height: 100%;
vertical-align: middle;
}
}
.brand-info {
float: left;
.brand-name {
font-size: pxToRem(28px);
b {
color: #b0b0b0;
font-weight: normal;
}
}
.brand-update {
font-size: pxToRem(22px);
b {
color: #b0b0b0;
font-weight: normal;
}
.brand-new {
color: #86bf4a;
margin-right: pxToRem(24px);
}
.brand-discount {
color: #d1021c;
}
}
}
}
.swiper-container {
height: pxToRem(300px);
margin: 0 pxToRem(30px);
.swiper-slide {
width: pxToRem(225px);
//width: (225/580)*100%;
height: 100%;
float: left;
padding-right: pxToRem(30px);
&:nth-last-of-type(1) {
padding-right: 0;
}
img {
display: block;
width: 100%;
height: 100%;
overflow: hidden;
}
}
}
}
}
}
\ No newline at end of file
... ...
@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest", "address";
\ No newline at end of file
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service";
... ...
@function rem($n) {
@return $n / 40 * 1rem;
}
.online-service-page{
background: #f0f0f0;
.question {
background: #fff;
}
.question-title {
padding: rem(20) rem(30);
font-size: rem(28);
line-height: 1;
color: #b0b0b0;
}
.question-tab {
padding: rem(10) rem(30) rem(30);
font-size: rem(32);
line-height: rem(58);
text-align: center;
color: #b0b0b0;
.current {
color: #444;
}
.line {
margin: 0 rem(32);
border-left: 1px solid #b0b0b0;
}
}
.question-list {
display: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
&.current {
display: block;
}
li {
margin-left: rem(30);
width: rem(610);
font-size: rem(28);
line-height: rem(90);
border-bottom: 1px solid #ccc;
a {
display: block;
color: #444;
}
.iconfont {
float: right;
margin-right: rem(30);
color: #ccc;
}
&:last-child {
border-bottom: none;
}
}
}
.connect-info {
margin-top: 30px;
font-size: rem(28);
line-height: rem(50);
background: #fff;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
p {
margin-top: rem(25);
margin-left: rem(-72);
line-height: 1.5;
}
.iconfont {
font-size: rem(46);
}
.icon-yoho-enter {
color: #ccc;
float: right;
}
.connect-item {
position: relative;
a {
display: block;
padding: rem(20) rem(30) rem(20) rem(94);
color: #444;
}
&:after {
content: '';
position: absolute;
right: 0;
bottom: 0;
width: rem(548);
height: 1px;
background: #ccc;
}
&:last-child {
&:after {
content: none;
}
}
}
.icon {
display: inline-block;
margin-right: rem(28);
margin-left: rem(-70);
vertical-align:middle;
}
}
}
.online-service-detail-page {
background: #f0f0f0;
.qa-list {
.question-item {
margin-bottom: rem(32);
border-top: 1px solid #c8c7cc;
border-bottom: 1px solid #c8c7cc;
color: #444;
background: #fff;
&:last-child {
margin-bottom: 0;
}
}
%qa {
margin-left: rem(30);
padding: 0 rem(40) 0 rem(10);
font-size: rem(30);
line-height: rem(76);
font-weight: bold;
}
.question {
@extend %qa;
position: relative;
&:after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
border-top: 1px solid #c8c7cc;
}
}
.answer {
@extend %qa;
}
}
}
\ No newline at end of file
... ...
.order-detail-page {
background: #f0f0f0;
.block {
position: relative;
background: #fff;
padding: 20rem / $pxConvertRem 30rem / $pxConvertRem;
.iconfont {
position: absolute;
left: 30rem / $pxConvertRem;
top: 50%;
font-size: 40rem / $pxConvertRem;
margin-top: -30rem / $pxConvertRem;
}
}
.sub {
position: relative;
.iconfont {
left: 0;
}
}
.logistics {
display: block;
.icon-right {
right: 25rem / $pxConvertRem;
left: auto;
color: #b0b0b0;
}
.sub-content {
border-top: 1px solid #e0e0e0;
margin-top: 20rem / $pxConvertRem;
padding-top: 20rem / $pxConvertRem;
}
}
.owner-info {
border-bottom: 1px solid #e0e0e0;
line-height: 1.5;
}
.beside-icon {
margin-left: 60rem / $pxConvertRem;
}
.name-phone {
font-size: 30rem / $pxConvertRem;
span {
float: right;
}
}
.address {
font-size: 24rem / $pxConvertRem;
margin-top: 10rem / $pxConvertRem;
}
.order-status {
margin: 20rem / $pxConvertRem 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
padding-right: 0;
}
.sub-content span {
display: block;
color: #b0b0b0;
font-size: 24rem / $pxConvertRem;
}
.sub-content .sub-title {
display: block;
color: #000;
font-size: 26rem / $pxConvertRem;
}
.goods {
padding: 0;
margin-top: 20rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
}
.cost {
margin-bottom: 100rem / $pxConvertRem; /*排除被固定底部遮挡的影响*/
li {
font-size: 28rem / $pxConvertRem;
span {
float: right;
}
&:last-child span {
color: #f00;
}
}
}
.opt {
position: fixed;
bottom: 0;
left: 0;
right: 0;
text-align: right;
border-top: 1px solid #e0e0e0;
}
.btn {
display: inline-block;
box-sizing: border-box;
width: 140rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
@include border-radius(5px);
font-size: 26rem / $pxConvertRem;
text-align: center;
border: 1px solid #000;
}
.btn-pay {
color: #fff;
border: none;
background: #d0021b;
margin-left: 10rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
... ... @@ -2,11 +2,16 @@
background: #f0f0f0;
.order {
display: block;
background: #fff;
margin: 30rem / $pxConvertRem 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
&:last-child {
margin-bottom: 0;
}
.header, .footer {
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
... ... @@ -18,7 +23,7 @@
border-bottom: 1px solid #e0e0e0;
}
.trading-status {
.order-status {
float: right;
}
... ... @@ -37,7 +42,7 @@
border-top: 1px solid #e0e0e0;
text-align: right;
> .btn {
.btn {
display: inline-block;
box-sizing: border-box;
height: 60rem / $pxConvertRem;
... ... @@ -45,19 +50,34 @@
width: 140rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
text-align: center;
}
.cancel {
border: 1px solid #000;
@include border-radius(5px);
}
.pay {
background: #d0021b;
color: #fff;
border: none;
margin-left: 20rem / $pxConvertRem;
}
}
}
.no-order {
text-align: center;
color: #f0f0f0;
.iconfont {
font-size: 50px;
}
.walk-way {
display: block;
color: #fff;
background: #fff;
@include border-radius(5px);
}
}
}
.order-nav {
... ...
... ... @@ -2,6 +2,7 @@
width: 100%;
height: auto;
overflow: hidden;
margin-top: 20rem / $pxConvertRem;
background-color:#fff;
border-bottom:1px solid #e0e0e0;
ul{
... ...
@import "compass/layout";
$suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
.yoho-suggest-page {
... ... @@ -102,4 +104,97 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
}
}
}
//发表意见
.create-new-suggest {
display: block;
color: #444;
width: 100%;
height: pxToRem(88px);
line-height: pxToRem(88px);
text-align: center;
font-size: pxToRem(30px);
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
> span {
color: #b0b0b0;
font-size: pxToRem(26px);
}
}
}
// 提交页面
.yoho-suggest-sub-page {
width: 100%;
//height: 100%;
background: #f0f0f0;
.suggest-sub-form {
background: #fff;
width: 100%;
#suggest-textarea {
@include box-sizing();
width: 100%;
max-width: 100%;
min-width: 100%;
height: pxToRem(255px);
max-height: pxToRem(255px);
min-height: pxToRem(255px);
padding: pxToRem(30px);
font-size: pxToRem(26px);
line-height: pxToRem(48px);
//color: #b0b0b0;
color: #000;
display: block;
background: #fff;
border: none;
outline: none;
}
.img-form {
padding: 0 pxToRem(30px);
.img-add {
display: block;
width: pxToRem(130px);
height: pxToRem(130px);
border: 1px dashed #e0e0e0;
position: relative;
&:after {
$width: pxToRem(image_width(sprite-file($suggest, suggest-add)));
$height: pxToRem(image_height(sprite-file($suggest, suggest-add)));
content: '';
display: block;
@include rem-sprite($suggest, suggest-add);
width: $width;
height: $height;
position: absolute;
top: 50%;
left: 50%;
margin-top: -$height / 2;
margin-left: -$width / 2;
}
> input[type="file"] {
position: absolute;
//@include stretch();
@include opacity(0.2);
border: none;
outline: none;
display: block;
width: pxToRem(130px);
height: pxToRem(130px);
top: 0;
left: 0;
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,6 @@ $borderC:#e0e0e0;
$tableCellC:#eee;
$basicBtnC:#eb0313;
.good-detail-page {
/* basic component */
... ... @@ -213,7 +212,9 @@ $basicBtnC:#eb0313;
font-size: pxToRem(28px);
color: $mainFontC;
line-height: pxToRem(88px);
border-bottom: 1px solid $borderC;
border-bottom: 2px solid $borderC;
.iconfont{
// padding-right:28rem/$pxConvertRem;
font-size: inherit;
... ... @@ -263,6 +264,20 @@ $basicBtnC:#eb0313;
background-color: #fff;
border-bottom: 1px solid $borderC;
.user-name{
font-size: px2rem(24);
line-height: px2rem(62);
color:$mainFontC;
padding-left: px2rem(28);
padding-right: px2rem(18);
}
.goods-spec,
.comment-time{
font-size: px2rem(24);
line-height: px2rem(62);
}
.detail-content{
font-size: px2rem(28);
line-height: px2rem(36);
font-size: pxToRem(24px);
line-height: pxToRem(62px);
color:$mainFontC;
... ... @@ -284,6 +299,11 @@ $basicBtnC:#eb0313;
}
.detail-content,
.comment-time{
padding-left: px2rem(28);
}
.detail-content{
padding-right: px2rem(28);
padding-left: pxToRem(28px);
}
... ... @@ -297,20 +317,23 @@ $basicBtnC:#eb0313;
}
.comment-content-footer{
min-height: pxToRem(88px);
text-align: center;
background-color: #fff;
border-bottom: 1px solid $borderC;
line-height: pxToRem(88px);
font-size: pxToRem(28px);
a{
color: #e0e0e0;
.iconfont{
font-size: inherit;
}
}
}
min-height: pxToRem(88px);
text-align: center;
background-color: #fff;
border-bottom: 2px solid $borderC;
line-height: pxToRem(88px);
font-size: pxToRem(28px);
a{
color: #e0e0e0;
.iconfont{
font-size: inherit;
}
}
}
}
... ...
... ... @@ -38,15 +38,15 @@
text-align: center;
font-size: 22rem / $pxConvertRem;
color: #fff;
// background: image-url("sale-icon/rank.png") no-repeat;
background: url("../img/me/employ/rank.png") no-repeat;
background-position: center top;
background-size: auto 100%;
&.top {
// background: image-url("sale-icon/rank-t.png") no-repeat;
background: url("../img/me/employ/rank-t.png") no-repeat;
background-position: center top;
background-size: 100%;
line-height: 58rem / $pxConvertRem;
line-height: 54rem / $pxConvertRem;
}
}
... ...
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank";
\ No newline at end of file
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank", "_recommend-for-you.scss";
\ No newline at end of file
... ...
... ... @@ -7,9 +7,41 @@
</ul>
<div class="fav-content">
<div class="fav-type">
{{# hasFavProduct}}
<ul class="fav-product-list">
{{# hasFavProduct}}
<li>
<div class="fav-img-box">
<img src="{{imgUrl}}" alt=""/>
</div>
<div class="fav-info-list">
<h2>{{title}}</h2>
<div class="fav-price">
{{# discountPrice}}
<span class="new-price">{{.}}</span>
{{/ discountPrice}}
<span class="fav-price {{# discountPrice}}price-underline{{/ discountPrice}}">{{price}}</span>
</div>
{{/ hasFavProduct}}
{{# savePrice}}
<div class="save-price save-price-number">
比收藏时降价了<span>{{.}}</span>
<span class="del-fav"></span>
</div>
{{/ savePrice}}
{{^ savePrice}}
<div class="save-price">
{{# sellOut}}
<span class="sell-out">已售罄</span>
{{/ sellOut}}
<span class="del-fav"></span>
</div>
{{/ savePrice}}
</div>
</li>
{{/ hasFavProduct}}
</ul>
{{^ hasFavProduct}}
<span class="fav-null">您暂无收藏任何商品</span>
... ... @@ -18,7 +50,41 @@
</div>
<div class="fav-type hide">
{{# hasFavBrand}}
<div class="fav-brand-swiper">
<div class="swiper-header">
<div class="swiper-logo">
<img src="{{brandImg}}" alt=""/>
</div>
<div class="brand-info">
<span class="brand-name">{{brandName}}</span>
<div class="brand-update">
{{# update}}
<span class="brand-new">上新<b>{{.}}</b></span>
{{/ update}}
{{# discount}}
<span class="brand-discount">折扣<b>{{.}}</b></span>
{{/ discount}}
</div>
</div>
<a href="{{link}}"></a>
</div>
<div id="swiper-container-{{id}}" class="swiper-container" data-id="{{id}}">
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
<div class="brand-product">
<p class="{{# discount}}price-discount{{/ discount}}">
{{price}}
{{# discount}}<span>{{.}}{{/ discount}}<span>
</p>
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ productList}}
</ul>
</div>
</div>
{{/ hasFavBrand}}
{{^ hasFavBrand}}
... ...
... ... @@ -33,60 +33,60 @@
</div>
<div class="order-type clearfix">
<a class="type-item" href="/home/order">
<span class="iconfont">&#xe620;</span>
<br>代付款
<span class="iconfont">&#xe634;</span>
<br>待付款
</a>
<a class="type-item" href="/home/order">
<span class="iconfont">&#xe620;</span>
<br>代发货
<span class="iconfont">&#xe63b;</span>
<br>待发货
</a>
<a class="type-item" href="/home/order">
<span class="iconfont">&#xe620;</span>
<br>代收货
<span class="iconfont">&#xe633;</span>
<br>待收货
</a>
</div>
</div>
<div class="group-list">
<div class="list-item">
<span class="iconfont icon">&#xe620;</span>
<span class="iconfont icon">&#xe637;</span>
地址管理
<span class="iconfont num">3 &#xe604;</span>
</div>
</div>
<div class="group-list">
<div class="list-item">
<span class="iconfont icon">&#xe620;</span>
<span class="iconfont icon">&#xe63a;</span>
优惠券
<span class="iconfont num">{{coupon_num}} &#xe604;</span>
</div>
<div class="list-item">
<span class="iconfont icon">&#xe620;</span>
<span class="iconfont icon">&#xe635;</span>
YOHO
<span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
</div>
</div>
<div class="group-list">
<div class="list-item">
<span class="iconfont icon">&#xe620;</span>
<span class="iconfont icon">&#xe636;</span>
消息
<span class="iconfont num">{{inbox_total}} &#xe604;</span>
</div>
</div>
<div class="group-list">
<div class="list-item">
<span class="iconfont icon">&#xe620;</span>
<span class="iconfont icon">&#xe63c;</span>
在线客服
<span class="iconfont num">&#xe604;</span>
</div>
</div>
<div class="group-list">
<div class="list-item">
<span class="iconfont icon">&#xe620;</span>
<span class="iconfont icon">&#xe639;</span>
帮助
<span class="iconfont num">&#xe604;</span>
</div>
</div>
{{> me/recommend-for-you}}
{{> product/recommend-for-you}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="online-service-page yoho-page">
{{# service}}
<div class="question">
<div class="question-title">问题查询</div>
<div class="question-tab">
{{#tab}}
<span class="tab-item {{#current}}current{{/current}}" data-tab="{{tabid}}">{{tabname}}</span>
{{#iscut}}<span class="line"></span>{{/iscut}}
{{/tab}}
</div>
{{#question}}
<ul class="question-list {{#current}}current{{/current}}" data-tab-name="{{name}}">
{{#list}}
<li class="question-item">
<a href="{{link}}" title="{{title}}">
{{title}}
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</li>
{{/list}}
</ul>
{{/question}}
</div>
{{/ service}}
<div class="connect-info">
<div class="connect-item connect-online">
<a href="http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&amp;configID=123576&amp;jid=9277320930" target="_blank" title="在线客服">
<span class="icon iconfont icon-chat">&#xe63c;</span>
在线客服
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</div>
<div class="connect-item connect-tel">
<a href="tel:400-889-9649" title="电话客服">
<span class="icon iconfont icon-tel">&#xe63e;</span>
电话客服
<p>
400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
</p>
</a>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="online-service-detail-page yoho-page">
<div class="qa-list">
{{# list}}
<div class="question-item">
<div class="question">Q:{{q}}</div>
<div class="answer">{{a}}</div>
</div>
{{/ list}}
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="order-detail-page yoho-page">
{{# orderDetail}}
<div id="order-detail" data-id="{{orderNum}}">
<section class="owner-info block">
<span class="iconfont">&#xe631;</span>
<div class="beside-icon">
<p class="name-phone">
{{name}}
<span>{{phoneNum}}</span>
</p>
<p class="address">
{{address}}
</p>
</div>
</section>
<section class="order-status block">
<div class="status sub">
<span class="iconfont">&#xe632;</span>
<p class="beside-icon sub-content">
<span class="sub-title">{{orderStatus}}</span>
<span>订单编号:{{orderNum}}</span>
<span>下单时间:{{orderTime}}</span>
</p>
</div>
{{#if unreceived}}
<a class="logistics sub" href="{{logisticsUrl}}">
<span class="iconfont">&#xe630;</span>
<p class="beside-icon sub-content">
<span class="sub-title">物流信息</span>
<span>物流公司:{{logisticsCompany}}</span>
<span>快递单号:{{logisticsNum}}</span>
</p>
<span class="iconfont icon-right">&#xe614;</span>
</a>
{{/if}}
</section>
<section class="goods block">
{{# goods}}
{{> me/order/good}}
{{/ goods}}
</section>
<ul class="cost block">
<li>
商品总金额
<span>¥{{sumPrice}}</span>
</li>
<li>
活动金额
<span>-¥{{salePrice}}</span>
</li>
<li>
运费
<span>+¥{{freight}}</span>
</li>
<li>
YOHO币
<span>-¥{{yohoCoin}}</span>
</li>
<li>
实付金额
<span>¥{{price}}</span>
</li>
</ul>
<div class="opt block">
{{#unless unreceived}}
{{#unless unpaid}}
<span class="btn btn-del">删除订单</span>
{{/unless}}
{{/unless}}
{{#if unpaid}}
<span class="btn btn-cancel">取消订单</span>
<a href="{{payUrl}}">
<span class="btn btn-pay">立即付款</span>
</a>
{{/if}}
{{#if unreceived}}
<a href="{{logisticsUrl}}">
<span class="btn btn-check-logistics">查看物流</span>
</a>
{{/if}}
</div>
</div>
{{/ orderDetail}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -18,9 +18,7 @@
<div id="order-container" class="order-container">
<div class="all orders">
{{#each orders}}
{{> me/order/order}}
{{/each}}
{{> me/order/orders}}
</div>
<div class="unpaid orders hide"></div>
<div class="unshipped orders hide"></div>
... ...
... ... @@ -33,6 +33,9 @@
</div>
{{/ suggestContent}}
</div>
<a class="create-new-suggest" href="#">
反馈问题<span>(功能意见,界面意见)</span>
</a>
{{/ suggest}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="yoho-suggest-sub-page yoho-page">
{{# suggestSub}}
<div class="suggest-sub-form">
<textarea name="" id="suggest-textarea" placeholder="请输入意见反馈,我们会以消息形式回复您的建议或意见,改进产品体验,谢谢!"></textarea>
<div class="img-form">
<span class="img-add">
<input id="upload-img" type="file" name="fileselect[]" multiple />
</span>
</div>
</div>
{{/ suggestSub}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{#if tabs}}
<div class="s-goods-nav goods-nav">
<ul class="swiper-wrapper clearfix">
{{# tabs}}
{{# tabs}}
{{# title}}
<li class="swiper-slide nav-item" data-sort="{{ params}}" data-id="{{ id}}">
<span>{{ name}}</span>
</li>
{{/ title}}
{{/ tabs}}
{{/ tabs}}
</ul>
</div>
{{/if}}
<div class="rank-main">
<ul>
{{# goods}}
... ...
{{> home/floor_header_more}}
<div class="goods-category">
{{# big_image}}
{{#if list}}
<div class="category-swiper">
<ul class="swiper-wrapper">
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="{{title}}">
</a>
</li>
{{/ list}}
</ul>
<div class="swiper-pagination">
<div class="pagination-inner clearfix">
</div>
</div>
</div>
{{^}}
<div class="category-swiper">
<ul class="swiper-wrapper">
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="{{title}}">
</a>
</li>
{{/ list}}
</ul>
<div class="swiper-pagination">
<div class="pagination-inner clearfix">
</div>
</div>
<a href={{url}}>
<img class="lazy" data-original="{{img}}" alt="{{title}}">
</a>
</div>
{{/if}}
{{/ big_image}}
<ul class="category-list clearfix">
{{# list}}
... ...
... ... @@ -2,7 +2,7 @@
<div class="float-layer hide" id="float-layer-app">
<div class="float-layer-left">
<span class="yoho-icon iconfont">&#xe60d;</span>
<p>新用户首单减10</p>
<p>新用户送千元礼包</p>
</div>
<a href="javascript:void(0);" id="float-layer-close" >
<i class="close-icon iconfont">&#xe623;</i>
... ...
... ... @@ -28,7 +28,7 @@
a.async=1;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.12/yas.js','_yas');
})(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.13/yas.js','_yas');
</script>
{{> layout/use}}
{{> layout/analysis}}
... ...
... ... @@ -28,7 +28,7 @@
a.async=1;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.12/yas.js','_yas');
})(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.13/yas.js','_yas');
</script>
{{> layout/use}}
... ...
... ... @@ -9,5 +9,8 @@
{{#navTitle}}
<p class="nav-title">{{.}}</p>
{{/navTitle}}
{{# navBtn}}
<span class="nav-btn">{{.}}</span>
{{/ navBtn}}
</header>
{{/pageHeader}}
\ No newline at end of file
... ...
... ... @@ -201,7 +201,6 @@
</script>
{{/if}}
{{!-- 个人中心 --}}
{{!-- 个人中心首页 --}}
{{#if myIndexPage}}
<script>
seajs.use('js/me/index');
... ... @@ -212,16 +211,30 @@
seajs.use('js/me/order');
</script>
{{/if}}
{{!-- 个人中心: 商品收藏&品牌收藏 --}}
{{#if orderDetailPage}}
<script>
seajs.use('js/me/order-detail');
</script>
{{/if}}
{{#if favPage}}
{{!-- 个人中心: 收藏 --}}
<script>
seajs.use('js/me/fav');
</script>
{{/if}}
{{!-- 个人中心: 意见反馈 --}}
{{#if suggestPage}}
<script>
seajs.use('js/me/suggest');
</script>
{{/if}}
{{#if couponsPage}}
<script>
seajs.use('js/me/coupons');
</script>
{{/if}}
{{#if onlineServicePage}}
<script>
seajs.use('js/me/online-service');
</script>
{{/if}}
\ No newline at end of file
... ...
<div class="order" data-id="{{orderNum}}">
<div class="order" data-id="{{orderNum}}" data-href="{{detailUrl}}">
<header class="header">
订单编号:{{orderNum}}
<span class="trading-status">{{tradingStatus}}</span>
<span class="order-status">{{orderStatus}}</span>
</header>
<section class="order-goods">
{{# goods}}
... ... @@ -12,16 +12,27 @@
共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
</footer>
{{#if unpaid}}
<div class="order-opt">
{{!-- 对应订单状态的操作逻辑 --}}
{{!-- 完成和取消订单显示删除按钮 --}}
<div class="order-opt">
{{#unless unpaid}}
{{#unless unreceived}}
<span class="btn del">删除订单</span>
{{/unless}}
{{/unless}}
{{#if unpaid}}
<span class="btn cancel">取消订单</span>
<span class="btn pay">立即付款</span>
</div>
{{/if}}
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
</a>
{{/if}}
{{#with unreceived}}
<div class="order-opt">
<a class="check-logistics" href="{{.}}">查看物流</a>
</div>
{{/with}}
{{#if unreceived}}
<a class="locHref" href="{{logisticsUrl}}">
<span class="btn check-logistics">查看物流</span>
</a>
{{/if}}
</div>
</div>
\ No newline at end of file
... ...
{{#if walkwayUrl}}
<div class="no-order">
<span class="iconfont">&#xe632;</span>
<span>你还没有订单</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
</div>
{{^}}
{{#each orders}}
{{> me/order/order}}
{{/each}}
{{/if}}
\ No newline at end of file
... ...
... ... @@ -2,17 +2,17 @@
<div class="recommend-for-you">
<div class="title">为您优选新品</div>
<div class="swiper-recommend">
<div class="swiper-wrapper">
<ul class="swiper-wrapper">
{{#recommendList}}
<div class="swiper-slider">
<li class="swiper-slider">
<img class="img-box" src="{{thumb}}">
<div class="price">
<span class="sale-price"{{salePrice}}</span>
<span class="old-price"{{price}}</span>
</div>
</div>
</li>
{{/recommendList}}
</div>
</ul>
</div>
</div>
{{/ recommendForYou}}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@
use Action\AbstractAction;
use home\GradeModel;
use home\OrderModel;
use Plugin\Helpers;
/**
... ... @@ -15,24 +16,24 @@ use Plugin\Helpers;
*/
class HomeController extends AbstractAction
{
/**
* 个人中心入口
*/
public function indexAction()
{
// 设置网站标题
public function indexAction() {
// 设置网站标题
$this->setTitle('个人中心');
$this->setNavHeader('个人中心', true, SITE_MAIN);
$this->setNavHeader('个人中心', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$uid = 8826435;
$data = \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
// print_r($data);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
// print_r($data);
$data['myIndexPage'] = true;
$data['pageFooter'] = true;
... ... @@ -45,10 +46,15 @@ class HomeController extends AbstractAction
*/
public function ordersAction()
{
// $uid = $this->getUid();
// $type = $this->get('type', 1);
// 设置网站标题
$this->setTitle('我的订单');
$this->setNavHeader('我的订单', true, SITE_MAIN);
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
$uid = $this->getUid();
$uid = 8826435;
$type = $this->get('type', 1);
$order = \Index\UserModel::getUserOrderData($uid, $type);
$order = array(
'orders' => array(
... ... @@ -84,22 +90,20 @@ class HomeController extends AbstractAction
);
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
// print_r($orders);
}
/**
* 用户收藏的商品
*/
public function favoriteAction()
{
$uid = $this->getUid();
/**
* 用户收藏的商品
*/
public function favoriteAction() {
$uid = $this->getUid();
$favProducts = \Index\UserModel::getFavProductData($uid);
$favProducts = \Index\UserModel::getFavProductData($uid);
//print_r($favProducts);
//print_r($favProducts);
$this->_view->display('favorite', array(
'favPage' => true,
'favPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '我的收藏',
... ... @@ -107,166 +111,307 @@ class HomeController extends AbstractAction
),
'pageFooter' => true,
'favorite' => true,
'hasFavProduct' => false,
'hasFavBrand' => false
'hasFavProduct' => array(
'0' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'title' => 'adidas Originals ZX FLUXM22508 ',
'price' => '¥800',
'discountPrice' => false,
'savePrice' => false,
'sellOut' => true
),
'1' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'title' => 'adidas Originals ZX FLUXM22508 ',
'price' => '¥800',
'discountPrice' => '¥500',
'savePrice' => '¥300',
'sellOut' => false
)
),
'hasFavBrand' => array(
'0' => array(
'id'=> '1',
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'brandName' => 'VANS',
'update' => 12,
'discount' => 10,
'link' => '#',
'productList' => array(
'0' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'1' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'2' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'3' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
)
)
),
'1' => array(
'id'=> '2',
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'brandName' => 'VANS',
'update' => 12,
'discount' => 10,
'link' => '#',
'productList' => array(
'0' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'1' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'2' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
),
'3' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => '¥240'
)
)
),
'2' => array(
'id'=> '3',
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'brandName' => 'VANS',
'update' => 12,
'discount' => 10,
'link' => '#',
'productList' => array(
'imgUrl' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'price' => '¥240',
'discount' => false
)
)
)
));
}
}
/**
* 用户收藏的品牌
*/
public function favoritebrandAction()
{
$uid = $this->getUid();
$gender = Helpers::getGenderByCookie();
/**
* 用户收藏的品牌
*/
public function favoritebrandAction() {
$uid = $this->getUid();
$gender = Helpers::getGenderByCookie();
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
print_r($favBrands);
}
print_r($favBrands);
}
/**
* 个人信息
*/
public function personalDetailsAction()
{
/**
* 个人信息
*/
public function personalDetailsAction() {
$this->setTitle('个人信息');
$this->setNavHeader('个人信息', true, SITE_MAIN);
$this->setNavHeader('个人信息', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$data = \Index\UserModel::getUserProfileData($uid);
$data['pageFooter'] = true;
// $uid = $this->getUid();
$uid = 967016;
$data = \Index\UserModel::getUserProfileData($uid);
$data['pageFooter'] = true;
$this->_view->display('personal-details', $data);
}
/**
* YOHO币
*/
public function currencyAction() {
// $uid = $this->getUid();
$this->setNavHeader('YOHO币', true, false);
}
/**
* YOHO币
*/
public function currencyAction()
{
// $uid = $this->getUid();
$this->setNavHeader('YOHO币', true, false);
$uid = 967016;
$currency = \Index\UserModel::getYohoCoinData($uid);
$this->_view->display('currency', $currency);
}
$uid = 967016;
$currency = \Index\UserModel::getYohoCoinData($uid);
/**
* 优惠券
*/
public function couponsAction()
{
$this->setTitle('优惠券');
$this->setNavHeader('优惠券', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$status = $this->get('status', 0);
$uid = 8826435;
$coupons = array(
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
'couponsUrl' => array(
\Index\UserModel::getCouponData($uid, 0),
\Index\UserModel::getCouponData($uid, 1),
),
'couponsPage' => true
);
print_r($coupons);
$this->_view->display('coupons', $coupons);
}
}
/**
* 优惠券
*/
public function couponsAction() {
/**
* 我的消息
*/
public function messageAction()
{
// $uid = $this->getUid();
$page = $this->get('page', 0);
$size = $this->get('size', 10);
$this->setTitle('优惠券');
$this->setNavHeader('优惠券', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 8826435;
$status = $this->get('status', 0);
$coupons = array(
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
'couponsPage' => true
);
print_r($coupons);
$this->_view->display('coupons', $coupons);
}
$uid = 967016;
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
/**
* 我的消息
*/
public function messageAction() {
// $uid = $this->getUid();
$page = $this->get('page', 0);
$size = $this->get('size', 10);
print_r($messages);
$uid = 967016;
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
}
print_r($messages);
}
/**
* 地址管理
*/
public function addressAction()
{
// 设置网站标题
/**
* 地址管理
*/
public function addressAction() {
// 设置网站标题
$this->setTitle('地址管理');
$this->setNavHeader('地址管理', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$address = \Index\UserModel::getAddressData($uid);
$address = \Index\UserModel::getAddressData($uid);
$addressList = \Index\UserModel::getAddressListData($uid);
// print_r($address);
// print_r($address);
$this->_view->display('address', array(
'addressPage' => true,
'pageFooter' => true,
'address' => $address
'address' => $address,
'addressList' => $addressList
));
}
}
/**
* 修改地址
* 修改地址或者添加新地址
*/
public function editAddressAction()
{
// 设置网站标题
$this->setTitle('修改地址');
$this->setNavHeader('修改地址', true, SITE_MAIN);
public function saveAddressAction() {
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 967016;
$address = $this->post('address', '');
$area_code = $this->post('area_code', '');
$consignee = $this->post('consignee', '');
$email = $this->post('email', '');
$id = $this->post('id', null);
$mobile = $this->post('mobile', '');
$zip_code = $this->post('zip_code', '');
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
// $uid = $this->getUid();
$uid = 967016;
/**
* 设置默认地址
*/
public function defaultAddressAction() {
$result = array();
if ($this->isAjax()) {
// $uid = $this->getUid();
$uid = 967016;
$id = $this->post('id', '');
$result = \Index\UserModel::setDefaultAddress($uid, $id);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
$address = \Index\UserModel::getAddressData($uid);
//在线客服
public function onlineServiceAction() {
// 设置网站标题
$this->setTitle('在线客服');
$this->setNavHeader('在线客服', true, SITE_MAIN);
// print_r($address);
$service = home\OnlineModel::getOnlineServiceInfo();
$this->_view->display('edit_address', array(
'editAddressPage' => true,
'pageFooter' => true,
'address' => $address
$this->_view->display('online_service', array(
'onlineServicePage' => true,
// 'pageFooter' => true,
'service' => $service
));
}
/**
* 在线客服
*/
public function onlineServiceAction()
{
$service = \Index\UserModel::getOnlineServiceData();
print_r($service);
}
//在线客服-具体详情
public function onlineServiceDetailAction() {
$service = array();
$cateId = $this->get('cateId', 0);
$cateName = $this->get('cateName', '');
if ($cateId > 0) {
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
}
$this->setTitle('在线客服');
$this->setNavHeader($cateName, true, '');
$this->_view->display('online_service_detail', $service);
}
/**
* 我的逛
*/
public function myGuangAction()
{
echo 'My Guang';
}
/**
* 我的逛
*/
public function myGuangAction() {
echo 'My Guang';
}
/**
* 意见反馈
*/
public function suggestAction()
{
$udid = $this->getUdid();
$page = $this->get('page', 1);
$limit = $this->get('limit', 30);
/**
* 意见反馈
*/
public function suggestAction() {
$udid = $this->getUdid();
$page = $this->get('page', 1);
$limit = $this->get('limit', 30);
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
//print_r($suggest);
//print_r($suggest);
$this->_view->display('suggest', array(
'suggestPage' => true,
'suggestPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '意见反馈'
... ... @@ -294,8 +439,33 @@ class HomeController extends AbstractAction
'bad' => false)
)
));
}
}
/**
* 意见反馈-提交表单
*/
public function suggest_subAction()
{
$udid = $this->getUdid();
$page = $this->get('page', 1);
$limit = $this->get('limit', 30);
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
//print_r($suggest);
$this->_view->display('suggest_sub', array(
'suggestPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '反馈问题',
'navBtn' => '提交'
),
'suggestSub' => true,
'pageFooter' => true
));
}
/**
* 异步保存意见反馈数据
... ... @@ -306,45 +476,131 @@ class HomeController extends AbstractAction
$uid = $this->getUid();
$content = $this->post('content', '');
$suggest_type = $this->get('suggest_type', 2);
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
$this->echoJson($result);
}
}
/**
* 会员等级展示页
*/
public function gradeAction() {
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
$this->setNavHeader('会员等级');
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this->getUid();
$uid = '7566245'; //临时测试用
$data = GradeModel::getGrade($gender, $channel, $uid);
$data['pageFooter'] = true;
$this->_view->display('vip-grade', $data);
}
/*
* 会员特权查看页
*/
public function preferentialAction() {
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
$this->setNavHeader('会员特权详情');
$channel = Helpers::getChannelByCookie();
$uid = $this->getUid();
$data = GradeModel::getPreferential($channel, $uid);
$data['pageFooter'] = true;
$this->_view->display('privilege', $data);
}
/*
* 我的订单页面
*/
public function orderAction() {
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
$type = $this->get('type', 1);
$page = $this->get('page', 1);
$limit = $this->get('limit', 10);
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$uid = $this->getUid();
$uid = '7566245'; //测试用
$this -> setTitle('我的订单');
$this -> setNavHeader('我的订单');
//调用模型层getOrder方法获得并处理数据
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
//如果没有订单数据,就给一个随便逛逛链接
$order = array();
if (!empty($data)) {
$order['orders'] = $data;
} else {
$order['walkwayUrl'] = 'http://www.baidu.com';
}
//渲染模板
$this->_view->display('order', array(
'order' => $order,
'orderPage' => true,
'pageFooter' => true
));
}
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
/*
* 我的订单-处理ajax请求页面(切换订单状态)
*/
public function getOrdersAction() {
$this->echoJson($result);
}
//判断是不是ajax请求
if (!$this->isAjax()) {
$this->error();
}
self::orderAction();
}
}
/**
* 会员等级展示页
*/
public function gradeAction(){
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
$this->setNavHeader('会员等级');
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this -> getUid();
$uid = '7566245';//临时测试用
$data = GradeModel::getGrade($gender,$channel,$uid);
$data['pageFooter'] = true;
$this -> _view -> display('vip-grade',$data);
}
/*
*会员特权查看页
*/
public function preferentialAction(){
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
$this->setNavHeader('会员特权详情');
$channel = Helpers::getChannelByCookie();
$uid = $this -> getUid();
$data = GradeModel::getPreferential($channel,$uid);
$data['pageFooter'] = true;
$this -> _view -> display('privilege',$data);
}
public function orderDetailAction()
{
$data = array(
'name' => '毛毛莉Lydia',
'phoneNum' => '18600001133',
'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
'orderStatus' => '订单取消',
'orderNum' => '418358063',
'orderTime' => '2014-03-10 17:25:10',
'orderCancel' => true,
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'Adidas Originals ZX FLUXM22508',
'color' => '黄',
'size' => '43',
'price' => '699.00',
'count' => '2'
),
array(
'id' => 1,
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'B.Duck浴室玩伴mini浮水鸭',
'gift' => true,
'color' => '黄',
'size' => '43',
'price' => '0.00',
'count' => '1'
)
),
'sumPrice' => 799,
'salePrice' => 80,
'freight' => 5,
'coupon' => 0,
'yohoCoin' => 5,
'price' => 719
);
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
}
}
... ...
... ... @@ -26,43 +26,41 @@ class GradeModel
}
}
//调用接口获取数据
$data = GradeData::getGradeData($channel, $uid);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {
switch (intval($data['data']['current_vip_level'])) {
case 0://普通会员
$result['vipGrade']['vip0'] = true;
break;
case 1://银卡会员
$result['vipGrade']['vip1'] = true;
break;
case 2://金卡会员
$result['vipGrade']['vip2'] = true;
break;
case 3://白金会员
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['data']['current_year_cost'];
//升级下一等级会员的进度;
$result['vipGrade']['percent'] = 100*(round($data['data']['current_total_cost'] / $data['data']['next_need_cost'], 2));
//距离升级所需消费金额
if ($data['data']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['data']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['data']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = $userProfile['data']['username'];
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential',null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['data']['enjoy_preferential'];
$data = GradeData::getGradeData($gender, $channel, $uid);
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
$result['vipGrade']['vip0'] = true;
break;
case 1://银卡会员
$result['vipGrade']['vip1'] = true;
break;
case 2://金卡会员
$result['vipGrade']['vip2'] = true;
break;
case 3://白金会员
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
//升级下一等级会员的进度;
$result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2));
//距离升级所需消费金额
if ($data['grade']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = $data['userProfile']['username'];
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
... ... @@ -74,7 +72,7 @@ class GradeModel
Cache::set(CacheConfig::KEY_ACTION_HOME_GRADE, $result);
}
}
return $result;
}
... ... @@ -97,7 +95,7 @@ class GradeModel
if (isset($data['code']) && $data['code'] == 200) {
$result['vipGrade']['privilege'] = $data['data'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
... ... @@ -109,7 +107,7 @@ class GradeModel
Cache::set(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, $result);
}
}
return $result;
}
... ...
<?php
namespace home;
use LibModels\Wap\Home\OrderData;
use Plugin\Helpers;
use Configs\CacheConfig;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Order
*
*/
class OrderModel
{
/**
* 订单相关数据处理
*/
public function getOrder($type = 1, $page = 1, $limit, $gender, $yh_channel, $uid) {
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_HOME_ORDER_ORDER;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
//检查数据返回是否正常,正常则处理数据
if ($data['code'] == 200 && isset($data['data'])) {
foreach ($data['data']['order_list'] as $key => $vo) {
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
$result[$key]['orderStatus'] = $vo['status_str'];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost'];
//订单商品列表数据
$result[$key]['goods'] = self::formatOrderGoods($vo['order_goods']);
//订单status判断订单处于什么状态。
do {
//订单取消状态
if ($vo['is_cancel'] === 'Y') {
$result[$key]['canceled'] = true;
break;
}
//支付方式不是货到付款时,计算订单状态
if ($vo['payment_type'] != 2) {
switch ($vo['status']) {
case 0:
$result[$key]['unpaid'] = true;
break;
case 1:
case 2:
case 3:
case 4:
case 5:
$result[$key]['unreceived'] = true;
$result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
break;
case 6:
$result[$key]['completed'] = true;
break;
default:
break;
}
} elseif ($vo['payment_type'] == 2) {
//订单为货到付款订单时,订单没有未支付状态
switch ($vo['status']) {
case 0 || 1 || 2 || 3 || 4 || 5:
$result[$key]['unreceived'] = true;
//此处备注,接口没有返回logisticsUrl数据
$resault[$key]['logisticsUrl'] = "备注:暂无logisticsUrl数据";
break;
case 6:
$result[$key]['completed'] = true;
break;
default:
break;
}
}
} while (false);
}
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
}
return $result;
}
//格式化订单商品
static function formatOrderGoods($orderGoods) {
$arr = array();
foreach ($orderGoods as $key => $vo) {
$arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
$arr[$key]['name'] = $vo['product_name'];
$arr[$key]['color'] = $vo['color_name'];
$arr[$key]['size'] = $vo['size_name'];
$arr[$key]['price'] = $vo['goods_price'];
$arr[$key]['count'] = $vo['buy_number'];
if ($vo['goods_type'] == 'gift') {
$arr[$key]['gift'] = true;
} elseif ($vo['goods_type'] == 'price_gift') {
$arr[$key]['advanceBuy'] = true;
}
}
return $arr;
}
}
... ...
... ... @@ -103,8 +103,6 @@ class UserModel
// 处理用户订单数据
if (isset($orderData['data']) && !empty($orderData['data'])) {
$result = $orderData['data'];
$oneOrder = array();
foreach ($orderData['data']['order_list'] as $val) {
$oneOrder = array();
... ... @@ -120,21 +118,18 @@ class UserModel
$oneGoods = array();
$oneGoods['id'] = 1;
$oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
$oneGoods['name'] = $val['product_name'];
$oneGoods['color'] = $val['color_name'];
$oneGoods['size'] = $val['size_name'];
$oneGoods['size_name'] = $val['size_name'];
$oneGoods['price'] = $val['goods_price'];
$oneGoods['count'] = $val['buy_number'];
$result['goods'][] = $oneGoods;
$oneGoods['name'] = $goods['product_name'];
$oneGoods['color'] = $goods['color_name'];
$oneGoods['size'] = $goods['size_name'];
$oneGoods['price'] = $goods['goods_price'];
$oneGoods['count'] = $goods['buy_number'];
$oneOrder[] = $oneGoods;
}
$result['orders'][] = $oneOrder;
}
}
print_r($result);
return $result;
}
... ... @@ -218,7 +213,7 @@ class UserModel
// 处理优惠券数据
if (isset($coupons['data']) && !empty($coupons['data'])) {
$result = $coupons['data'];
$result = $coupons['data']['info'];
}
return $result;
... ... @@ -246,6 +241,96 @@ class UserModel
}
/**
* 处理地址列表数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的地址列表数据
*/
public static function getAddressListData($uid)
{
$result = array();
// 调用接口获取地址列表数据
$address = UserData::addressListData($uid);
// 处理地址数据
if (isset($address['data']) && !empty($address['data'])) {
$result = $address['data'];
}
return $result;
}
/**
* 保存地址数据
*
* @param int $uid 用户ID
* @param string $address 地址信息
* @param int $area_code 城市码
* @param string $consignee 收货人
* @param string $email 邮箱地址
* @param int $id 地址唯一标识符id
* @param string $mobile 手机号码
* @param string $zip_code 邮编
* @return array|mixed 处理之后的地址列表数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$result = array();
// 参数验证
if (empty($uid)) {
$result['code'] = 400;
$result['message'] = '用户不可用';
} else if (empty($address)) {
$result['code'] = 401;
$result['message'] = '请输入可用的地址信息';
} else if (empty($area_code)) {
$result['code'] = 402;
$result['message'] = '地区码不可用';
} else if (empty($consignee)) {
$result['code'] = 403;
$result['message'] = '请输入收件人姓名';
} else if (!empty($email) && Helpers::verifyEmail($email)) {
$result['code'] = 404;
$result['message'] = '输入的邮箱地址格式不正确';
} else if (!empty($mobile) && Helpers::verifyMobile($mobile)) {
$result['code'] = 404;
$result['message'] = '输入的手机号码格式不正确';
} else {
// 调用接口保存地址数据
$address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
// 处理返回结果
if (isset($address['code']) && $address['code'] == 200) {
$result = $address['data'];
}
}
return $result;
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function setDefaultAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口设置默认地址
$address = UserData::setDefaultAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 处理意见反馈数据
*
* @param string $udid 客户端唯一标识
... ...
... ... @@ -227,19 +227,25 @@ class NewsaleModel
return $result;
}
/**
* 筛选出来的热销排行榜商品数据处理
*
* @param array $data 筛选出来的原数据
* @return array 处理之后的数据
*/
public static function selectTopData($data)
/**
* 筛选出来的热销排行榜商品数据处理
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param boolean $notab 时候返回顶部tab的数据,默认返回
* @param integer $limit 查询返回的最大限制数
* @param integer $page 分页第几页
* @return array 处理之后的数据
*/
public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
{
$result = array();
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
$result = NewSaleProcess::newSaleData($data['data']);
unset($result['filter']);
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
}
return $result;
... ...
<?php
namespace home;
use LibModels\Wap\Home\OnlineData;
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 在线客服相关数据处理
*/
class OnlineModel
{
//获取在线帮助分类
public static function getOnlineServiceInfo($clientType = 'iphone')
{
//调用接口获取数据
$res = OnlineData::getOnlineServiceInfo($clientType);
$cateInfo = $res['data'];
$question = array();
$tab = array();
if ($cateInfo)
{
foreach ($cateInfo as $key => $value)
{
//强制截成3个tab
if ($key > 2)
{
break;
}
$tab[$key]['tabid'] = 'tab' . $value['id'];
$tab[$key]['tabname'] = $value['category_name'];
$tab[$key]['iscut'] = true;
$tab[$key]['current'] = (!$key) ? TRUE : FALSE;
$question[$key]['name'] = 'tab' . $value['id'];
$question[$key]['current'] = (!$key) ? TRUE : FALSE;
$sub = $value['sub'];
$qTmp = array();
if ($sub)
{
foreach ($sub as $sk => $sv)
{
$qTmp[$sk]['title'] = $sv['category_name'];
$qTmp[$sk]['link'] = '/home/onlineservicedetail?cateId=' . $sv['id'].'&cateName='.$sv['category_name'];
}
}
$question[$key]['list'] = $qTmp;
}
$question[0]['current'] = true;
$tab[count($tab) - 1]['iscut'] = false;
}
//处理返回信息
$result = array(
'header' => array('title' => '在线客服'),
'tab' => $tab,
'question' => $question
);
return $result;
}
//加载分类下的问题和解决方法
public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
{
$result = array();
if (!$cateId)
{
return $result;
}
$res = OnlineData::getOnlineServiceDetail($cateId, $clinetType);
$questionInfo = $res['data'];
if ($questionInfo)
{
$list = array();
if ($questionInfo)
{
foreach ($questionInfo as $qk => $qv)
{
$list[$qk]['q'] = $qv['title'];
$list[$qk]['a'] = $qv['content'];
}
}
//处理返回信息
$result = array(
'header' => array('title' => '在线客服'),
'list' => $list
);
}
return $result;
}
}
... ...
... ... @@ -41,6 +41,7 @@ class BrandController extends AbstractAction
}
// 渲染模板
print_r(Category\BrandModel::getBrandByChannel($channel));
$this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
}
... ...
... ... @@ -106,12 +106,11 @@ class NewsaleController extends AbstractAction
$tab_id = $this->get('tab_id', null);
$limit = $this->get('limit', 50);
$page = $this->get('page', 1);
$notab = (boolean)$this->get('notab', false);
// 获取性别
$gender = Helpers::getGenderByCookie();
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
$result = \Product\NewsaleModel::selectTopData($data);
$result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
}
if (empty($result)) {
... ...