index.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. <input type="hidden" name="user_id" value="<?= $request->get('user_id') ?>">
  14. <div class="am-u-sm-12 am-u-md-9 am-u-sm-push-3">
  15. <div class="am fr">
  16. <div class="am-form-group am-fl">
  17. <select name="apply_status"
  18. data-am-selected="{btnSize: 'sm', placeholder: '审核状态'}">
  19. <option value=""></option>
  20. <option value="-1" <?= $request->get('apply_status') === '-1' ? 'selected' : '' ?>>
  21. 全部
  22. </option>
  23. <option value="10" <?= $request->get('apply_status') == '10' ? 'selected' : '' ?>>
  24. 待审核
  25. </option>
  26. <option value="20" <?= $request->get('apply_status') == '20' ? 'selected' : '' ?>>
  27. 审核通过
  28. </option>
  29. <option value="40" <?= $request->get('apply_status') == '40' ? 'selected' : '' ?>>
  30. 已打款
  31. </option>
  32. <option value="30" <?= $request->get('apply_status') == '30' ? 'selected' : '' ?>>
  33. 驳回
  34. </option>
  35. </select>
  36. </div>
  37. <div class="am-form-group am-fl">
  38. <select name="pay_type"
  39. data-am-selected="{btnSize: 'sm', placeholder: '提现方式'}">
  40. <option value=""></option>
  41. <option value="-1" <?= $request->get('pay_type') == '-1' ? 'selected' : '' ?>>
  42. 全部
  43. </option>
  44. <option value="20" <?= $request->get('pay_type') == '20' ? 'selected' : '' ?>>
  45. 支付宝
  46. </option>
  47. <option value="30" <?= $request->get('pay_type') == '30' ? 'selected' : '' ?>>
  48. 银行卡
  49. </option>
  50. </select>
  51. </div>
  52. <div class="am-form-group am-fl">
  53. <div class="am-input-group am-input-group-sm tpl-form-border-form">
  54. <input type="text" class="am-form-field" name="search"
  55. placeholder="请输入昵称/姓名/手机号"
  56. value="<?= $request->get('search') ?>">
  57. <div class="am-input-group-btn">
  58. <button class="am-btn am-btn-default am-icon-search"
  59. type="submit"></button>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </form>
  66. </div>
  67. <div class="am-scrollable-horizontal am-u-sm-12 am-padding-bottom-lg">
  68. <table width="100%" class="am-table am-table-compact am-table-striped
  69. tpl-table-black am-text-nowrap">
  70. <thead>
  71. <tr>
  72. <th>用户ID</th>
  73. <th>微信头像</th>
  74. <th>微信昵称</th>
  75. <th>
  76. <p>姓名</p>
  77. <p>手机号</p>
  78. </th>
  79. <th>提现金额</th>
  80. <th>提现方式</th>
  81. <th>提现信息</th>
  82. <th class="am-text-center">审核状态</th>
  83. <th>申请时间</th>
  84. <th>审核时间</th>
  85. <th>操作</th>
  86. </tr>
  87. </thead>
  88. <tbody>
  89. <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
  90. <tr>
  91. <td class="am-text-middle"><?= $item['user_id'] ?></td>
  92. <td class="am-text-middle">
  93. <a href="<?= $item['avatarUrl'] ?>" title="点击查看大图" target="_blank">
  94. <img src="<?= $item['avatarUrl'] ?>"
  95. width="50" height="50" alt="">
  96. </a>
  97. </td>
  98. <td class="am-text-middle">
  99. <p><span><?= $item['nickName'] ?></span></p>
  100. </td>
  101. <td class="am-text-middle">
  102. <?php if (!empty($item['real_name']) || !empty($item['mobile'])): ?>
  103. <p><?= $item['real_name'] ?: '--' ?></p>
  104. <p><?= $item['mobile'] ?: '--' ?></p>
  105. <?php else: ?>
  106. <p>--</p>
  107. <?php endif; ?>
  108. </td>
  109. <td class="am-text-middle">
  110. <p><span><?= $item['money'] ?></span></p>
  111. </td>
  112. <td class="am-text-middle">
  113. <p><span><?= $item['pay_type']['text'] ?></span></p>
  114. </td>
  115. <td class="am-text-middle">
  116. <?php if ($item['pay_type']['value'] == 20) : ?>
  117. <p><span><?= $item['alipay_name'] ?></span></p>
  118. <p><span><?= $item['alipay_account'] ?></span></p>
  119. <?php elseif ($item['pay_type']['value'] == 30) : ?>
  120. <p><span><?= $item['bank_name'] ?></span></p>
  121. <p><span><?= $item['bank_account'] ?></span></p>
  122. <p><span><?= $item['bank_card'] ?></span></p>
  123. <?php else : ?>
  124. <p><span>--</span></p>
  125. <?php endif; ?>
  126. </td>
  127. <td class="am-text-middle am-text-center">
  128. <?php if ($item['apply_status'] == 10) : ?>
  129. <span class="am-badge">待审核</span>
  130. <?php elseif ($item['apply_status'] == 20) : ?>
  131. <span class="am-badge am-badge-secondary">审核通过</span>
  132. <?php elseif ($item['apply_status'] == 30) : ?>
  133. <p><span class="am-badge am-badge-warning">已驳回</span></p>
  134. <span class="f-12">
  135. <a class="j-show-reason" href="javascript:void(0);"
  136. data-reason="<?= $item['reject_reason'] ?>">
  137. 查看原因</a>
  138. </span>
  139. <?php elseif ($item['apply_status'] == 40) : ?>
  140. <span class="am-badge am-badge-success">已打款</span>
  141. <?php endif; ?>
  142. </td>
  143. <td class="am-text-middle"><?= $item['create_time'] ?></td>
  144. <td class="am-text-middle"><?= $item['audit_time'] ?: '--' ?></td>
  145. <td class="am-text-middle">
  146. <div class="tpl-table-black-operation">
  147. <?php if (in_array($item['apply_status'], [10, 20])) : ?>
  148. <?php if (checkPrivilege('apps.dealer.withdraw/submit')): ?>
  149. <a class="j-audit" data-id="<?= $item['id'] ?>"
  150. href="javascript:void(0);">
  151. <i class="am-icon-pencil"></i> 审核
  152. </a>
  153. <?php endif; ?>
  154. <?php if ($item['apply_status'] == 20) : ?>
  155. <?php if (checkPrivilege('apps.dealer.withdraw/money')): ?>
  156. <a class="j-money tpl-table-black-operation-del"
  157. data-id="<?= $item['id'] ?>" href="javascript:void(0);">确认打款
  158. </a>
  159. <?php endif; ?>
  160. <?php endif; ?>
  161. <?php if ($item['apply_status'] == 20 && $item['pay_type']['value'] == 10) : ?>
  162. <?php if (checkPrivilege('apps.dealer.withdraw/wechat_pay')): ?>
  163. <a class="j-wechat-pay tpl-table-black-operation-green"
  164. data-id="<?= $item['id'] ?>" href="javascript:void(0);">微信付款
  165. </a>
  166. <?php endif; ?>
  167. <?php endif; ?>
  168. <?php endif; ?>
  169. <?php if (in_array($item['apply_status'], [30, 40])) : ?>
  170. <span>---</span>
  171. <?php endif; ?>
  172. </div>
  173. </td>
  174. </tr>
  175. <?php endforeach; else: ?>
  176. <tr>
  177. <td colspan="11" class="am-text-center">暂无记录</td>
  178. </tr>
  179. <?php endif; ?>
  180. </tbody>
  181. </table>
  182. <div class="am-u-lg-12 am-cf">
  183. <div class="am-fr"><?= $list->render() ?> </div>
  184. <div class="am-fr pagination-total am-margin-right">
  185. <div class="am-vertical-align-middle">总记录:<?= $list->total() ?></div>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <!-- 提现审核 -->
  195. <script id="tpl-dealer-withdraw" type="text/template">
  196. <div class="am-padding-top-sm">
  197. <form class="form-dealer-withdraw am-form tpl-form-line-form" method="post"
  198. action="<?= url('apps.dealer.withdraw/submit') ?>">
  199. <input type="hidden" name="id" value="{{ id }}">
  200. <div class="am-form-group">
  201. <label class="am-u-sm-3 am-form-label"> 审核状态 </label>
  202. <div class="am-u-sm-9">
  203. <label class="am-radio-inline">
  204. <input type="radio" name="withdraw[apply_status]" value="20" data-am-ucheck
  205. checked> 审核通过
  206. </label>
  207. <label class="am-radio-inline">
  208. <input type="radio" name="withdraw[apply_status]" value="30" data-am-ucheck> 驳回
  209. </label>
  210. </div>
  211. </div>
  212. <div class="am-form-group">
  213. <label class="am-u-sm-3 am-form-label"> 驳回原因 </label>
  214. <div class="am-u-sm-9">
  215. <input type="text" class="tpl-form-input" name="withdraw[reject_reason]" placeholder="仅在驳回时填写"
  216. value="">
  217. </div>
  218. </div>
  219. </form>
  220. </div>
  221. </script>
  222. <script>
  223. $(function () {
  224. /**
  225. * 审核操作
  226. */
  227. $('.j-audit').click(function () {
  228. var $this = $(this);
  229. layer.open({
  230. type: 1
  231. , title: '提现审核'
  232. , area: '340px'
  233. , offset: 'auto'
  234. , anim: 1
  235. , closeBtn: 1
  236. , shade: 0.3
  237. , btn: ['确定', '取消']
  238. , content: template('tpl-dealer-withdraw', $this.data())
  239. , success: function (layero) {
  240. // 注册radio组件
  241. layero.find('input[type=radio]').uCheck();
  242. }
  243. , yes: function (index, layero) {
  244. // 表单提交
  245. layero.find('.form-dealer-withdraw').ajaxSubmit({
  246. type: 'post',
  247. dataType: 'json',
  248. success: function (result) {
  249. result.code === 1 ? $.show_success(result.msg, result.url)
  250. : $.show_error(result.msg);
  251. }
  252. });
  253. layer.close(index);
  254. }
  255. });
  256. });
  257. /**
  258. * 显示驳回原因
  259. */
  260. $('.j-show-reason').click(function () {
  261. var $this = $(this);
  262. layer.alert($this.data('reason'), {title: '驳回原因'});
  263. });
  264. /**
  265. * 确认打款
  266. */
  267. $('.j-money').click(function () {
  268. var id = $(this).data('id');
  269. var url = "<?= url('apps.dealer.withdraw/money') ?>";
  270. layer.confirm('确定已打款吗?', {title: '友情提示'}, function (index) {
  271. $.post(url, {id: id}, function (result) {
  272. result.code === 1 ? $.show_success(result.msg, result.url)
  273. : $.show_error(result.msg);
  274. });
  275. layer.close(index);
  276. });
  277. });
  278. /**
  279. * 微信付款
  280. */
  281. $('.j-wechat-pay').click(function () {
  282. var id = $(this).data('id');
  283. var url = "<?= url('apps.dealer.withdraw/wechat_pay') ?>";
  284. layer.confirm('该操作 将使用微信支付企业付款到零钱功能,确定打款吗?', {title: '友情提示'}, function (index) {
  285. $.post(url, {id: id}, function (result) {
  286. result.code === 1 ? $.show_success(result.msg, result.url)
  287. : $.show_error(result.msg);
  288. });
  289. layer.close(index);
  290. });
  291. });
  292. });
  293. </script>