team.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {extend name="public/layout" /} {block name="title"}拼团组{/block} {block name="body"}
  2. <link rel="stylesheet" href="__LAYUI__/common.css" media="all">
  3. <style type="text/css">
  4. .layui-form-item div.searchBox {
  5. width: 320px;
  6. background: #FFFFFF;
  7. border: 1px solid #B6CADE;
  8. border-radius: 24px;
  9. height: 38px;
  10. overflow: hidden;
  11. padding-left: 18px;
  12. position: relative;
  13. margin-bottom: 0px;
  14. float: right;
  15. }
  16. .searchBox .inputBox {
  17. width: 240px;
  18. float: left;
  19. height: 36px;
  20. line-height: 36px;
  21. border-width: 0;
  22. }
  23. .searchBtn {
  24. position: absolute;
  25. top: 0;
  26. right: 0;
  27. width: 51px;
  28. height: 38px;
  29. background-color: #fff;
  30. }
  31. .searchBtn img {
  32. position: absolute;
  33. width: 26px;
  34. top: 6px;
  35. left: 0;
  36. }
  37. </style>
  38. <body>
  39. <div class="layui-fluid">
  40. <div class="layui-card">
  41. <div class="layui-card-body">
  42. <table id="spellgroup-team" lay-filter="spellgroup-team"></table>
  43. <script type="text/html" id="img">
  44. {{# layui.each(d.headimgurl, function(index,v){ }}
  45. <img style="display: inline-block; width: 15%; height: 100%;border-radius: 50%;" src={{v}}>
  46. {{# }); }}
  47. </script>
  48. <script type="text/html" id="status">
  49. <a lay-event="getlist" style="color: #0091FF;">拼团成员</a>
  50. </script>
  51. </div>
  52. </div>
  53. </div>
  54. </body>
  55. {/block} {block name="js"}
  56. <script>
  57. layui.config({
  58. base: '__LAYUI__/',
  59. urlbase: '/sys'
  60. }).extend({
  61. index: 'lib/index' //主入口模块
  62. }).use(['index', 'form', 'table'], function() {
  63. var $ = layui.$,
  64. form = layui.form,
  65. table = layui.table;
  66. //监听搜索
  67. form.on('submit(LAY-user-front-search)', function(data) {
  68. var field = data.field;
  69. //执行重载
  70. table.reload('spellgroup-team', {
  71. where: field
  72. ,page: {curr:1}
  73. });
  74. });
  75. //事件
  76. var active = {};
  77. var id = {$id};
  78. var hour = {$hour};
  79. //领取列表
  80. table.render({
  81. elem: '#spellgroup-team',
  82. autoSort: false,
  83. url: "{:url('spellgroup/team')}?id="+id+"&hour="+hour,
  84. cols: [
  85. [{
  86. type: 'numbers',
  87. field: 'id',
  88. title: '序号',
  89. align: 'center',
  90. }, {
  91. field: 'open_time',
  92. align: 'center',
  93. title: '团队开启时间',
  94. }, {
  95. field: 'end',
  96. align: 'center',
  97. title: '结束时间',
  98. }, {
  99. title: '成员',
  100. align: 'center',
  101. templet:'#img'
  102. }, {
  103. title: '操作',
  104. align: 'center',
  105. toolbar: '#status'
  106. }]
  107. ],
  108. page: true,
  109. limit: 30,
  110. height: 'full-220',
  111. text: '对不起,加载出现异常!'
  112. });
  113. //监听审核
  114. table.on('tool(spellgroup-team)', function(obj) {
  115. var data = obj.data;
  116. if(obj.event === 'getlist') {
  117. layer.open({
  118. type: 2,
  119. title: '拼团成员',
  120. content: '{:url("spellgroup/receive")}?id=' + data.spellgroup_id +'&tid='+data.id,
  121. maxmin: false,
  122. area: ['80%', '90%'],
  123. });
  124. }
  125. });
  126. $('.layui-btn.layuiadmin-btn-course').on('click', function() {
  127. var type = $(this).data('type');
  128. active[type] ? active[type].call(this) : '';
  129. });
  130. });
  131. </script>
  132. {/block}