user-list.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ?>
  4. <style>
  5. </style>
  6. <div id="app" v-cloak>
  7. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  8. <div slot="header">
  9. <span>列表</span>
  10. </div>
  11. <div class="table-body">
  12. <div class="input-item">
  13. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入用户id" v-model="search.user_id"
  14. clearable @clear="toSearch">
  15. </el-input>
  16. </div>
  17. <div class="input-item">
  18. <el-input @keyup.enter.native="loadData" size="small" placeholder="请输入用户昵称/手机号搜索" v-model="search.keyword" clearable @clear="toSearch">
  19. </el-input>
  20. </div>
  21. <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="toSearch">搜索</el-button>
  22. <div class="batch">
  23. <agent-batch :choose-list="choose_list" :agent-level-list="agentLevelList"
  24. @to-search="loadData"></agent-batch>
  25. </div>
  26. <el-tabs v-model="activeName" @tab-click="handleClick">
  27. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;"
  28. @selection-change="handleSelectionChange">
  29. <el-table-column align='center' type="selection"></el-table-column>
  30. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  31. <el-table-column label="基本信息" >
  32. <template slot-scope="scope">
  33. <div class="user_img" flex="cross:center">
  34. <el-image class="default-avatar" :src="scope.row.avatar_url">
  35. <div slot="error" class="image-slot">
  36. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  37. </div>
  38. </el-image>
  39. <div class="uer-nickname over1" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  40. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  41. </div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="手机号" prop="mobile" align="center" >
  45. <template slot-scope="scope">
  46. <div>{{scope.row.mobile}}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="待结算奖金" prop="total_price" align="center">
  50. <template slot-scope="scope">
  51. <template>{{scope.row.frozen_commission}}</template>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="已结算奖金" prop="total_price" align="center">
  55. <template slot-scope="scope">
  56. <template>{{scope.row.total_commission}}</template>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="直推用户累计消费" prop="total_price" align="center">
  60. <template slot-scope="scope">
  61. <template>{{scope.row.remaining_pay_money}}</template>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="时间" align="center">
  65. <template slot-scope="scope">
  66. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. </el-tabs>
  71. <div flex="box:last cross:center">
  72. <div></div>
  73. <div>
  74. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  75. style="display: inline-block;float: right;" background @current-change="pageChange"
  76. layout="prev, pager, next" :total="pagination.totalCount">
  77. </el-pagination>
  78. </div>
  79. </div>
  80. </div>
  81. </el-card>
  82. </div>
  83. <script>
  84. const app = new Vue({
  85. el: '#app',
  86. data: {
  87. qrimg: '',
  88. showqr: false,
  89. avatar: '',
  90. nickname: '',
  91. search: {
  92. user_id: null,
  93. keyword: '',
  94. status: -1,
  95. page: 1,
  96. level: ''
  97. },
  98. loading: false,
  99. activeName: '-1',
  100. list: [],
  101. pagination: null,
  102. dialogChild: false,
  103. dialogLoading: false,
  104. childList: [],
  105. select: {
  106. nickname: '',
  107. status: 'first',
  108. },
  109. dialogContent: false,
  110. remarksForm: {
  111. remarks: '',
  112. user_id: '',
  113. id: '',
  114. },
  115. remarksLoading: false,
  116. exportList: {},
  117. edit: {
  118. show: false,
  119. },
  120. level: {
  121. show: false,
  122. agent: null,
  123. },
  124. commission_arr: {},
  125. agentLevelList: [],
  126. levelList: {},
  127. choose_list: [],
  128. export_url: 'agent/default/index', // 导出路径
  129. },
  130. mounted() {
  131. this.loadData();
  132. },
  133. methods: {
  134. loadData() {
  135. this.loading = true;
  136. let params = {
  137. r: 'blind-box/default/user-list'
  138. };
  139. params = Object.assign(params, this.search);
  140. request({
  141. params: params,
  142. method: 'get',
  143. }).then(e => {
  144. this.loading = false;
  145. if (e.data.code == 0) {
  146. this.list = e.data.data.list;
  147. this.pagination = e.data.data.pagination;
  148. } else {
  149. this.$message.error(e.data.msg);
  150. }
  151. }).catch(e => {
  152. this.loading = false;
  153. });
  154. },
  155. pageChange(page) {
  156. this.search.page = page;
  157. this.loadData();
  158. },
  159. handleClick(tab, event) {
  160. this.search.page = 1;
  161. this.search.status = this.activeName;
  162. this.loadData()
  163. },
  164. toSearch() {
  165. this.search.page = 1;
  166. this.loadData();
  167. },
  168. handleSelectionChange(val) {
  169. let self = this;
  170. self.choose_list = [];
  171. val.forEach(function (item) {
  172. self.choose_list.push(item.id);
  173. })
  174. },
  175. levelSuccess() {
  176. this.loadData();
  177. }
  178. }
  179. });
  180. </script>
  181. <style>
  182. .el-tabs__header {
  183. font-size: 16px;
  184. }
  185. .table-body {
  186. padding: 20px;
  187. background-color: #fff;
  188. }
  189. .table-body .el-button {
  190. padding: 0 !important;
  191. border: 0;
  192. margin: 0 5px;
  193. }
  194. .input-item {
  195. width: 250px;
  196. margin: 0 0 20px;
  197. display: inline-block;
  198. }
  199. /*.input-item .el-input__inner {*/
  200. /* border-right: 0;*/
  201. /*}*/
  202. .input-item .el-input__inner:hover {
  203. border: 1px solid #dcdfe6;
  204. /*border-right: 0;*/
  205. outline: 0;
  206. }
  207. .input-item .el-input__inner:focus {
  208. border: 1px solid #dcdfe6;
  209. /*border-right: 0;*/
  210. outline: 0;
  211. }
  212. .input-item .el-input-group__append {
  213. background-color: #fff;
  214. border-left: 0;
  215. width: 10%;
  216. padding: 0;
  217. }
  218. .input-item .el-input-group__append .el-button {
  219. padding: 0;
  220. }
  221. .input-item .el-input-group__append .el-button {
  222. margin: 0;
  223. }
  224. .batch {
  225. margin: 0 0 20px;
  226. display: inline-block;
  227. }
  228. .batch .el-button {
  229. padding: 9px 15px !important;
  230. }
  231. .el-table th>.cell{
  232. color: #333;
  233. font-weight: bold;
  234. font-size: 14px;
  235. }
  236. .el-table__footer-wrapper, .el-table__header-wrapper{
  237. border-bottom: 1.4px solid #D6D6D6;
  238. }
  239. .el-table th>.cell {
  240. color: #333;
  241. font-weight: bold;
  242. font-size: 14px;
  243. }
  244. .table1 .el-table__footer-wrapper,
  245. .table1 .el-table__header-wrapper {
  246. border-bottom: 1.4px solid #D6D6D6;
  247. }
  248. .user_img{
  249. position: relative;
  250. margin-right: 8px;
  251. /* height: 50px;
  252. width: 50px; */
  253. }
  254. .default-avatar{
  255. width: 50px;
  256. height: 50px;
  257. border-radius: 50%;
  258. margin-right: 8px;
  259. }
  260. .uer-nickname {
  261. flex: 1;
  262. }
  263. </style>