Authored by uedxwg

冲突修改

... ... @@ -212,9 +212,10 @@ class UserData
* @param int $uid 用户ID
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @param string $type 请求类型 get,post
* @return array YOHO币接口返回的数据
*/
public static function yohoCoinData($uid, $page = 1, $limit = 10)
public static function yohoCoinData($uid, $page = 1, $limit = 10,$type = 'get')
{
$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.lists';
... ... @@ -223,7 +224,7 @@ class UserData
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::$type(Yohobuy::API_URL, $param);
}
/**
... ...
var $ = require('jquery');
var page = 1;
function ajaxCurrencyDetail(page) {
$.ajax({
type: 'POST',
url: '/home/ajaxCurrencyDetail',
dataType: 'html',
data: {
page: page
},
success: function(data) {
$('.coin-detail').append(data);
window.rePosFooter();
}
});
}
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
page++;
ajaxCurrencyDetail(page);
return;
}
});
ajaxCurrencyDetail(page);
\ No newline at end of file
... ...
... ... @@ -18,3 +18,4 @@ require('./address-act');
require('./logistic');
require('./pay');
require('./personal-details');
require('./currency');
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay","yoho-coin-new", "yoho-coin-detail";
... ...
.yoho-coin-detail-page {
background: #f0f0f0;
.money{
width: 100%;
height: pxToRem(70px);
background:#fff;
margin-bottom: pxToRem(20px);
line-height: pxToRem(70px);
font-size: pxToRem(30px);
text-indent: 1em;
span{
color: #f00;
font-weight: bold;
}
}
.coin-detail {
background: #fff;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
}
.detail-item {
position: relative;
margin-left: pxToRem(30px);
border-bottom: 1px solid #e0e0e0;
color: #444;
padding: pxToRem(15px) 0;
.title {
width: pxToRem(480px);
font-size: pxToRem(28px);
line-height: pxToRem(40px);
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.time {
font-size: pxToRem(20px);
line-height: pxToRem(30px);
color: #b0b0b0;
}
.count {
position: absolute;
right: 0;
top: 0;
margin-right: pxToRem(30px);
font-size: pxToRem(28px);
font-weight: bold;
line-height: pxToRem(100px);
}
}
li:last-child {
.detail-item {
border-bottom: none;
}
}
}
... ...
.yoho-coin-new-page {
padding-top: pxToRem(30px);
text-align: center;
.coin-num {
color: #d0021b;
font-size: pxToRem(66px);
font-weight: bold;
line-height: pxToRem(106px);
letter-spacing: pxToRem(8px);
}
.info {
color: #b0b0b0;
font-size: pxToRem(24px);
line-height: 1;
.dollar {
display: inline-block;
margin-right: pxToRem(6px);
vertical-align: middle;
width: pxToRem(24px);
height: pxToRem(24px);
background: image-url("me/yoho-coin/dollar.png") center center;
background-size: 100%;
}
}
.more {
display: inline-block;
margin: pxToRem(30px) 0;
color: #444;
font-size: pxToRem(24px);
line-height: pxToRem(36px);
width: pxToRem(152px);
height: pxToRem(36px);
text-align: center;
border: 1px solid #444;
border-radius: pxToRem(36px);
}
.coin-tip {
margin-bottom: pxToRem(30px);
padding: pxToRem(20px) pxToRem(30px);
font-size: pxToRem(24px);
line-height: pxToRem(32px);
color: #dc6870;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
.icon {
display: inline-block;
width: pxToRem(32px);
height: pxToRem(32px);
font-weight: bold;
border: 2px solid #dc6870;
border-radius: 50%;
}
}
.banner {
margin-bottom: pxToRem(30px);
}
}
... ...
{{# 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">
<div class="money">你拥有的有货币:<span>{{ money}}</span></div>
<ul class="coin-detail"></ul>
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="yoho-coin-new-page yoho-page">
<div class="coin">
<p class="coin-num">
7876
</p>
<p class="info">
<span class="dollar"></span>
YOHO
</p>
<a href="" class="more">查看明细</a>
<div class="coin-tip">
<span class="icon">!</span>
您有300个YOHO币即将于20171231日过期,请尽快使用
</div>
</div>
<div class="banner">
<a href="">
{{!-- 演示图片 --}}
<img src="http://temp.im/640x200" alt="">
</a>
</div>
{{> home/maybe_like}}
</div>
{{> layout/footer}}
... ...
... ... @@ -81,7 +81,7 @@
优惠券
<span class="iconfont num">{{coupon_num}} &#xe604;</span>
</a>
<a class="list-item" href="/home/currency">
<a class="list-item" href="/home/currencyDetail">
<span class="iconfont icon">&#xe635;</span>
YOHO
<span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
... ...
... ... @@ -306,5 +306,8 @@
{{#if payCenterPage}}
<script>
seajs.use('js/me/pay');
{{#if currencyDetail}}
<script>
seajs.use('js/me/currency');
</script>
{{/if}}
... ...
... ... @@ -876,5 +876,44 @@ class HomeController extends AbstractAction
);
$this->_view->display('helpDetail', $data);
}
/**
* YOHO币详情 新版
*/
public function currencyDetailAction()
{
$this->setTitle('YOHO币');
$this->setNavHeader('YOHO币', true, false);
$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(
'money' => $data['money'],
'pageFooter' => true,
'currencyDetail' => true,
'currencyDetailPage' => true
));
}
/**
* YOHO币详情 AJAX
*/
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
));
}
}
... ...
... ... @@ -369,6 +369,35 @@ class UserModel
}
/**
* 处理YOHO币变化履历数据
*
* @param int $uid 用户ID
* @param int $page 当前页
* @param int $limit 一页记录数
* @return array|mixed 处理之后的YOHO币数据
*/
public static function getYohoCoinLists($uid, $page, $limit)
{
$result = array();
// 调用接口获取YOHO币
$yohoCoin = UserData::yohoCoinData($uid, $page, $limit, 'post');
// 处理YOHO币数据
$coinList = $yohoCoin['data']['coinlist'];
$data['money'] = $yohoCoin['data']['total'];
foreach($coinList as $key => $val){
$result[$key]['title'] = $val['message'];
$result[$key]['time'] = $val['date'];
if($val['num'] > 0){
$val['num'] = '+'.$val['num'];
}
$result[$key]['count'] = $val['num'];
}
$data['list'] = $result;
return $data;
}
/**
* 处理优惠券数据
*
* @param int $uid 用户ID
... ...