Authored by uedxwg

冲突修改

@@ -212,9 +212,10 @@ class UserData @@ -212,9 +212,10 @@ class UserData
212 * @param int $uid 用户ID 212 * @param int $uid 用户ID
213 * @param int $page 第几页,默认1 213 * @param int $page 第几页,默认1
214 * @param int $limit 限制读取的数目,默认10 214 * @param int $limit 限制读取的数目,默认10
  215 + * @param string $type 请求类型 get,post
215 * @return array YOHO币接口返回的数据 216 * @return array YOHO币接口返回的数据
216 */ 217 */
217 - public static function yohoCoinData($uid, $page = 1, $limit = 10) 218 + public static function yohoCoinData($uid, $page = 1, $limit = 10,$type = 'get')
218 { 219 {
219 $param = Yohobuy::param(); 220 $param = Yohobuy::param();
220 $param['method'] = 'app.yohocoin.lists'; 221 $param['method'] = 'app.yohocoin.lists';
@@ -223,7 +224,7 @@ class UserData @@ -223,7 +224,7 @@ class UserData
223 $param['limit'] = $limit; 224 $param['limit'] = $limit;
224 $param['client_secret'] = Sign::getSign($param); 225 $param['client_secret'] = Sign::getSign($param);
225 226
226 - return Yohobuy::get(Yohobuy::API_URL, $param); 227 + return Yohobuy::$type(Yohobuy::API_URL, $param);
227 } 228 }
228 229
229 /** 230 /**
  1 +var $ = require('jquery');
  2 +var page = 1;
  3 +
  4 +function ajaxCurrencyDetail(page) {
  5 + $.ajax({
  6 + type: 'POST',
  7 + url: '/home/ajaxCurrencyDetail',
  8 + dataType: 'html',
  9 + data: {
  10 + page: page
  11 + },
  12 + success: function(data) {
  13 + $('.coin-detail').append(data);
  14 + window.rePosFooter();
  15 + }
  16 + });
  17 +}
  18 +
  19 +$(window).scroll(function() {
  20 + if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
  21 + page++;
  22 + ajaxCurrencyDetail(page);
  23 + return;
  24 + }
  25 +});
  26 +
  27 +ajaxCurrencyDetail(page);
@@ -18,3 +18,4 @@ require('./address-act'); @@ -18,3 +18,4 @@ require('./address-act');
18 require('./logistic'); 18 require('./logistic');
19 require('./pay'); 19 require('./pay');
20 require('./personal-details'); 20 require('./personal-details');
  21 +require('./currency');
1 $vip: sprite-map("me/vip/*.png", $spacing: 10px); 1 $vip: sprite-map("me/vip/*.png", $spacing: 10px);
2 $fav: sprite-map("me/fav/*.png", $spacing: 5px); 2 $fav: sprite-map("me/fav/*.png", $spacing: 5px);
3 3
4 -@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay";  
5 - 4 +@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";
  1 +.yoho-coin-detail-page {
  2 + background: #f0f0f0;
  3 + .money{
  4 + width: 100%;
  5 + height: pxToRem(70px);
  6 + background:#fff;
  7 + margin-bottom: pxToRem(20px);
  8 + line-height: pxToRem(70px);
  9 + font-size: pxToRem(30px);
  10 + text-indent: 1em;
  11 + span{
  12 + color: #f00;
  13 + font-weight: bold;
  14 + }
  15 + }
  16 + .coin-detail {
  17 + background: #fff;
  18 + border-top: 1px solid #e0e0e0;
  19 + border-bottom: 1px solid #e0e0e0;
  20 + }
  21 +
  22 + .detail-item {
  23 + position: relative;
  24 + margin-left: pxToRem(30px);
  25 + border-bottom: 1px solid #e0e0e0;
  26 + color: #444;
  27 + padding: pxToRem(15px) 0;
  28 +
  29 + .title {
  30 + width: pxToRem(480px);
  31 + font-size: pxToRem(28px);
  32 + line-height: pxToRem(40px);
  33 + font-weight: bold;
  34 + overflow: hidden;
  35 + text-overflow: ellipsis;
  36 + white-space: nowrap;
  37 + }
  38 +
  39 + .time {
  40 + font-size: pxToRem(20px);
  41 + line-height: pxToRem(30px);
  42 + color: #b0b0b0;
  43 + }
  44 +
  45 + .count {
  46 + position: absolute;
  47 + right: 0;
  48 + top: 0;
  49 + margin-right: pxToRem(30px);
  50 + font-size: pxToRem(28px);
  51 + font-weight: bold;
  52 + line-height: pxToRem(100px);
  53 + }
  54 + }
  55 +
  56 + li:last-child {
  57 + .detail-item {
  58 + border-bottom: none;
  59 + }
  60 + }
  61 +}
  1 +.yoho-coin-new-page {
  2 + padding-top: pxToRem(30px);
  3 + text-align: center;
  4 +
  5 + .coin-num {
  6 + color: #d0021b;
  7 + font-size: pxToRem(66px);
  8 + font-weight: bold;
  9 + line-height: pxToRem(106px);
  10 + letter-spacing: pxToRem(8px);
  11 + }
  12 +
  13 + .info {
  14 + color: #b0b0b0;
  15 + font-size: pxToRem(24px);
  16 + line-height: 1;
  17 +
  18 + .dollar {
  19 + display: inline-block;
  20 + margin-right: pxToRem(6px);
  21 + vertical-align: middle;
  22 + width: pxToRem(24px);
  23 + height: pxToRem(24px);
  24 + background: image-url("me/yoho-coin/dollar.png") center center;
  25 + background-size: 100%;
  26 + }
  27 + }
  28 +
  29 + .more {
  30 + display: inline-block;
  31 + margin: pxToRem(30px) 0;
  32 + color: #444;
  33 + font-size: pxToRem(24px);
  34 + line-height: pxToRem(36px);
  35 + width: pxToRem(152px);
  36 + height: pxToRem(36px);
  37 + text-align: center;
  38 + border: 1px solid #444;
  39 + border-radius: pxToRem(36px);
  40 + }
  41 +
  42 + .coin-tip {
  43 + margin-bottom: pxToRem(30px);
  44 + padding: pxToRem(20px) pxToRem(30px);
  45 + font-size: pxToRem(24px);
  46 + line-height: pxToRem(32px);
  47 + color: #dc6870;
  48 + border-top: 1px solid #e0e0e0;
  49 + border-bottom: 1px solid #e0e0e0;
  50 +
  51 + .icon {
  52 + display: inline-block;
  53 + width: pxToRem(32px);
  54 + height: pxToRem(32px);
  55 + font-weight: bold;
  56 + border: 2px solid #dc6870;
  57 + border-radius: 50%;
  58 + }
  59 + }
  60 +
  61 + .banner {
  62 + margin-bottom: pxToRem(30px);
  63 + }
  64 +}
  1 +{{# currency}}
  2 + <li>
  3 + <div class="detail-item">
  4 + <p class="title">{{title}}</p>
  5 + <p class="time">{{time}}</p>
  6 + <div class="count">
  7 + {{count}}
  8 + </div>
  9 + </div>
  10 + </li>
  11 +{{/ currency}}
  1 +
  2 +{{> layout/header}}
  3 +<div class="yoho-coin-detail-page yoho-page">
  4 + <div class="money">你拥有的有货币:<span>{{ money}}</span></div>
  5 +
  6 + <ul class="coin-detail"></ul>
  7 +</div>
  8 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="yoho-coin-new-page yoho-page">
  3 + <div class="coin">
  4 + <p class="coin-num">
  5 + 7876
  6 + </p>
  7 + <p class="info">
  8 + <span class="dollar"></span>
  9 + YOHO
  10 + </p>
  11 + <a href="" class="more">查看明细</a>
  12 + <div class="coin-tip">
  13 + <span class="icon">!</span>
  14 + 您有300个YOHO币即将于20171231日过期,请尽快使用
  15 + </div>
  16 + </div>
  17 + <div class="banner">
  18 + <a href="">
  19 + {{!-- 演示图片 --}}
  20 + <img src="http://temp.im/640x200" alt="">
  21 + </a>
  22 + </div>
  23 +
  24 + {{> home/maybe_like}}
  25 +</div>
  26 +{{> layout/footer}}
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 优惠券 81 优惠券
82 <span class="iconfont num">{{coupon_num}} &#xe604;</span> 82 <span class="iconfont num">{{coupon_num}} &#xe604;</span>
83 </a> 83 </a>
84 - <a class="list-item" href="/home/currency"> 84 + <a class="list-item" href="/home/currencyDetail">
85 <span class="iconfont icon">&#xe635;</span> 85 <span class="iconfont icon">&#xe635;</span>
86 YOHO 86 YOHO
87 <span class="iconfont num">{{yoho_coin_num}} &#xe604;</span> 87 <span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
@@ -306,5 +306,8 @@ @@ -306,5 +306,8 @@
306 {{#if payCenterPage}} 306 {{#if payCenterPage}}
307 <script> 307 <script>
308 seajs.use('js/me/pay'); 308 seajs.use('js/me/pay');
  309 +{{#if currencyDetail}}
  310 +<script>
  311 + seajs.use('js/me/currency');
309 </script> 312 </script>
310 {{/if}} 313 {{/if}}
@@ -876,5 +876,44 @@ class HomeController extends AbstractAction @@ -876,5 +876,44 @@ class HomeController extends AbstractAction
876 ); 876 );
877 $this->_view->display('helpDetail', $data); 877 $this->_view->display('helpDetail', $data);
878 } 878 }
  879 + /**
  880 + * YOHO币详情 新版
  881 + */
  882 + public function currencyDetailAction()
  883 + {
  884 + $this->setTitle('YOHO币');
  885 + $this->setNavHeader('YOHO币', true, false);
  886 + $data['money'] = '0';
  887 + $page = $this->post('page',1);
  888 + $size = $this->post('size', 20);
  889 + // $data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
  890 + $data = UserModel::getYohoCoinLists(3965746,$page,$size);
  891 + $this->_view->display('currency-detail', array(
  892 + 'money' => $data['money'],
  893 + 'pageFooter' => true,
  894 + 'currencyDetail' => true,
  895 + 'currencyDetailPage' => true
  896 + ));
  897 +
  898 + }
  899 +
  900 + /**
  901 + * YOHO币详情 AJAX
  902 + */
  903 + public function ajaxCurrencyDetailAction()
  904 + {
  905 + $data['list'] = array();
  906 + $data['money'] = 0;
  907 + $page = $this->post('page',1);
  908 + $size = $this->post('size', 20);
  909 + $data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
  910 + // $data = UserModel::getYohoCoinLists(3965746,$page,$size);
  911 + $this->_view->display('ajax-currency-detail', array(
  912 + 'currency' => $data['list'],
  913 + 'pageFooter' => true,
  914 + 'currencyDetailPage' => true
  915 + ));
  916 +
  917 + }
