referral.blade.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" type="text/css" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <div class="page-header">
  7. <h1 class="page-title cyan-600"><i class="icon wb-star"></i>{{trans('home.referrals')}}</h1>
  8. </div>
  9. <div class="page-content container-fluid">
  10. <div class="alert alert-info" role="alert">
  11. <button class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  12. {!! trans('home.promote_link', ['traffic' => $referral_traffic, 'referral_percent' => $referral_percent * 100]) !!}
  13. </div>
  14. <div class="row">
  15. <div class="col-lg-5">
  16. <!-- 推广链接 -->
  17. <div class="card">
  18. <div class="card-block">
  19. <h4 class="card-title cyan-600"><i class="icon wb-link"></i> {{trans('home.referral_my_link')}}
  20. </h4>
  21. <div class="card-text form">
  22. <div class="mt-clipboard-container input-group">
  23. <input type="text" id="mt-target-1" class="form-control" value="{{$link}}"/>
  24. <button class="btn btn-info mt-clipboard" data-clipboard-action="copy" data-clipboard-text="{{$link}}">
  25. <i class="icon wb-copy"></i> {{trans('home.referral_button')}}
  26. </button>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <!-- 邀请记录 -->
  32. <div class="card">
  33. <div class="card-block">
  34. <h4 class="card-title cyan-600"><i class="icon wb-emoticon"></i>
  35. {{trans('home.invite_user_title')}}
  36. </h4>
  37. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  38. <thead class="thead-default">
  39. <tr>
  40. <th data-cell-style="cellStyle"> #</th>
  41. <th> {{trans('home.invite_user_email')}} </th>
  42. <th> {{trans('home.invite_user_created_at')}}</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. @if($referralUserList->isEmpty())
  47. <tr>
  48. <td colspan="3"> {{trans('home.referral_table_none')}} </td>
  49. </tr>
  50. @else
  51. @foreach($referralUserList as $vo)
  52. <tr>
  53. <td> {{$loop->iteration}} </td>
  54. <td> {{str_replace(mb_substr($vo->email, 3, 4), "****", $vo->email)}} </td>
  55. <td> {{$vo->created_at}} </td>
  56. </tr>
  57. @endforeach
  58. @endif
  59. </tbody>
  60. </table>
  61. </div>
  62. <div class="card-footer card-footer-transparent">
  63. <nav class="Page navigation float-right">
  64. {{$referralUserList->appends(\Illuminate\Support\Arr::except(Request::query(), 'user_page'))->links()}}
  65. </nav>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="col-lg-7">
  70. <!-- 佣金记录 -->
  71. <div class="panel">
  72. <div class="panel-heading">
  73. <h3 class="panel-title cyan-600">
  74. <i class="icon wb-star-half"></i>{{trans('home.referral_title')}}
  75. </h3>
  76. <div class="panel-actions">
  77. <button type="submit" class="btn btn-danger" onclick="extractMoney()"> {{trans('home.referral_table_apply')}} </button>
  78. </div>
  79. </div>
  80. <div class="panel-body">
  81. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  82. <thead class="thead-default">
  83. <tr>
  84. <th data-cell-style="cellStyle"> #</th>
  85. <th> {{trans('home.referral_table_date')}} </th>
  86. <th> {{trans('home.referral_table_user')}} </th>
  87. <th> {{trans('home.referral_table_amount')}} </th>
  88. <th> {{trans('home.referral_table_commission')}} </th>
  89. <th> {{trans('home.referral_table_status')}} </th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. @if($referralLogList->isEmpty())
  94. <tr>
  95. <td colspan="6"> {{trans('home.referral_table_none')}} </td>
  96. </tr>
  97. @else
  98. @foreach($referralLogList as $referralLog)
  99. <tr>
  100. <td> {{$loop->iteration}} </td>
  101. <td> {{$referralLog->created_at}} </td>
  102. <td> {{empty($referralLog->user) ? '【账号已删除】' : str_replace(mb_substr($referralLog->user->email, 3, 4), "****", $referralLog->user->email)}} </td>
  103. <td> ¥{{$referralLog->amount}} </td>
  104. <td> ¥{{$referralLog->ref_amount}} </td>
  105. <td>
  106. @if ($referralLog->status == 1)
  107. <span class="badge badge-sm badge-info">申请中</span>
  108. @elseif($referralLog->status == 2)
  109. <span>已提现</span>
  110. @else
  111. <span class="badge badge-sm badge-success">未提现</span>
  112. @endif
  113. </td>
  114. </tr>
  115. @endforeach
  116. @endif
  117. </tbody>
  118. </table>
  119. </div>
  120. <div class="panel-footer">
  121. <div class="row">
  122. <div class="col-md-6 col-sm-6">
  123. {{trans('home.referral_summary', ['total' => $referralLogList->total(), 'amount' => $canAmount, 'money' => $referral_money])}}
  124. </div>
  125. <div class="col-md-6 col-sm-6">
  126. <nav class="Page navigation float-right">
  127. {{$referralLogList->appends(\Illuminate\Support\Arr::except(Request::query(), 'user_page'))->links()}}
  128. </nav>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. <!-- 提现记录 -->
  134. <div class="card">
  135. <div class="card-block">
  136. <h4 class="card-title cyan-600"><i class="icon wb-star-outline"></i> {{trans('home.referral_apply_title')}}</h4>
  137. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  138. <thead class="thead-default">
  139. <tr>
  140. <th data-cell-style="cellStyle"> #</th>
  141. <th> {{trans('home.referral_apply_table_date')}} </th>
  142. <th> {{trans('home.referral_apply_table_amount')}} </th>
  143. <th> {{trans('home.referral_apply_table_status')}} </th>
  144. </tr>
  145. </thead>
  146. <tbody>
  147. @if($referralApplyList->isEmpty())
  148. <tr>
  149. <td colspan="6"> {{trans('home.referral_table_none')}} </td>
  150. </tr>
  151. @else
  152. @foreach($referralApplyList as $vo)
  153. <tr>
  154. <td> {{$loop->iteration}} </td>
  155. <td> {{$vo->created_at}} </td>
  156. <td> ¥{{$vo->amount}} </td>
  157. <td>
  158. @if ($vo->status == 0)
  159. <span class="badge badge-sm badge-warning">待审核</span>
  160. @elseif($vo->status == 1)
  161. <span class="badge badge-sm badge-info">审核通过 - 待打款</span>
  162. @elseif($vo->status == 2)
  163. <span>已打款</span>
  164. @else
  165. <span class="badge badge-sm badge-dark">驳回</span>
  166. @endif
  167. </td>
  168. </tr>
  169. @endforeach
  170. @endif
  171. </tbody>
  172. </table>
  173. </div>
  174. <div class="card-footer card-footer-transparent">
  175. <nav class="Page navigation float-right">
  176. {{$referralApplyList->appends(\Illuminate\Support\Arr::except(Request::query(), 'user_page'))->links()}}
  177. </nav>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. @endsection
  184. @section('script')
  185. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  186. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js" type="text/javascript"></script>
  187. <script src="/assets/custom/Plugin/clipboardjs/clipboard.min.js" type="text/javascript"></script>
  188. <script type="text/javascript">
  189. // 申请提现
  190. function extractMoney() {
  191. $.post("/extractMoney", {_token: '{{csrf_token()}}'}, function (ret) {
  192. if (ret.status === 'success') {
  193. swal.fire({
  194. title: ret.message,
  195. type: '1000',
  196. timer: 1300,
  197. showConfirmButton: false,
  198. });
  199. swal.fire(ret.message, {icon: "success", timer: 1000, showConfirmButton: false})
  200. .then(() => {
  201. window.location.reload()
  202. })
  203. } else {
  204. swal.fire('申请失败', ret.message, 'error')
  205. }
  206. });
  207. }
  208. const clipboard = new ClipboardJS('.mt-clipboard');
  209. clipboard.on('success', function () {
  210. swal.fire({
  211. title: '复制成功',
  212. type: 'success',
  213. timer: 1300,
  214. showConfirmButton: false,
  215. });
  216. });
  217. clipboard.on('error', function () {
  218. swal.fire({
  219. title: '复制失败,请手动复制',
  220. type: 'error',
  221. timer: 1500,
  222. showConfirmButton: false,
  223. });
  224. });
  225. </script>
  226. @endsection