Authored by uedxwg

有货币消费记录

var $ = require('jquery');
var page = 0;
var page = 1;
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
page++;
$.ajax({
function ajaxCurrencyDetail(page) {
$.ajax({
type: 'POST',
url: '/home/currencyDetail',
url: '/home/ajaxCurrencyDetail',
dataType: 'html',
data: {
page: page
},
success: function(data) {
console.log(1);
$('.coin-detail').append(data);
window.rePosFooter();
}
});
};
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
page++;
ajaxCurrencyDetail(page);
return;
}
});
\ No newline at end of file
});
ajaxCurrencyDetail(page)
\ No newline at end of file
... ...
.yoho-coin-detail-page {
background: #f0f0f0;
padding-bottom: pxToRem(40px);
.money{
width: 100%;
height: pxToRem(70px);
... ...
{{# currency}}
<li>
<div class="detail-item">
<p class="title">{{title}}</p>
<p class="time">{{time}}</p>
<div class="count">
{{count}}
</div>
</div>
</li>
{{/ currency}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="yoho-coin-detail-page yoho-page">
{{# money}}
<div class="money">你拥有的有货币:<span>{{ money}}</span></div>
{{/ money}}
<ul class="coin-detail">
{{# currency}}
<li>
<div class="detail-item">
<p class="title">{{title}}</p>
<p class="time">{{time}}</p>
<div class="count">
{{count}}
</div>
</div>
</li>
{{/ currency}}
</ul>
<ul class="coin-detail"></ul>
</div>
{{> layout/footer}}
... ...
... ... @@ -286,7 +286,7 @@
seajs.use('js/me/logistic');
</script>
{{/if}}
{{#if currency}}
{{#if currencyDetail}}
<script>
seajs.use('js/me/currency');
</script>
... ...
... ... @@ -825,17 +825,38 @@ class HomeController extends AbstractAction
*/
public function currencyDetailAction()
{
$this->setTitle('YOHO币');
$this->setTitle('YOHO币');
$this->setNavHeader('YOHO币', true, false);
$page = $this->get('page', 1);
$size = $this->get('size', 10);
//$data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
$data['money'] = '0';
$page = $this->post('page',1);
$size = $this->post('size', 20);
// $data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
$data = UserModel::getYohoCoinLists(3965746,$page,$size);
$this->_view->display('currency-detail', array(
'currency' => $data['list'],
'money' => $data['money'],
'pageFooter' => true,
'currencyDetail' => true,
'currencyDetailPage' => true
));
}
/**
* YOHO币详情 新版
*/
public function ajaxCurrencyDetailAction()
{
$data['list'] = array();
$data['money'] = 0;
$page = $this->post('page',1);
$size = $this->post('size', 20);
$data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
// $data = UserModel::getYohoCoinLists(3965746,$page,$size);
$this->_view->display('ajax-currency-detail', array(
'currency' => $data['list'],
'pageFooter' => true,
'currencyDetailPage' => true
));
}
}
... ...