Authored by yangyang

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

... ... @@ -55,16 +55,19 @@ function initInfosEvt($container) {
cHammer = new Hammer($container[0]);
//点赞或者收藏事件
cHammer.on('tap', function(e) {
var $this = $(e.target),
opt = 'ok',
$likeBtn,
$collectBtn,
$btn,
$info;
$likeBtn = $this.closest('.like-btn');
if ($likeBtn.length > 0) {
if ($likeBtn.hasClass('like')) {
e.preventDefault();
//点赞
$btn = $this.closest('.like-btn');
if ($btn.length > 0) {
if ($btn.hasClass('like')) {
opt = 'cancel';
}
... ... @@ -80,22 +83,23 @@ function initInfosEvt($container) {
var code = data.code;
if (code === 200) {
$likeBtn.next('.like-count').text(data.data);
$btn.next('.like-count').text(data.data);
//切换点赞状态
$likeBtn.toggleClass('like');
$btn.toggleClass('like');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
return;
}
// 2015/11/03 hf: 增加APP里的收藏资讯功能. 写得不对的地方还请大神修改!
$collectBtn = $this.closest('.collect-btn');
if ($collectBtn.length > 0) {
if ($collectBtn.hasClass('collected')) {
//APP收藏
$btn = $this.closest('.collect-btn');
if ($btn.length > 0) {
if ($btn.hasClass('collected')) {
opt = 'cancel';
}
... ... @@ -111,7 +115,7 @@ function initInfosEvt($container) {
if (data.code && data.code === 200) {
//切换收藏状态
$collectBtn.toggleClass('collected');
$btn.toggleClass('collected');
}
},
error: function() {
... ...
... ... @@ -6,6 +6,22 @@
var $ = require('jquery');
var info = require('../guang/info');
var $infoList = $('#info-list');
info.initInfoEvt($('#info-list'));
\ No newline at end of file
var winH = $(window).height();
var info = require('../guang/info'),
loadMore = info.loadMore;
var setting = {
page: 2,
end: false
};
info.initInfoEvt($infoList);
$(window).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infoList.height()) {
loadMore($infoList, setting);
}
});
\ No newline at end of file
... ...
... ... @@ -112,7 +112,7 @@ orderHammer.on('tap', function(e) {
//Order delete
$.ajax({
type: 'GET',
url: '/home/delOrder',
url: '/home/deleteOrder',
data: {
id: id
},
... ... @@ -136,8 +136,8 @@ orderHammer.on('tap', function(e) {
success: function(data) {
if (data.code === 200) {
//取消订单
alert('order cancel');
//取消订单页面刷新
location.href = location.href;
}
}
});
... ...
{{> layout/header}}
<div class="my-guang-page yoho-page">
<div class="info-list">
<div id="info-list" class="info-list">
{{# myGuang}}
{{> guang/info}}
{{/ myGuang}}
... ...
... ... @@ -242,4 +242,9 @@
<script>
seajs.use('js/me/address');
</script>
{{/if}}
{{#if myGuangPage}}
<script>
seajs.use('js/me/my-guang');
</script>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -434,7 +434,7 @@ class HomeController extends AbstractAction
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this->getUid();
$uid = '7566245'; //临时测试用
$uid = '10267443'; //临时测试用
$data = GradeModel::getGrade($gender, $channel, $uid);
$data['pageFooter'] = true;
$this->_view->display('vip-grade', $data);
... ...