xhplist.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navlist" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
  6. </view>
  7. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
  8. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex">
  9. <scroll-view scroll-y="true" :style="{'height': height}" class="swiper-box" @scrolltolower="loadData"
  10. v-for="">
  11. <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
  12. <view class="gq-list">
  13. <view class="gq-item" v-for="item in tabItem.list">
  14. <view class="gq-logo">
  15. <image src="" mode="" class=""></image>
  16. </view>
  17. <view class="info">
  18. <view class="info-tit">
  19. 名称:
  20. </view>
  21. <view class="info-val">
  22. 创始人
  23. </view>
  24. </view>
  25. <view class="info">
  26. <view class="info-tit">
  27. ID:
  28. </view>
  29. <view class="info-val">
  30. 创始人
  31. </view>
  32. </view>
  33. <view class="info">
  34. <view class="info-tit">
  35. 出仓时间:
  36. </view>
  37. <view class="info-val">
  38. 创始人
  39. </view>
  40. </view>
  41. <view class="info">
  42. <view class="info-tit">
  43. 门店:
  44. </view>
  45. <view class="info-val">
  46. 创始人
  47. </view>
  48. </view>
  49. <view class="info">
  50. <view class="info-tit">
  51. 调拨人:
  52. </view>
  53. <view class="info-val">
  54. 创始人
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <u-loadmore :status="tabItem.loadingType" />
  60. </scroll-view>
  61. </swiper-item>
  62. </swiper>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. tabCurrentIndex: 0,
  70. height: '',
  71. navlist: [{
  72. status: 0,
  73. title: '使用中',
  74. list: 10,
  75. page: 1,
  76. limit: 10,
  77. loaded: false,
  78. loadingType: 'loadmore'
  79. },
  80. {
  81. status: 1,
  82. title: '已使用',
  83. list: [],
  84. page: 1,
  85. limit: 10,
  86. loaded: false,
  87. loadingType: 'loadmore'
  88. }
  89. ]
  90. }
  91. },
  92. onLoad() {
  93. },
  94. onShow() {
  95. },
  96. onReachBottom() {
  97. },
  98. onReady() {
  99. var _this = this;
  100. uni.getSystemInfo({
  101. success: resu => {
  102. const query = uni.createSelectorQuery();
  103. query.select('.swiper-box').boundingClientRect();
  104. query.exec(function(res) {
  105. _this.height = resu.windowHeight - res[0].top + 'px';
  106. console.log('打印页面的剩余高度', _this.height);
  107. });
  108. },
  109. fail: res => {}
  110. });
  111. },
  112. methods: {
  113. tabClick(index) {
  114. this.tabCurrentIndex = index;
  115. this.loadData('tab')
  116. },
  117. loadData(type) {
  118. let that = this
  119. let index = that.tabCurrentIndex
  120. let item = that.navlist[index]
  121. if (type == 'reload') {
  122. item.loaded = false
  123. item.loadingType = 'loadmore'
  124. item.page = 1
  125. item.list = []
  126. }
  127. if (type == 'tab' && item.loaded) {
  128. return
  129. }
  130. if (item.loadingType == 'loading' || item.loadingType == 'nomore') {
  131. return
  132. }
  133. item.loadingType = 'loading'
  134. },
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. .navbar {
  140. // margin-top: 20rpx;
  141. display: flex;
  142. height: 88rpx;
  143. padding: 0 5px;
  144. background: #fff;
  145. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  146. position: relative;
  147. z-index: 10;
  148. .nav-item {
  149. flex: 1;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. height: 100%;
  154. font-size: 15px;
  155. color: #999999;
  156. position: relative;
  157. &.current {
  158. color: #000;
  159. &:after {
  160. content: '';
  161. position: absolute;
  162. left: 50%;
  163. bottom: 0;
  164. transform: translateX(-50%);
  165. width: 44px;
  166. height: 0;
  167. border-bottom: 2px solid #fe5b38;
  168. }
  169. }
  170. }
  171. }
  172. .swiper-box {
  173. .gq-list {
  174. display: flex;
  175. flex-wrap: wrap;
  176. justify-content: flex-start;
  177. // justify-content: space-between;
  178. padding: 20rpx 0 20rpx 20rpx;
  179. }
  180. .gq-item {
  181. margin: 0 0 20rpx 14rpx;
  182. width: 227rpx;
  183. // height: 351rpx;
  184. background: #FFFFFF;
  185. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  186. border-radius: 10rpx;
  187. display: flex;
  188. flex-direction: column;
  189. align-items: center;
  190. justify-content: space-between;
  191. padding: 30rpx 14rpx 20rpx;
  192. .gq-logo {
  193. width: 193rpx;
  194. height: 193rpx;
  195. background: #EEEFF1;
  196. border-radius: 15px;
  197. display: flex;
  198. justify-content: center;
  199. align-items: center;
  200. image {
  201. width: 193rpx;
  202. height: 193rpx;
  203. }
  204. }
  205. .store-name {
  206. padding-top: 10rpx;
  207. text-align: center;
  208. width: 100%;
  209. font-size: 26rpx;
  210. font-weight: 500;
  211. color: #262261;
  212. overflow: hidden;
  213. }
  214. .info {
  215. width: 100%;
  216. display: flex;
  217. padding: 5rpx 0;
  218. .info-tit {
  219. font-size: 18rpx;
  220. flex-shrink: 0;
  221. }
  222. .info-val {
  223. text-align: center;
  224. font-size: 20rpx;
  225. width: 140rpx;
  226. border-bottom: 1px #C7C7C7 solid;
  227. }
  228. }
  229. }
  230. }
  231. </style>