879 918
880 } 919 }
@@ -369,6 +369,35 @@ class UserModel @@ -369,6 +369,35 @@ class UserModel
369 } 369 }
370 370
371 /** 371 /**
  372 + * 处理YOHO币变化履历数据
  373 + *
  374 + * @param int $uid 用户ID
  375 + * @param int $page 当前页
  376 + * @param int $limit 一页记录数
  377 + * @return array|mixed 处理之后的YOHO币数据
  378 + */
  379 + public static function getYohoCoinLists($uid, $page, $limit)
  380 + {
  381 + $result = array();
  382 +
  383 + // 调用接口获取YOHO币
  384 + $yohoCoin = UserData::yohoCoinData($uid, $page, $limit, 'post');
  385 + // 处理YOHO币数据
  386 + $coinList = $yohoCoin['data']['coinlist'];
  387 + $data['money'] = $yohoCoin['data']['total'];
  388 + foreach($coinList as $key => $val){
  389 + $result[$key]['title'] = $val['message'];
  390 + $result[$key]['time'] = $val['date'];
  391 + if($val['num'] > 0){
  392 + $val['num'] = '+'.$val['num'];
  393 + }
  394 + $result[$key]['count'] = $val['num'];
  395 + }
  396 + $data['list'] = $result;
  397 + return $data;
  398 + }
  399 +
  400 + /**
372 * 处理优惠券数据 401 * 处理优惠券数据
373 * 402 *
374 * @param int $uid 用户ID 403 * @param int $uid 用户ID