index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div class="mine">
  3. <div class="condition">
  4. <el-input placeholder="请输入内容" class="search" v-model="searchText">
  5. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  6. </el-input>
  7. <el-button type="primary" class="searchButton" @click="getUserList()"
  8. >搜索</el-button
  9. >
  10. <div class="silenceUser">
  11. <div class="title">显示沉默付费用户</div>
  12. <el-switch
  13. v-model="silence"
  14. active-color="#fa7d22"
  15. inactive-color="#e7e7e7"
  16. @change="showSilence"
  17. >
  18. </el-switch>
  19. </div>
  20. <div class="faceUser">
  21. <div class="title">显示未面诊付费用户</div>
  22. <el-switch
  23. v-model="face"
  24. active-color="#fa7d22"
  25. inactive-color="#e7e7e7"
  26. @change="showFace"
  27. >
  28. </el-switch>
  29. </div>
  30. <div class="filter">
  31. <div class="title">筛选</div>
  32. <i @click="openFilterPop" class="el-icon-s-operation"></i>
  33. </div>
  34. <!-- 筛选条件弹窗 -->
  35. <select-pop :visible.sync='dialogVisible'></select-pop>
  36. </div>
  37. <div class="user-list">
  38. <el-table
  39. ref="multipleTable"
  40. :data="tableData"
  41. tooltip-effect="dark"
  42. height="500"
  43. style="width: 100%; border-radius: 8px"
  44. @row-click="handleSelectionChange"
  45. >
  46. <el-table-column label="头像" width="120">
  47. <template slot-scope="scope">
  48. <div class="head-img">
  49. <img :src="scope.row.avatar_url" alt="" />
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="nickname" label="昵称" width="120">
  54. </el-table-column>
  55. <el-table-column prop="id" label="用户ID" width="120"></el-table-column>
  56. <el-table-column prop="mobile" label="联系电话" show-overflow-tooltip>
  57. </el-table-column>
  58. <el-table-column
  59. prop="create_time"
  60. label="注册时间"
  61. show-overflow-tooltip
  62. >
  63. </el-table-column>
  64. </el-table>
  65. <div class="pagin">
  66. <el-pagination
  67. background
  68. layout="prev, pager, next"
  69. @size-change="handleSizeChange"
  70. @current-change="handleCurrentChange"
  71. :current-page.sync="currentPage1"
  72. :total="total"
  73. >
  74. </el-pagination>
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script>
  80. import api from "../../server/home";
  81. import selectPop from './selectPop/index.vue'
  82. export default {
  83. components: {selectPop},
  84. data() {
  85. return {
  86. searchText: "",
  87. dates: "",
  88. coupon: "",
  89. couponList: [
  90. {
  91. value: "选项1",
  92. label: "黄金糕",
  93. },
  94. {
  95. value: "选项2",
  96. label: "双皮奶",
  97. },
  98. ],
  99. tableData: [],
  100. currentPage1: 1,
  101. multipleSelection: "",
  102. total: 0,
  103. face: false, //未面诊用户开关
  104. silence: false, //沉默用户开关
  105. dialogVisible:false // 控制筛选弹框
  106. };
  107. },
  108. computed: {},
  109. watch: {},
  110. methods: {
  111. // 筛选沉默用户
  112. showSilence(e){
  113. console.log(e);
  114. },
  115. // 筛选未面诊用户
  116. showFace(e){
  117. console.log(e);
  118. },
  119. // 打开筛选条件弹框
  120. openFilterPop() {
  121. this.dialogVisible = true;
  122. },
  123. // 获取订单列表
  124. getUserList() {
  125. let params = {
  126. page: this.currentPage1,
  127. limit: this.limit,
  128. keywords: this.searchText,
  129. };
  130. api.getUserList(params).then((res) => {
  131. if (res.code == 200) {
  132. // 将用户手机号中间四位变成****
  133. res.data.list.map((item) => {
  134. item.mobile =
  135. item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
  136. });
  137. this.tableData = res.data.list;
  138. this.total = res.data.total;
  139. }
  140. });
  141. },
  142. handleCurrentChange(e) {
  143. this.currentPage1 = e;
  144. this.getUserList();
  145. },
  146. handleSizeChange(val) {},
  147. handleSelectionChange(row, column, event) {
  148. this.$router.push({
  149. path: "/customerMan/details",
  150. query: {
  151. id: row.id,
  152. },
  153. });
  154. },
  155. },
  156. created() {
  157. this.getUserList();
  158. },
  159. mounted() {},
  160. };
  161. </script>
  162. <style lang='less' scoped>
  163. .mine {
  164. .condition {
  165. display: flex;
  166. .coupon-select {
  167. width: 174px;
  168. margin-left: 18px;
  169. }
  170. .search {
  171. width: 152px;
  172. margin-left: 18px;
  173. }
  174. .searchButton {
  175. margin-left: 18px;
  176. width: 68px;
  177. background: #fa7d22;
  178. border-radius: 2px;
  179. border-color: #fa7d22;
  180. }
  181. .silenceUser {
  182. display: flex;
  183. margin-left: 53px;
  184. align-items: center;
  185. .title {
  186. line-height: 40px;
  187. margin-right: 16px;
  188. }
  189. }
  190. .faceUser {
  191. display: flex;
  192. margin-left: 53px;
  193. align-items: center;
  194. .title {
  195. line-height: 40px;
  196. margin-right: 16px;
  197. }
  198. }
  199. .filter {
  200. display: flex;
  201. align-items: center;
  202. margin-left: 53px;
  203. .title {
  204. margin-right: 17px;
  205. }
  206. i {
  207. font-size: 17px;
  208. }
  209. }
  210. }
  211. .user-list {
  212. margin-top: 18px;
  213. padding: 0 12px;
  214. width: 100%;
  215. background: #ffffff;
  216. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  217. border-radius: 8px;
  218. .head-img {
  219. width: 36px;
  220. height: 36px;
  221. border-radius: 50%;
  222. img {
  223. width: 100%;
  224. height: 100%;
  225. }
  226. }
  227. .pagin {
  228. padding: 20px 0;
  229. .el-pagination {
  230. text-align: center;
  231. }
  232. }
  233. /deep/ .el-table th > .cell {
  234. font-size: 14px !important;
  235. font-family: PingFangSC-Regular, PingFang SC;
  236. font-weight: 400;
  237. color: #999999;
  238. line-height: 20px;
  239. }
  240. /deep/ .el-table td,
  241. .el-table th.is-leaf {
  242. border-bottom: none;
  243. }
  244. }
  245. }
  246. </style>