Authored by uedxwg

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -1250,13 +1250,23 @@
### 支付中心
{
'payAppInfo' : {
'appIcon' : 'http://static.yohobuy.com/images/icon.png',
'payLink' : '/weixin/pay/'
'app' : '微信支付',
'hint' : '需下载微信客户端',
'subHint' : '推荐使用'
}
'payAppInfo' : [
{
'appIcon' : 'http://static.yohobuy.com/images/icon.png',
'payLink' : '/weixin/pay/',
'appId': 'weixin',
'app' : '微信支付',
'hint' : '需下载微信客户端',
'subHint' : '推荐使用'
},{
'appIcon' : 'http://static.yohobuy.com/images/icon.png',
'payLink' : '/weixin/pay/',
'appId': 'baidu',
'app' : '百度支付',
'hint' : '需下载微信客户端',
'subHint' : '推荐使用'
}
]
}
### 物流详情
... ... @@ -1266,9 +1276,14 @@
'logisticUrl' : 'http://www.shunfeng.com',
'logisticCompany' : '顺丰',
'logisticNumber' : '1231231231',
'logisticDetail' : {
'status' : '南京市 派送中',
'date' : '2015-12-03'
}
'logisticDetail' : [
{
'status' : '南京市 派送中',
'date' : '2015-12-03'
}, {
'status' : '南京市 准备中',
'date' : '2015-12-03'
}
]
}
... ...
... ... @@ -139,7 +139,7 @@ class Yohobuy
if (!empty($data)) {
$url = self::httpBuildQuery($url, $data);
}
var_dump($url);
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
... ...
... ... @@ -76,33 +76,17 @@ class LoginData
}
/**
* 写入SESSION会话
* 登出SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function signinSession($uid)
public static function signoutSession($token)
{
$param = array();
$param['uid'] = $uid;
$param['token'] = md5($uid . '#@!@#');
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/index', $param);
}
/**
* 写入SESSION会话
*
* @param int $uid 用户ID
* @return array
*/
public static function checkSession($uid)
{
$param = array();
$param['uid'] = $uid;
$param['token'] = md5($uid . '#@!@#');
$param['token'] = $token;
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/val', $param);
return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/logout', $param);
}
}
... ...
... ... @@ -77,7 +77,7 @@ class Call extends Factory
if (is_array($token) && isset($token['uid']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$userInfo = $this->client->show_user_by_id($token['uid']);
... ... @@ -108,7 +108,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$result = $this->client->friends_by_id($params['uid'], $params['cursor'], $params['count']);
... ... @@ -133,7 +133,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$result = $this->client->bilateral($params['uid'], $params['page'], $params['count']);
... ... @@ -163,7 +163,7 @@ class Call extends Factory
{
$content .= $link;
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$response = $this->client->upload($content, $image);
... ... @@ -190,7 +190,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
if ($uid !== null)
{
... ... @@ -218,7 +218,7 @@ class Call extends Factory
if (is_array($token) && isset($token['access_token']) && is_string($content))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client->update($content);
}
... ... @@ -238,7 +238,7 @@ class Call extends Factory
{
if (is_array($token) && isset($token['access_token']) && isset($uid))
{
$this->client = new SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client = new \SaeTClientV2($this->apiConfig['appId'], $this->apiConfig['appKey'], $token['access_token']);
$this->client->send_dm_by_id($uid, $content, $id);
}
}
... ...
... ... @@ -18,13 +18,14 @@ var introUrl = $('#introUrl').val(),
var sizeSwiper,
refSwiper;
require('../recommend-for-you.js');
//判断是否要显示向左滑动提示
function hiddenTips($ele) {
var offsetContainer,
offsetLastColumn;
if ($ele.length > 0) {
var offsetContainer = $ele[0].getBoundingClientRect().right;
var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
offsetContainer = $ele[0].getBoundingClientRect().right;
offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
if (offsetLastColumn - offsetContainer < 0) {
... ...
... ... @@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
//add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
... ...
/**
* 商品详情 --滚动页面加载
* @author: Lynnic
* @date: 2015/11/25
*/
// var $ = require('jquery'),
// loading = require('../../plugin/loading'),
// tip = require('../../plugin/tip');
// var loadMoreUrl = $('#loadMoreUrl').val(),
// $commentsDiv = $('#goods-comments'),
// $consultsDiv = $('#goods-consults'),
// winH = $(window).height(),
// searching = false,
// end = false;
// var jsonObj;
// //插入评论列表底部
// function insertCommentsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="comment-item">';
// html += '<span class="user-name">' + json[i].userName + '</span>';
// html += '<span class="goods-spec">' + json[i].desc + '</span>';
// html += '<span class="goods-spec">' + json[i].content + '</span>';
// html += '<span class="goods-spec">' + json[i].time + '</span>';
// }
// $commentsDiv.append(html);
// }
// //插入咨询列表底部
// function insertConsultsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="consult-item"> ';
// html += '<div class="question"> ';
// html += '<span class="iconfont">&#xe639;</span> ';
// html += '<p> ';
// html += json[i].question + '<br> ';
// html += '<span class="time">' + json[i].time + '</span> ';
// html += '</p> ';
// html += '</div> ';
// html += '<div class="answer"> ';
// html += '<span class="iconfont">&#xe63c;</span> ';
// html += '<p>' + json[i].answer + '</p> ';
// html += '</div> ';
// html += '</div> ';
// }
// $consultsDiv.append(html);
// }
// function search() {
// if (searching || end) {
// return;
// }
// searching = true;
// loading.showLoadingMask();
// $.ajax({
// type: 'GET',
// url: loadMoreUrl,
// success: function(data) {
// if (data.length > 0) {
// jsonObj = JSON.parse(data);
// if ($commentsDiv.length > 0) {
// insertCommentsDiv(jsonObj);
// } else if ($consultsDiv.length > 0) {
// insertConsultsDiv(jsonObj);
// }
// }
// searching = false;
// end = true;
// loading.hideLoadingMask();
// },
// error: function() {
// tip.show('网络断开连接了~');
// searching = false;
// loading.hideLoadingMask();
// }
// });
// }
// function scrollHandler() {
// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
// search();
// }
// }
// //srcoll to load more
// $(window).scroll(function() {
// window.requestAnimationFrame(scrollHandler);
// });
\ No newline at end of file
... ... @@ -8,6 +8,6 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/loadmore');
require('./detail/consultform');
require('./newsale/hot-rank');
\ No newline at end of file
require('./newsale/hot-rank');
... ...
/**
* 为您优选
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/16
*/
var Swiper = require('yoho.iswiper'),
$ = require('jquery');
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
preferenceUrl = $('#preferenceUrl').val();
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}).fail(function() {
$recommendForYou.hide();
});
}
... ...
... ... @@ -24,7 +24,7 @@
width: pxToRem(126px);
height: pxToRem(126px);
border-radius: 50%;
border: pxToRem(6px) solid #a7a8a9;
border: pxToRem(6px) solid #a7a8a9;
background-image: image-url("me/index/user-avatar.png");
background-size: 100%;
}
... ... @@ -46,7 +46,7 @@
}
.vip-3 {
@include rem-sprite($vip, vip-3);
@include rem-sprite($vip, vip-3);
}
.vip-2 {
... ... @@ -91,7 +91,7 @@
font-size: pxToRem(22px);
line-height: pxToRem(38px);
width: pxToRem(213px);
&:after {
content: '';
position: absolute;
... ... @@ -153,16 +153,17 @@
.num {
position: absolute;
padding: 0 pxToRem(8px);
top: 0;
right: pxToRem(40px);
min-width: pxToRem(16px);
font-size: pxToRem(24px);
line-height: pxToRem(32px);
top: pxToRem(-24px);
right: pxToRem(36px);
width: pxToRem(72px);
height: pxToRem(72px);
font-size: pxToRem(40px);
line-height: pxToRem(72px);
color: #fff;
background: #F03D35;
background: #f03d35;
text-align: center;
border-radius: pxToRem(20px);
border-radius: 50%;
@include transform(scale(0.5));
}
}
... ... @@ -184,7 +185,7 @@
padding: 0 pxToRem(30px);
font-size: pxToRem(32px);
line-height: pxToRem(88px);
&.highlight {
background: #eee;
}
... ... @@ -214,4 +215,4 @@
float: right;
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -44,22 +44,22 @@
<a class="type-item" href="/home/order?type=2">
<span class="iconfont">&#xe634;</span>
<br>待付款
{{#if pendingPaymentCount}}
<span class="num">{{pendingPaymentCount}}</span>
{{#if wait_pay_num}}
<span class="num">{{wait_pay_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=3">
<span class="iconfont">&#xe63b;</span>
<br>待发货
{{#if dueOutGoodsCount}}
<span class="num">{{dueOutGoodsCount}}</span>
{{#if wait_cargo_num}}
<span class="num">{{wait_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=4">
<span class="iconfont">&#xe633;</span>
<br>待收货
{{#if dueInGoodsCount}}
<span class="num">{{dueInGoodsCount}}</span>
{{#if send_cargo_num}}
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
</div>
... ...
... ... @@ -12,7 +12,7 @@
{{# is_discount}}
<p class="good-tag sale-tag">SALE</p>
{{/ is_discount}}
{{# is_yohoood}}
{{# is_yohood}}
<div class="good-tag yohood-tag">新品节</div>
{{/ is_yohoood}}
{{# is_limited}}
... ... @@ -136,6 +136,9 @@
{{#if id}}
<input id="productId" type="hidden" value="{{id}}">
{{/if}}
{{#if preferenceUrl}}
<input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -46,7 +46,8 @@ class HomeController extends AbstractAction
$data = array(
'myIndexPage' => true,
'showDownloadApp' => true,
'pageFooter' => true
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
);
$uid = $this->getUid(true);
if ($uid) {
... ...
... ... @@ -62,10 +62,9 @@ class UserModel
'brand_favorite_total',
'product_favorite_total',
'product_browse',
'dueInGoodsCount',
'dueOutGoodsCount',
'pendingPaymentCount',
'refundGoodsCount'
'send_cargo_num',
'wait_cargo_num',
'wait_pay_num',
);
foreach ($infoNumData['data'] as $key => &$val) {
... ...
... ... @@ -16,7 +16,7 @@ class LoginController extends AbstractAction
* 登录页
*/
public function indexAction()
{
{
$this->setTitle('登录');
$refer = $this->get('refer');
... ... @@ -67,14 +67,15 @@ class LoginController extends AbstractAction
/**
* 退出
*
* @todo
*/
public function outAction()
{
$this->setCookie('_UID', '');
$refer = $this->server('HTTP_REFERER', SITE_MAIN);
$token = $this->get('token');
LoginData::signoutSession($token);
$this->go($refer);
}
... ... @@ -126,6 +127,7 @@ class LoginController extends AbstractAction
}
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
$data['data']['href'] = $refer;
} while (false);
$this->echoJson($data);
... ...
... ... @@ -40,6 +40,13 @@ routes.interational.route.module = Passport
routes.interational.route.controller = Login
routes.interational.route.action = International
; 登录页
routes.logout.type = "rewrite"
routes.logout.match = "/passport/signout/index"
routes.logout.route.module = Passport
routes.logout.route.controller = Login
routes.logout.route.action = out
; 找回密码(手机号)
routes.phoneback.type = "rewrite"
routes.phoneback.match = "/phoneback.html"
... ...