Authored by ccbikai

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

... ... @@ -943,7 +943,8 @@
{
name: '',
active: true,
typeId: 1
typeId: 1,
url: ''
},
...
]
... ...
... ... @@ -24,11 +24,12 @@ class Yohobuy
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_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
// 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_MYCENTER = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的个人中心接口URL
// const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
/**
* 私钥列表
... ...
/**
* 我的逛
* @author xuqi<qi.xu@yoho.cn>
* @date: 2015/11/17
*/
var $ = require('jquery');
var info = require('../guang/info');
info.initInfoEvt($('#info-list'));
\ No newline at end of file
... ...
... ... @@ -17,27 +17,32 @@ var winH = $(window).height();
var activeType = $navLi.filter('.active').data('type'); //当前active的项的index
var orderPage = {};
var order = {
page: 0,
end: false
};
var inAjax = false;
var loading = require('../plugin/loading');
var navHammer, orderHammer;
var orderHammer;
//加载订单
function getOrders() {
function getOrders(option) {
var opt = {
type: activeType,
page: orderPage[activeType] ? (orderPage[activeType] + 1) : 1
page: order.page + 1
};
var show = option && option.showLoadingMask;
if (inAjax) {
return;
}
inAjax = true;
loading.showLoadingMask();
show && loading.showLoadingMask();
$.ajax({
type: 'GET',
... ... @@ -46,23 +51,27 @@ function getOrders() {
success: function(data) {
var num;
if (data.code === 200) {
orderPage[opt.type] = opt.page;
if (data !== ' ') {
order.page = opt.page;
if (opt.page === 1) {
$curContainer.html(data.data);
$curContainer.html(data);
lazyLoad($curContainer.find('.lazy'));
} else {
num = $curContainer.children('.order').length;
$curContainer.append(data.data);
$curContainer.append(data);
//lazyload
lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy'));
lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ')').find('.lazy'));
}
window.rePosFooter(); //重新计算底部位置
} else {
order.end = true;
}
inAjax = false;
loading.hideLoadingMask();
show && loading.hideLoadingMask();
}
});
}
... ... @@ -83,33 +92,6 @@ lazyLoad();
loading.init($('body')); //满屏loading
//导航切换
navHammer = new Hammer(document.getElementById('order-nav'));
navHammer.on('tap', function(e) {
var $cur = $(e.target).closest('li'),
index;
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
$navLi.filter('.active').removeClass('active');
$cur.addClass('active');
$curContainer.addClass('hide');
$curContainer = $orderContainer.children(':eq(' + index + ')').removeClass('hide');
activeType = $cur.data('type');
if (orderPage[activeType]) {
return;
} else {
getOrders();
}
});
//点击订单区域跳转订单详情页
orderHammer = new Hammer(document.getElementById('order-container'));
orderHammer.on('tap', function(e) {
... ... @@ -168,9 +150,13 @@ orderHammer.on('tap', function(e) {
});
$(window).scroll(function() {
if ($(window).scrollTop() + winH >
if (order.end === false && $(window).scrollTop() + winH >
$(document).height() - 0.25 * $orderContainer.height()) {
getOrders();
//下拉请求时不显示mask
getOrders({
noLoadingMask: true
});
}
});
... ...
... ... @@ -11,7 +11,8 @@ var page = 1,
navSwiper,
notab = 0,
sort = '',
id = '';
id = '',
noResult = '<p class="no-result">未找到相关搜索结果</p>';
function hotrank(page, sort, tabId, notab) {
loading.showLoadingMask();
... ... @@ -28,7 +29,11 @@ function hotrank(page, sort, tabId, notab) {
if (page === 1) {
$('.rank-main').remove();
}
if (data === ' ') {
$('#hotRank').html(noResult);
} else {
$('#hotRank').append(data);
}
lazyLoad($('img.lazy'));
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
winH = $(window).height();
... ...
... ... @@ -45,9 +45,8 @@
p{
width: 55.517241%;
height: auto;
padding: 0 5% 10em / $pxConvertRem;;
padding: 0 5% 18em / $pxConvertRem;;
float: left;
font-size: 44em / $pxConvertRem;
&:first-of-type{
padding-top:30em / $pxConvertRem;
font-size: 60em / $pxConvertRem;
... ...
... ... @@ -106,7 +106,14 @@
border-bottom: 1px solid #e0e0e0;
background: #fff;
> li{
a {
display: block;
height: 100%;
width: 100%;
color: #b0b0b0;
}
> li {
float: left;
height: 90rem / $pxConvertRem;
width: 25%;
... ... @@ -115,7 +122,7 @@
font-size: 26rem / $pxConvertRem;
text-align: center;
&.active {
&.active a {
color: #000;
}
}
... ...
... ... @@ -3,18 +3,25 @@
<span class="active">未使用</span>
<span>已使用</span>
</div>
{{# couponsUrl}}
<div class="employ-list">
{{# unused}}
<div class="employ-main">
<span>50</span>
<p>【summer sale】下装满¥399减¥50券</p>
<p>有效期:2014.07.28 - 2014.09.15</p>
</div>
{{/ unused}}
</div>
<div class="employ-list not none">
{{# used}}
<div class="employ-main">
<span>60</span>
<p>【summer sale】下装满¥399减¥60券</p>
<p>有效期:2014.07.28 - 2014.09.15</p>
<span>{{ money }}</span>
<p>{{ coupon_name }}</p>
<p>{{ couponValidity }}</p>
</div>
{{/ used}}
</div>
{{/ couponsUrl}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@
<ul id="order-nav" class="order-nav clearfix">
{{#each navs}}
<li {{#if active}}class="active"{{/if}} data-type="{{typeId}}">
{{name}}
<a href="{{url}}">{{name}}</a>
</li>
{{/each}}
</ul>
... ...
... ... @@ -212,8 +212,6 @@ class HomeController extends AbstractAction
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
'couponsPage' => true
);
print_r($coupons);
$this->_view->display('coupons', $coupons);
}
... ... @@ -361,26 +359,31 @@ class HomeController extends AbstractAction
}
/**
* 意见反馈-提交表单
* 意见反馈-提交表单页面
*/
public function suggest_subAction() {
$udid = $this->getUdid();
$page = $this->get('page', 1);
$limit = $this->get('limit', 30);
public function suggestSubAction() {
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
// 设置网站标题
$this->setTitle('反馈问题');
//print_r($suggest);
$this->_view->display('suggest_sub', array(
$param = \Api\Yohobuy::param();
unset($param['private_key']);
$param['project'] = 'suggest';
$param['client_secret'] = 'e7807a9522ab99af8b8fd926e1ebbd9a';
$data = array(
'suggestPage' => true, //加载js
'pageHeader' => array(
'navBack' => true,
'navTitle' => '反馈问题',
'navBtn' => '提交'
),
'param' => $param,
'suggestSub' => true,
'pageFooter' => true
));
);
print_r($data);
$this->_view->display('suggest_sub', $data);
}
/**
... ... @@ -456,7 +459,7 @@ class HomeController extends AbstractAction
}
//ajax请求订单页面
public function getOrderAction() {
public function getOrdersAction() {
//判断是不是ajax请求
if (!$this->isAjax()) {
$this->error();
... ...