index.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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="page_size"
  89. style="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. page_size: 10,
  116. level: {
  117. show: false,
  118. agent: null,
  119. },
  120. sign:''
  121. },
  122. computed: {
  123. },
  124. mounted() {
  125. this.loadData();
  126. },
  127. created() {
  128. this.sign = getQuery('sign')
  129. },
  130. methods: {
  131. loadData() {
  132. this.loading = true;
  133. let params = {
  134. r: 'happiness/client/user/index'
  135. };
  136. params = Object.assign(params, this.searchInfo);
  137. request({
  138. params: params,
  139. method: 'get',
  140. }).then(e => {
  141. this.loading = false;
  142. if (e.data.code == 0) {
  143. this.list = e.data.data.list;
  144. this.pagination = e.data.data.pagination;
  145. this.levels = e.data.data.levels;
  146. this.page_size = e.data.data.page_size;
  147. } else {
  148. this.$message.error(e.data.msg);
  149. }
  150. }).catch(e => {
  151. this.loading = false;
  152. });
  153. },
  154. toSearch() {
  155. this.page = 1;
  156. this.loadData();
  157. },
  158. pageChange(page) {
  159. this.searchInfo.page = page;
  160. this.loadData();
  161. },
  162. navUserDetail(id){
  163. this.$navigate({
  164. r: 'happiness/client/user/detail',
  165. id: id,
  166. sign:this.sign
  167. })
  168. },
  169. }
  170. });
  171. </script>
  172. <style>
  173. .el-tabs__header {
  174. font-size: 16px;
  175. }
  176. .table-body {
  177. padding: 20px;
  178. background-color: #fff;
  179. }
  180. .table-body .el-button {
  181. padding: 0 !important;
  182. border: 0;
  183. margin: 0 5px;
  184. }
  185. .input-item {
  186. width: 250px;
  187. margin: 0 0 20px;
  188. display: inline-block;
  189. }
  190. /*.input-item .el-input__inner {*/
  191. /* border-right: 0;*/
  192. /*}*/
  193. .input-item .el-input__inner:hover {
  194. border: 1px solid #dcdfe6;
  195. /*border-right: 0;*/
  196. outline: 0;
  197. }
  198. .input-item .el-input__inner:focus {
  199. border: 1px solid #dcdfe6;
  200. /*border-right: 0;*/
  201. outline: 0;
  202. }
  203. .input-item .el-input-group__append {
  204. background-color: #fff;
  205. border-left: 0;
  206. width: 10%;
  207. padding: 0;
  208. }
  209. .input-item .el-input-group__append .el-button {
  210. padding: 0;
  211. }
  212. .input-item .el-input-group__append .el-button {
  213. margin: 0;
  214. }
  215. .batch {
  216. margin: 0 0 20px;
  217. display: inline-block;
  218. }
  219. .batch .el-button {
  220. padding: 9px 15px !important;
  221. }
  222. .el-table th>.cell{
  223. color: #333;
  224. font-weight: bold;
  225. font-size: 14px;
  226. }
  227. .el-table__footer-wrapper, .el-table__header-wrapper{
  228. border-bottom: 1.4px solid #D6D6D6;
  229. }
  230. .el-table th>.cell {
  231. color: #333;
  232. font-weight: bold;
  233. font-size: 14px;
  234. }
  235. .table1 .el-table__footer-wrapper,
  236. .table1 .el-table__header-wrapper {
  237. border-bottom: 1.4px solid #D6D6D6;
  238. }
  239. .user_img{
  240. position: relative;
  241. margin-right: 8px;
  242. /* height: 50px;
  243. width: 50px; */
  244. }
  245. .default-avatar{
  246. width: 50px;
  247. height: 50px;
  248. border-radius: 50%;
  249. margin-right: 8px;
  250. }
  251. .uer-nickname {
  252. flex: 1;
  253. }
  254. </style>