gourpIndex.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="">
  3. <view class="tab" style="height: 60px;">
  4. <view style="display: flex;margin-top: 10px;">
  5. <u--input placeholder="输入名字" border="surround" v-model="param.name" @clear="param.name='';list=[];getData()"
  6. clearable>
  7. </u--input>
  8. <view class="reset_btn" @click="param.pageNo=1;list=[];getData()">搜索</view>
  9. </view>
  10. </view>
  11. <view style="padding: 10px 20px;">
  12. <u-divider :text="'总数:'+param.dataCount+'人'"></u-divider>
  13. <view v-for="(item,index) in list">
  14. <u-divider></u-divider>
  15. <u-row customStyle="margin-bottom: 10px">
  16. <u-col span="11">
  17. <view style="font-size: 18px;">{{item.name}} ({{item.phone}})</view>
  18. </u-col>
  19. <u-col span="1" justify="end">
  20. <view class="demo-layout bg-purple-light" style="float: right;" @click="makePhoneCall(item.phone)">
  21. <u-icon name="phone-fill" size="23" style="margin-left: 5px;cursor: pointer;"
  22. color="#07c5ff"></u-icon>
  23. </view>
  24. </u-col>
  25. </u-row>
  26. </view>
  27. </view>
  28. <view style="height: 60px;"></view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. param: {
  36. pageNo: 1,
  37. pageSize: 15,
  38. name: '',
  39. dataCount:0
  40. },
  41. list: [],
  42. loadMore: false,
  43. };
  44. },
  45. onLoad() {
  46. },
  47. onShow() {
  48. this.getData()
  49. },
  50. //下拉刷新
  51. onPullDownRefresh() {
  52. this.param.pageNo = 1;
  53. this.param.name = '';
  54. setTimeout(() => {
  55. this.getData();
  56. uni.stopPullDownRefresh();
  57. }, 1000);
  58. },
  59. //上拉加载
  60. onReachBottom() {
  61. if (this.loadMore) {
  62. this.param.pageNo++;
  63. this.getData();
  64. }
  65. },
  66. methods: {
  67. makePhoneCall(phone) {
  68. uni.makePhoneCall({
  69. phoneNumber: phone
  70. });
  71. },
  72. back() {
  73. uni.navigateBack()
  74. },
  75. getData() {
  76. this.http.request({
  77. url: '/level-one-server/app/TbPeople/getGroupPeople',
  78. data: this.param,
  79. success: res => {
  80. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  81. this.param.dataCount=res.data.dataCount;
  82. if (res.data.data) {
  83. this.list.push(...res.data.data);
  84. }
  85. if (this.param.pageNo == 1 && res.data.data && res.data.data.length == 0) {
  86. this.list = []
  87. }
  88. }
  89. });
  90. },
  91. },
  92. }
  93. </script>
  94. <style lang="scss">
  95. page {
  96. background-color: #f5f5f5;
  97. }
  98. .tab {
  99. .reset_btn {
  100. line-height: 35px;
  101. padding: 0 15px;
  102. border: 1px solid #e2e2e2;
  103. border-radius: 8px;
  104. margin-left: 10px;
  105. background: #e2e2e2
  106. }
  107. }
  108. .my_top {
  109. position: relative;
  110. overflow: hidden;
  111. image {
  112. width: 100%;
  113. }
  114. }
  115. .list {
  116. position: relative;
  117. padding: 0px 20px 10px 20px;
  118. margin-top: -196px;
  119. .user {
  120. background-color: white;
  121. padding: 20px;
  122. border-radius: 8px;
  123. color: $font-c;
  124. .head {
  125. float: left;
  126. width: 55px;
  127. height: 55px;
  128. }
  129. .con {
  130. float: left;
  131. padding-left: 15px;
  132. width: 60%;
  133. .nickName {
  134. font-size: 17px;
  135. font-weight: bold;
  136. }
  137. .tag {
  138. background-color: #6799ad;
  139. color: white;
  140. float: left;
  141. font-size: 13px;
  142. padding: 2px 6px;
  143. border-radius: 5px;
  144. margin-top: 6px;
  145. }
  146. }
  147. .edit {
  148. float: right;
  149. font-size: 20px;
  150. margin-top: 17px;
  151. }
  152. }
  153. }
  154. .exit {
  155. margin-top: 20px;
  156. background-color: white;
  157. color: #f44336;
  158. }
  159. .back {
  160. position: fixed;
  161. width: 100%;
  162. bottom: 00px;
  163. }
  164. </style>