mine.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {template 'common/header'}
  2. <style media="all" type="text/css">
  3. ul,li {padding:0; margin:0; border:0;}
  4. html{overflow-y:hidden;}
  5. .scroll-container {position:absolute;z-index:1;background:#fff;overflow:hidden;width:100%;top:0;bottom:48px;left:0;}
  6. .scroll-container .wrapper{position:absolute;width:100%;padding-bottom:1em;}
  7. .scroll-container .list-group {position:relative; list-style:none; padding:0; margin:0; width:100%; text-align:left;}
  8. .scroll-container .list-group .list-group-item .items{float:left; text-align:center;}
  9. .scroll-container .list-group .list-group-item .icons{width:20%;height:60px;line-height:55px;text-align:left}
  10. .scroll-container .list-group .list-group-item .icons .discount{font-size:24px;font-weight:bold}
  11. .scroll-container .list-group .list-group-item .infos{width:60%; text-align:left; font-size:14px;}
  12. .scroll-container .list-group .list-group-item .btns{width:20%; padding-top:15px;}
  13. .scroll-container .list-group .list-group-item .detail{border:1px solid #eee; padding:5px;}
  14. .scroll-container .list-group .list-group-item .detail h5{padding:5px; font-weight:bolder;border-bottom:1px dashed #eee}
  15. .scroll-container .load-more{padding:10px;text-align:center;font-size:1em;}
  16. </style>
  17. <div class="scroll-container ng-cloak" ng-controller="exchangeCtrl">
  18. <ul class="nav nav-tabs" style="margin-bottom:10px">
  19. <li {if $type == 3}class="active"{/if}><a href="{php echo url('activity/exchange/mine',array('type'=>3));}">我的实体礼品</a></li>
  20. <li {if $type == 5}class="active"{/if}><a href="{php echo url('activity/exchange/mine',array('type'=>5));}">活动参与次数</a></li>
  21. </ul>
  22. <div class="wrapper">
  23. <ul class="list-group" >
  24. {if $type == 3}
  25. <li class="list-group-item" ng-repeat="entry in entries">
  26. <div class="clearfix">
  27. <div class="items icons"><img src="{$_W['attachurl']}{{entry.exchange.thumb}}" width="60" height="60"></div>
  28. <div class="items infos">{{entry.exchange.title}}<br>{{entry.exchange.extra.title}}<br>{{entry.createtime_cn}}</div>
  29. <div class="items btns">
  30. {{entry.status_cn}}
  31. </div>
  32. </div>
  33. <div class="detail" style="display:none">
  34. <h5>使用详情:</h5>
  35. <div>1、单笔订单仅使用一张优惠券<br>2、次优惠券不与店内其他优惠活动共用<br>3、不记名,不兑换现金,不找零<br>4、该优惠券最终解释权归本餐厅所有</div>
  36. </div>
  37. </li>
  38. {elseif $type == 5}
  39. {/if}
  40. </ul>
  41. <div class="load-more">
  42. <a href="javascript:;" class="btn btn-default btn-block" ng-click="load();">
  43. <i class="fa fa-arrow-down" ng-class="{'fa-circle-o-notch fa-spin': more.loading, 'fa-arrow-down': !more.loading}"></i> {{more.loading ? '正在加载' : '查看更多'}}
  44. </a>
  45. </div>
  46. <div id="page" title="{$pindex}" class="hide"></div>
  47. </div>
  48. </div>
  49. <script type="text/javascript">
  50. require(['angular', 'iscroll'], function(angular, iScroll){
  51. $(function(){
  52. var elm = $('.scroll-container');
  53. var myScroll = new iScroll(elm[0], {});
  54. $('.list-group-item').click(function(){
  55. $(this).find('.detail').slideToggle(function(){
  56. myScroll.refresh();
  57. });
  58. });
  59. angular.module('app', []).controller('exchangeCtrl', function($scope, $http){
  60. $scope.more = {
  61. loading: false
  62. };
  63. $scope.entries = {php echo json_encode($list)};
  64. $scope.load = function(){
  65. if($scope.more.loading) {
  66. return;
  67. }
  68. $scope.more.loading = true;
  69. var page = parseInt($("#page").attr('title')) + 1;
  70. $("#page").attr('title', page);
  71. var params = {page:page};
  72. $http.post(location.href, params).success(function(dat){
  73. if($.isArray(dat)) {
  74. $.each(dat, function(){
  75. $scope.entries.push(this);
  76. });
  77. myScroll.refresh();
  78. } else if(dat == 'dataempty') {
  79. }
  80. $scope.more.loading = false;
  81. }).error(function(){
  82. $scope.more.loading = false;
  83. });
  84. }
  85. });
  86. angular.bootstrap(document, ['app']);
  87. });
  88. });
  89. </script>
  90. {template 'common/footer'}