index.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <style>
  2. </style>
  3. <div id="app" v-cloak>
  4. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  5. <div slot="header">
  6. <span>多商户会员列表</span>
  7. </div>
  8. <div class="table-body">
  9. <el-form ref="form" style="margin-bottom: 10px;" :model="searchInfo" label-width="96px" size="mini">
  10. <el-row :gutter="24">
  11. <el-col :span="5" style="padding-left: 0;" class="top_form">
  12. <el-form-item label="会员ID">
  13. <el-input v-model="searchInfo.user_id" placeholder="请输入会员ID" clearable></el-input>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="6">
  17. <el-form-item label="关键字">
  18. <el-input v-model="searchInfo.nickname_or_mobile" placeholder="会员昵称/手机号" clearable></el-input>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="6" style="padding-right: 0;">
  22. <el-form-item label="会员等级">
  23. <el-select v-model="searchInfo.level" placeholder="请选择会员等级">
  24. <el-option v-for="(item,index) in levels" :label="item" :value="index" :key="index"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. </el-col>
  28. <el-button @click="toSearch" style="padding: 9px 15px !important;" size="small" type="primary">搜索</el-button>
  29. </el-row>
  30. </el-form>
  31. <el-tabs v-model="activeName" >
  32. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" >
  33. <el-table-column prop="user_id" label="会员ID" align="center"></el-table-column>
  34. <el-table-column label="会员" >
  35. <template slot-scope="scope">
  36. <div class="user_img" flex="cross:center">
  37. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  38. <div slot="error" class="image-slot">
  39. <com-image src="resources/img/mall/default_avatar_url.png"></com-image>
  40. </div>
  41. </el-image>
  42. <div class="uer-nickname over1" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  43. <div class="uer-nickname over1" v-else >ID:{{scope.row.user_id}}</div>
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="手机号" prop="mobile" align="center" >
  48. <template slot-scope="scope">
  49. <div>{{scope.row.user.mobile}}</div>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="会员等级" prop="level_name" align="center">
  53. </el-table-column>
  54. <el-table-column label="最近访问时间" align="center">
  55. <template slot-scope="scope">
  56. {{scope.row.last_time|dateTimeFormat('Y-m-d H:i:s')}}
  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.pay_nums}}</template>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="消费金额" prop="total_price" align="center">
  65. <template slot-scope="scope">
  66. <template>{{scope.row.pay_money}}</template>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="累计退款订单数" prop="refund_nums" align="center">
  70. <template slot-scope="scope">
  71. <template>{{scope.row.refund_nums}}</template>
  72. </template>
  73. </el-table-column><el-table-column label="累计退款金额" prop="refund_money" align="center">
  74. <template slot-scope="scope">
  75. <template>{{scope.row.refund_money}}</template>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="操作" align="center">
  79. <template slot-scope="scope">
  80. <el-button type="text" @click="navUserDetail(scope.row.user_id)" class="all_text">查看</el-button>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. </el-tabs>
  85. <div flex="box:last cross:center">
  86. <div></div>
  87. <div>
  88. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  89. style="display: inline-block;float: right;" background @current-change="pageChange"
  90. layout="prev, pager, next" :total="pagination.totalCount">
  91. </el-pagination>
  92. </div>
  93. </div>
  94. </div>
  95. </el-card>
  96. </div>
  97. <script>
  98. const app = new Vue({
  99. el: '#app',
  100. data: {
  101. levels:[],
  102. searchInfo: {
  103. user_id: '',
  104. nickname_or_mobile: '', //会员昵称/手机号
  105. source: '',//用户来源
  106. register_start: '',//注册开始时间
  107. register_end: '',//注册结束时间
  108. level: '',//注册结束时间
  109. },
  110. list: [],
  111. channelArr: [],//渠道
  112. loading: false,
  113. activeName: '-1',
  114. pagination: null,
  115. level: {
  116. show: false,
  117. agent: null,
  118. },
  119. sign:''
  120. },
  121. computed: {
  122. },
  123. mounted() {
  124. this.loadData();
  125. },
  126. created() {
  127. this.sign = getQuery('sign')
  128. },
  129. methods: {
  130. loadData() {
  131. this.loading = true;
  132. let params = {
  133. r: 'mch/client/user/index'
  134. };
  135. params = Object.assign(params, this.searchInfo);
  136. request({
  137. params: params,
  138. method: 'get',
  139. }).then(e => {
  140. this.loading = false;
  141. if (e.data.code == 0) {
  142. this.list = e.data.data.list;
  143. this.pagination = e.data.data.pagination;
  144. this.levels = e.data.data.levels;
  145. } else {
  146. this.$message.error(e.data.msg);
  147. }
  148. }).catch(e => {
  149. this.loading = false;
  150. });
  151. },
  152. toSearch() {
  153. this.page = 1;
  154. this.loadData();
  155. },
  156. pageChange(page) {
  157. this.search.page = page;
  158. this.loadData();
  159. },
  160. navUserDetail(id){
  161. this.$navigate({
  162. r: 'mch/client/user/detail',
  163. id: id,
  164. sign: this.sign
  165. })
  166. },
  167. }
  168. });
  169. </script>
  170. <style>
  171. .el-tabs__header {
  172. font-size: 16px;
  173. }
  174. .table-body {
  175. padding: 20px;
  176. background-color: #fff;
  177. }
  178. .table-body .el-button {
  179. padding: 0 !important;
  180. border: 0;
  181. margin: 0 5px;
  182. }
  183. .input-item {
  184. width: 250px;
  185. margin: 0 0 20px;
  186. display: inline-block;
  187. }
  188. /*.input-item .el-input__inner {*/
  189. /* border-right: 0;*/
  190. /*}*/
  191. .input-item .el-input__inner:hover {
  192. border: 1px solid #dcdfe6;
  193. /*border-right: 0;*/
  194. outline: 0;
  195. }
  196. .input-item .el-input__inner:focus {
  197. border: 1px solid #dcdfe6;
  198. /*border-right: 0;*/
  199. outline: 0;
  200. }
  201. .input-item .el-input-group__append {
  202. background-color: #fff;
  203. border-left: 0;
  204. width: 10%;
  205. padding: 0;
  206. }
  207. .input-item .el-input-group__append .el-button {
  208. padding: 0;
  209. }
  210. .input-item .el-input-group__append .el-button {
  211. margin: 0;
  212. }
  213. .batch {
  214. margin: 0 0 20px;
  215. display: inline-block;
  216. }
  217. .batch .el-button {
  218. padding: 9px 15px !important;
  219. }
  220. .el-table th>.cell{
  221. color: #333;
  222. font-weight: bold;
  223. font-size: 14px;
  224. }
  225. .el-table__footer-wrapper, .el-table__header-wrapper{
  226. border-bottom: 1.4px solid #D6D6D6;
  227. }
  228. .el-table th>.cell {
  229. color: #333;
  230. font-weight: bold;
  231. font-size: 14px;
  232. }
  233. .table1 .el-table__footer-wrapper,
  234. .table1 .el-table__header-wrapper {
  235. border-bottom: 1.4px solid #D6D6D6;
  236. }
  237. .user_img{
  238. position: relative;
  239. margin-right: 8px;
  240. /* height: 50px;
  241. width: 50px; */
  242. }
  243. .default-avatar{
  244. width: 50px;
  245. height: 50px;
  246. border-radius: 50%;
  247. margin-right: 8px;
  248. }
  249. .uer-nickname {
  250. flex: 1;
  251. }
  252. </style>