minMember.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. {{ item.spread_time }}
  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. obj.allMun = data.count
  87. obj.list = obj.list.concat(data.data)
  88. obj.page++
  89. if(obj.limit == data.data.length){
  90. obj.loadingType = 'more'
  91. return
  92. }else {
  93. obj.loadingType = 'noMore'
  94. }
  95. obj.$set(obj,'loaded',true)
  96. }).catch( err => {
  97. console.log(err)
  98. obj.loaded = true
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .top {
  106. width: 750rpx;
  107. height: 400rpx;
  108. position: relative;
  109. image {
  110. width: 100%;
  111. height: 100%;
  112. position: absolute;
  113. top: 0;
  114. }
  115. .top-val {
  116. width: 100%;
  117. height: 100%;
  118. line-height:400rpx;
  119. text-align: center;
  120. font-size: 72rpx;
  121. font-family: PingFang SC;
  122. font-weight: bold;
  123. color: #FF4C4C;
  124. position: absolute;
  125. top: 0;
  126. text {
  127. font-size: 36rpx;
  128. }
  129. }
  130. }
  131. .btn-wrapper {
  132. width: 100%;
  133. height: 116rpx;
  134. z-index: 99;
  135. position: fixed;
  136. bottom: 0;
  137. left: 0;
  138. right: 0;
  139. margin: auto;
  140. background-color: #fff;
  141. .btm-btn {
  142. margin: 0 auto;
  143. width: 674rpx;
  144. height: 88rpx;
  145. background: #FF4C4C;
  146. border-radius: 44rpx;
  147. text-align: center;
  148. line-height: 88rpx;
  149. font-size: 36rpx;
  150. font-family: PingFang SC;
  151. font-weight: 500;
  152. color: #FFFFFF;
  153. }
  154. }
  155. .btn-jg {
  156. height: 116rpx;
  157. }
  158. .list {
  159. height: 100%;
  160. // position: relative;
  161. // background-color: red;
  162. .apply-item {
  163. background-color: #fff;
  164. height: 130rpx;
  165. border-bottom: 1px solid #F0F0F0;
  166. padding: 0 35rpx 0 20rpx;
  167. &:last-child {
  168. border: none;
  169. }
  170. .item-left {
  171. .item-img {
  172. height: 80rpx;
  173. width: 80rpx;
  174. border-radius: 80rpx;
  175. background-color: red;
  176. }
  177. .item-info {
  178. height: 80rpx;
  179. flex-direction: column;
  180. padding-left: 20rpx;
  181. justify-content: space-around;
  182. align-items: flex-start;
  183. line-height: 1;
  184. .name {
  185. font-size: 30rpx;
  186. font-family: PingFangSC;
  187. font-weight: 500;
  188. color: #3F454B;
  189. }
  190. .phone {
  191. font-size: 22rpx;
  192. font-family: PingFang SC;
  193. font-weight: 400;
  194. color: #999999;
  195. }
  196. }
  197. }
  198. .item-btn {
  199. .err-btn {
  200. width: 98rpx;
  201. height: 47rpx;
  202. border: 1px solid #000000;
  203. border-radius: 5rpx;
  204. line-height: 47rpx;
  205. text-align: center;
  206. font-size: 24rpx;
  207. font-family: PingFang SC;
  208. font-weight: 500;
  209. color: #333333;
  210. }
  211. .pas-btn {
  212. width: 98rpx;
  213. height: 47rpx;
  214. background: linear-gradient(-35deg, #F8DD4F, #FBEB77);
  215. border-radius: 5rpx;
  216. line-height: 47rpx;
  217. text-align: center;
  218. font-size: 24rpx;
  219. font-family: PingFang SC;
  220. font-weight: 500;
  221. color: #333333;
  222. margin-left: 10rpx;
  223. }
  224. }
  225. .item-right {
  226. line-height: 129rpx;
  227. font-size: 24rpx;
  228. font-family: PingFang SC;
  229. font-weight: 400;
  230. color: #999999;
  231. }
  232. }
  233. }
  234. </style>