index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <div class="row-content am-cf">
  2. <div class="row">
  3. <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
  4. <div class="widget am-cf">
  5. <div class="widget-head am-cf">
  6. <div class="widget-title am-cf">申请成为分销商</div>
  7. </div>
  8. <div class="widget-body am-fr">
  9. <!-- 工具栏 -->
  10. <div class="page_toolbar am-margin-bottom-xs am-cf">
  11. <form class="toolbar-form" action="">
  12. <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
  13. <div class="am-u-sm-12 am-u-md-9 am-u-sm-push-3">
  14. <div class="am fr">
  15. <div class="am-form-group am-fl">
  16. <div class="am-input-group am-input-group-sm tpl-form-border-form">
  17. <input type="text" class="am-form-field" name="search"
  18. placeholder="请输入昵称/姓名/手机号"
  19. value="<?= $request->get('search') ?>">
  20. <div class="am-input-group-btn">
  21. <button class="am-btn am-btn-default am-icon-search"
  22. type="submit"></button>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="am-scrollable-horizontal am-u-sm-12 am-padding-bottom-lg">
  31. <table width="100%" class="am-table am-table-compact am-table-striped
  32. tpl-table-black am-text-nowrap">
  33. <thead>
  34. <tr>
  35. <th>用户ID</th>
  36. <th>微信头像</th>
  37. <th>微信昵称</th>
  38. <th>
  39. <p>姓名</p>
  40. <p>手机号</p>
  41. </th>
  42. <th>推荐人</th>
  43. <th>审核状态</th>
  44. <th>审核方式</th>
  45. <th>申请时间</th>
  46. <th>操作</th>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
  51. <tr>
  52. <td class="am-text-middle"><?= $item['user_id'] ?></td>
  53. <td class="am-text-middle">
  54. <a href="<?= $item['avatarUrl'] ?>" title="点击查看大图" target="_blank">
  55. <img src="<?= $item['avatarUrl'] ?>"
  56. width="50" height="50" alt="">
  57. </a>
  58. </td>
  59. <td class="am-text-middle">
  60. <p><span><?= $item['nickName'] ?></span></p>
  61. </td>
  62. <td class="am-text-middle">
  63. <?php if (!empty($item['real_name']) || !empty($item['mobile'])): ?>
  64. <p><?= $item['real_name'] ?: '--' ?></p>
  65. <p><?= $item['mobile'] ?: '--' ?></p>
  66. <?php else: ?>
  67. <p>--</p>
  68. <?php endif; ?>
  69. </td>
  70. <td class="am-text-middle">
  71. <?php if ($item['referee_id'] > 0): ?>
  72. <p><?= $item['referee']['nickName'] ?></p>
  73. <p class="am-link-muted f-12">(ID:<?= $item['referee']['user_id'] ?>)</p>
  74. <?php else: ?>
  75. <p>平台</p>
  76. <?php endif; ?>
  77. </td>
  78. <td class="am-text-middle">
  79. <?php if ($item['apply_status'] == 10) : ?>
  80. <span class="am-badge">待审核</span>
  81. <?php elseif ($item['apply_status'] == 20) : ?>
  82. <span class="am-badge am-badge-secondary">已通过</span>
  83. <?php elseif ($item['apply_status'] == 30) : ?>
  84. <span class="am-badge am-badge-warning">已驳回</span>
  85. <?php endif; ?>
  86. </td>
  87. <td class="am-text-middle">
  88. <?php if ($item['apply_type'] == 10) : ?>
  89. <span>后台审核</span>
  90. <?php elseif ($item['apply_type'] == 20) : ?>
  91. <span>无需审核</span>
  92. <?php endif; ?>
  93. </td>
  94. <td class="am-text-middle"><?= $item['apply_time'] ?></td>
  95. <td class="am-text-middle">
  96. <div class="tpl-table-black-operation">
  97. <?php if ($item['apply_status'] == 10) : ?>
  98. <?php if (checkPrivilege('apps.dealer.apply/submit')): ?>
  99. <a class="j-audit" data-id="<?= $item['apply_id'] ?>"
  100. href="javascript:void(0);">
  101. <i class="am-icon-pencil"></i> 审核
  102. </a>
  103. <?php endif; ?>
  104. <?php elseif ($item['apply_status'] == 30) : ?>
  105. <a class="j-show-reason tpl-table-black-operation-green"
  106. href="javascript:void(0);"
  107. data-reason="<?= $item['reject_reason'] ?>">
  108. 驳回原因</a>
  109. <?php endif; ?>
  110. </div>
  111. </td>
  112. </tr>
  113. <?php endforeach; else: ?>
  114. <tr>
  115. <td colspan="9" class="am-text-center">暂无记录</td>
  116. </tr>
  117. <?php endif; ?>
  118. </tbody>
  119. </table>
  120. <div class="am-u-lg-12 am-cf">
  121. <div class="am-fr"><?= $list->render() ?> </div>
  122. <div class="am-fr pagination-total am-margin-right">
  123. <div class="am-vertical-align-middle">总记录:<?= $list->total() ?></div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <!-- 分销商审核 -->
  133. <script id="tpl-dealer-apply" type="text/template">
  134. <div class="am-padding-top-sm">
  135. <form class="form-dealer-apply am-form tpl-form-line-form" method="post"
  136. action="<?= url('apps.dealer.apply/submit') ?>">
  137. <input type="hidden" name="apply_id" value="{{ id }}">
  138. <div class="am-form-group">
  139. <label class="am-u-sm-3 am-form-label"> 审核状态 </label>
  140. <div class="am-u-sm-9">
  141. <label class="am-radio-inline">
  142. <input type="radio" name="apply[apply_status]" value="20" data-am-ucheck
  143. checked> 审核通过
  144. </label>
  145. <label class="am-radio-inline">
  146. <input type="radio" name="apply[apply_status]" value="30" data-am-ucheck> 驳回
  147. </label>
  148. </div>
  149. </div>
  150. <div class="am-form-group">
  151. <label class="am-u-sm-3 am-form-label"> 驳回原因 </label>
  152. <div class="am-u-sm-9">
  153. <input type="text" class="tpl-form-input" name="apply[reject_reason]" placeholder="仅在驳回时填写"
  154. value="">
  155. </div>
  156. </div>
  157. </form>
  158. </div>
  159. </script>
  160. <script>
  161. $(function () {
  162. /**
  163. * 审核操作
  164. */
  165. $('.j-audit').click(function () {
  166. var $this = $(this);
  167. layer.open({
  168. type: 1
  169. , title: '分销商审核'
  170. , area: '340px'
  171. , offset: 'auto'
  172. , anim: 1
  173. , closeBtn: 1
  174. , shade: 0.3
  175. , btn: ['确定', '取消']
  176. , content: template('tpl-dealer-apply', $this.data())
  177. , success: function (layero) {
  178. // 注册radio组件
  179. layero.find('input[type=radio]').uCheck();
  180. }
  181. , yes: function (index, layero) {
  182. // 表单提交
  183. layero.find('.form-dealer-apply').ajaxSubmit({
  184. type: 'post',
  185. dataType: 'json',
  186. success: function (result) {
  187. result.code === 1 ? $.show_success(result.msg, result.url)
  188. : $.show_error(result.msg);
  189. }
  190. });
  191. layer.close(index);
  192. }
  193. });
  194. });
  195. /**
  196. * 显示驳回原因
  197. */
  198. $('.j-show-reason').click(function () {
  199. var $this = $(this);
  200. layer.alert($this.data('reason'), {title: '驳回原因'});
  201. });
  202. });
  203. </script>