minMember.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <image src="../../static/img/tgbg.png" mode=""></image>
  5. <view class="top-val">
  6. {{allMun || 0}}<text>人</text>
  7. </view>
  8. </view>
  9. <scroll-view scroll-y="true" :style="{'height': height}" class="list" @scrolltolower="loadData()">
  10. <empty v-if="loaded && list.length == 0" ></empty>
  11. <view class="apply-item flex" v-for="(item,index) in list" :key="index">
  12. <view class="item-left flex">
  13. <image :src="item.avatar" mode="" class="item-img"></image>
  14. <view class="item-info flex">
  15. <view class="name flex">
  16. <view class="">
  17. {{ item.nickname }}
  18. </view>
  19. <image src="../../static/img/lv02.png" mode="" v-if="item.level == 2"></image>
  20. <image src="../../static/img/lv03.png" mode="" v-if="item.level == 3"></image>
  21. <image src="../../static/img/lv04.png" mode="" v-if="item.level == 4"></image>
  22. </view>
  23. <view class="phone">
  24. uid:{{ item.uid }}
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <uni-load-more :status="loadingType" v-if="!loaded"></uni-load-more>
  30. <view class="btn-jg"></view>
  31. </scroll-view>
  32. </view>
  33. </template>
  34. <script>
  35. import empty from '@/components/empty';
  36. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  37. import {getMyTvillage} from '@/api/user.js'
  38. export default {
  39. components: {
  40. empty,
  41. uniLoadMore
  42. },
  43. data() {
  44. return {
  45. height: '',
  46. list: [],
  47. loaded: false,
  48. loadingType: 'more',
  49. page: 1,
  50. limit: 10,
  51. allMun: 0,
  52. }
  53. },
  54. onReady(res) {
  55. var _this = this;
  56. uni.getSystemInfo({
  57. success: resu => {
  58. const query = uni.createSelectorQuery();
  59. query.select('.list').boundingClientRect();
  60. query.exec(function(res) {
  61. console.log(res, 'ddddddddddddd');
  62. _this.height = resu.windowHeight - res[0].top + 'px';
  63. console.log('打印页面的剩余高度', _this.height);
  64. });
  65. },
  66. fail: res => {}
  67. });
  68. },
  69. onLoad() {
  70. this.loadData()
  71. },
  72. methods: {
  73. loadData() {
  74. let obj = this
  75. if(obj.loadingType == 'loading') {
  76. return
  77. }
  78. if(obj.loadingType == 'noMore') {
  79. return
  80. }
  81. obj.loadingType = 'loading'
  82. getMyTvillage({
  83. page: obj.page,
  84. limit: obj.limit
  85. }).then(({data}) => {
  86. console.log(data,'wodehuiuyuan+++++++++++++')
  87. obj.allMun = data.count
  88. obj.list = obj.list.concat(data.data)
  89. obj.page++
  90. if(obj.limit == data.data.length){
  91. obj.loadingType = 'more'
  92. return
  93. }else {
  94. obj.loadingType = 'noMore'
  95. }
  96. obj.$set(obj,'loaded',true)
  97. }).catch( err => {
  98. console.log(err)
  99. obj.loaded = true
  100. })
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .top {
  107. width: 750rpx;
  108. height: 400rpx;
  109. position: relative;
  110. image {
  111. width: 100%;
  112. height: 100%;
  113. position: absolute;
  114. top: 0;
  115. }
  116. .top-val {
  117. width: 100%;
  118. height: 100%;
  119. line-height:400rpx;
  120. text-align: center;
  121. font-size: 72rpx;
  122. font-family: PingFang SC;
  123. font-weight: bold;
  124. color: #FF4C4C;
  125. position: absolute;
  126. top: 0;
  127. text {
  128. font-size: 36rpx;
  129. }
  130. }
  131. }
  132. .btn-wrapper {
  133. width: 100%;
  134. height: 116rpx;
  135. z-index: 99;
  136. position: fixed;
  137. bottom: 0;
  138. left: 0;
  139. right: 0;
  140. margin: auto;
  141. background-color: #fff;
  142. .btm-btn {
  143. margin: 0 auto;
  144. width: 674rpx;
  145. height: 88rpx;
  146. background: #FF4C4C;
  147. border-radius: 44rpx;
  148. text-align: center;
  149. line-height: 88rpx;
  150. font-size: 36rpx;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. color: #FFFFFF;
  154. }
  155. }
  156. .btn-jg {
  157. height: 116rpx;
  158. }
  159. .list {
  160. height: 100%;
  161. // position: relative;
  162. // background-color: red;
  163. .apply-item {
  164. background-color: #fff;
  165. height: 130rpx;
  166. border-bottom: 1px solid #F0F0F0;
  167. padding: 0 35rpx 0 20rpx;
  168. &:last-child {
  169. border: none;
  170. }
  171. .item-left {
  172. .item-img {
  173. height: 80rpx;
  174. width: 80rpx;
  175. border-radius: 80rpx;
  176. background-color: red;
  177. }
  178. .item-info {
  179. height: 80rpx;
  180. flex-direction: column;
  181. padding-left: 20rpx;
  182. justify-content: space-around;
  183. align-items: flex-start;
  184. line-height: 1;
  185. .name {
  186. font-size: 30rpx;
  187. font-family: PingFangSC;
  188. font-weight: 500;
  189. color: #3F454B;
  190. image {
  191. width: 140rpx;
  192. height: 30rpx;
  193. }
  194. }
  195. .phone {
  196. font-size: 22rpx;
  197. font-family: PingFang SC;
  198. font-weight: 400;
  199. color: #999999;
  200. }
  201. }
  202. }
  203. .item-btn {
  204. .err-btn {
  205. width: 98rpx;
  206. height: 47rpx;
  207. border: 1px solid #000000;
  208. border-radius: 5rpx;
  209. line-height: 47rpx;
  210. text-align: center;
  211. font-size: 24rpx;
  212. font-family: PingFang SC;
  213. font-weight: 500;
  214. color: #333333;
  215. }
  216. .pas-btn {
  217. width: 98rpx;
  218. height: 47rpx;
  219. background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
  220. border-radius: 5rpx;
  221. line-height: 47rpx;
  222. text-align: center;
  223. font-size: 24rpx;
  224. font-family: PingFang SC;
  225. font-weight: 500;
  226. color: #333333;
  227. margin-left: 10rpx;
  228. }
  229. }
  230. .item-right {
  231. line-height: 129rpx;
  232. font-size: 24rpx;
  233. font-family: PingFang SC;
  234. font-weight: 400;
  235. color: #999999;
  236. }
  237. }
  238. }
  239. </style>