index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="mine">
  3. <div class="condition">
  4. <el-date-picker v-model="dates"
  5. type="daterange"
  6. range-separator="->"
  7. start-placeholder="开始日期"
  8. end-placeholder="结束日期">
  9. </el-date-picker>
  10. <el-input placeholder="请输入内容"
  11. class="search"
  12. v-model="searchText">
  13. <i slot="prefix"
  14. class="el-input__icon el-icon-search"></i>
  15. </el-input>
  16. <el-button type="primary"
  17. class="searchButton"
  18. @click="getSkinList">搜索</el-button>
  19. </div>
  20. <div class="list">
  21. <div class="tab">
  22. <div class="head-img">头像</div>
  23. <div class="head-name">昵称</div>
  24. <div class="head-phone">联系电话</div>
  25. <div class="head-ts">预约时间</div>
  26. <div class="head-status">状态</div>
  27. </div>
  28. <div class="content">
  29. <div class="tab user-info"
  30. v-for="(item,index) in userList"
  31. :key="index"
  32. @click="onDetails(item.id)">
  33. <div class="head-img"><img :src="item.avatar_url"
  34. alt=""></div>
  35. <div class="head-name">{{ item.nickname }}</div>
  36. <div class="head-phone">{{ item.mobile }}</div>
  37. <div class="head-ts">{{ item.check_time }}</div>
  38. <div class="head-status"
  39. :style="item.status==1?'color: #61D09D;':'color: #FC3019;'">{{ item.status==1?'已面诊':'未面诊'}}</div>
  40. </div>
  41. </div>
  42. <div class="pagin">
  43. <el-pagination background
  44. layout="prev, pager, next"
  45. @current-change="handleCurrentChange"
  46. :current-page.sync="currentPage1"
  47. :total="total">
  48. </el-pagination>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import api from '../../server/home'
  55. export default {
  56. components: {},
  57. data () {
  58. return {
  59. dates: [],
  60. searchText: '',
  61. userList: [],
  62. currentPage1: 1,
  63. limit: 10,
  64. total: 0,
  65. }
  66. },
  67. computed: {},
  68. watch: {},
  69. methods: {
  70. getSkinList () {
  71. let start_date = '', end_date = ''
  72. if (this.dates && this.dates.length > 0) {
  73. start_date = utils.formatTime(this.dates[0], 'yyyy-MM-dd')
  74. end_date = utils.formatTime(this.dates[1], 'yyyy-MM-dd')
  75. }
  76. console.log(start_date, end_date, 'end_date');
  77. let params = {
  78. page: this.currentPage1,
  79. limit: this.limit,
  80. keywords: this.searchText,
  81. start_date: start_date,
  82. end_date: end_date,
  83. }
  84. api.getSkinList(params).then(res => {
  85. if (res.code == 200) {
  86. this.userList = res.data.list
  87. this.total = res.data.total
  88. }
  89. })
  90. },
  91. onDetails (e) {
  92. this.$router.push({
  93. path: '/testSkin/details',
  94. query: {
  95. id: e
  96. }
  97. })
  98. },
  99. handleCurrentChange (e) {
  100. this.currentPage1 = e
  101. this.getSkinList
  102. console.log(e, 'eeeeee');
  103. }
  104. },
  105. created () {
  106. this.getSkinList()
  107. },
  108. mounted () { }
  109. }
  110. </script>
  111. <style lang='less' scoped>
  112. .mine {
  113. .condition {
  114. display: flex;
  115. .search {
  116. width: 152px;
  117. margin-left: 18px;
  118. }
  119. .searchButton {
  120. margin-left: 18px;
  121. width: 68px;
  122. background: #fa7d22;
  123. border-radius: 2px;
  124. border-color: #fa7d22;
  125. }
  126. }
  127. .list {
  128. margin-top: 18px;
  129. padding: 14px 12px;
  130. background: #ffffff;
  131. box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
  132. border-radius: 8px;
  133. .tab {
  134. padding-bottom: 9px;
  135. border-bottom: 1px solid #e6e6e6;
  136. display: flex;
  137. align-items: center;
  138. font-size: 14px;
  139. font-family: PingFangSC-Regular, PingFang SC;
  140. font-weight: 400;
  141. color: #999999;
  142. line-height: 20px;
  143. .head-img {
  144. width: 84px;
  145. img {
  146. width: 36px;
  147. }
  148. }
  149. .head-name {
  150. width: 144px;
  151. }
  152. .head-phone {
  153. width: 192px;
  154. }
  155. .head-ts {
  156. width: 288px;
  157. }
  158. .head-status {
  159. }
  160. }
  161. .content {
  162. border-bottom: 0px;
  163. padding-top: 14px;
  164. max-height: 300px;
  165. overflow: auto;
  166. .user-info {
  167. border-bottom: 18px;
  168. font-size: 14px;
  169. font-family: PingFangSC-Regular, PingFang SC;
  170. font-weight: 400;
  171. color: #333333;
  172. line-height: 22px;
  173. }
  174. }
  175. .el-pagination {
  176. text-align: center;
  177. margin-top: 50px;
  178. }
  179. }
  180. }
  181. </style>