applyList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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.text }}</view>
  6. </view>
  7. <swiper :current="tabCurrentIndex" :style="{'height':height}" class="swiper-box" duration="300" @change="changeTab">
  8. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  9. <scroll-view scroll-y="true" class="list-scroll-content" :style="{'height':height}">
  10. <!-- 申请列表 -->
  11. <view class="apply-box" v-for="item in 20">
  12. <view class="box-top">
  13. <image src="" mode="" class="user-img"></image>
  14. <view class="user-info">
  15. <view class="user-name clamp">
  16. 假猪套 假猪套假猪套假
  17. </view>
  18. <view class="user-phone">
  19. 13245678911
  20. </view>
  21. </view>
  22. </view>
  23. <view class="apply-info flex">
  24. <view class="img-wrap">
  25. <image src="" mode="" class="upimg" v-for="item in 2"></image>
  26. </view>
  27. <view class="btn-wrap flex" v-if="tabCurrentIndex == 0">
  28. <view class="btn btn-reject">拒绝</view>
  29. <view class="btn btn-pass">通过</view>
  30. </view>
  31. <view class="btn-wrap" v-if="tabCurrentIndex == 1">
  32. 已通过
  33. </view>
  34. </view>
  35. </view>
  36. </scroll-view>
  37. </swiper-item>
  38. </swiper>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. height: '',
  46. tabCurrentIndex: 0,
  47. navList: [{
  48. state: 0,
  49. text: '未审核',
  50. loadingType: 'more',
  51. orderList: [],
  52. },
  53. {
  54. state: 1,
  55. text: '已审核',
  56. loadingType: 'more',
  57. orderList: [],
  58. }
  59. ]
  60. }
  61. },
  62. onReady(res) {
  63. var obj = this;
  64. uni.getSystemInfo({
  65. success: resu => {
  66. const query = uni.createSelectorQuery();
  67. query.select('.swiper-box').boundingClientRect();
  68. query.exec(function(res) {
  69. console.log(res, 'ddddddddddddd');
  70. obj.height = resu.windowHeight - res[0].top + 'px';
  71. console.log('打印页面的剩余高度', obj.height);
  72. });
  73. },
  74. fail: res => {}
  75. });
  76. },
  77. methods: {
  78. //顶部tab点击
  79. tabClick(index) {
  80. this.tabCurrentIndex = index;
  81. },
  82. changeTab(e) {
  83. this.tabCurrentIndex = e.target.current;
  84. this.loadData('tabChange');
  85. },
  86. loadData(source) {
  87. console.log('swiper')
  88. let index = this.tabCurrentIndex;
  89. let navItem = this.navList[index];
  90. // let state = navItem.state+3;
  91. if (source === 'tabChange' && navItem.loaded === true) {
  92. //tab切换只有第一次需要加载数据
  93. return;
  94. }
  95. if (navItem.loadingType === 'loading') {
  96. //防止重复加载
  97. return;
  98. }
  99. //修改当前对象状态为加载中
  100. navItem.loadingType = 'loading';
  101. }
  102. }
  103. }
  104. </script>
  105. <style scoped lang="scss">
  106. .navbar {
  107. display: flex;
  108. height: 40px;
  109. padding: 0 5px;
  110. background: #000;
  111. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  112. position: relative;
  113. z-index: 10;
  114. .nav-item {
  115. flex: 1;
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. height: 100%;
  120. font-size: 15px;
  121. color: #999999;
  122. position: relative;
  123. &.current {
  124. color: $base-color;
  125. &:after {
  126. content: '';
  127. position: absolute;
  128. left: 50%;
  129. bottom: 0;
  130. transform: translateX(-50%);
  131. width: 44px;
  132. height: 0;
  133. border-bottom: 2px solid $base-color;
  134. }
  135. }
  136. }
  137. }
  138. .swiper-box {
  139. background-color: #15130f;
  140. .apply-box {
  141. height: 317rpx;
  142. width: 702rpx;
  143. // background-color: red;
  144. margin: 0 auto;
  145. border-bottom: 1px solid #6c6a68;
  146. padding-top: 30rpx;
  147. .box-top {
  148. height: 80rpx;
  149. // background-color: #bfa;
  150. display: flex;
  151. justify-content: flex-start;
  152. .user-img {
  153. width: 80rpx;
  154. height: 80rpx;
  155. background-color: #eee;
  156. margin-right: 20rpx;
  157. flex-shrink: 0;
  158. border-radius: 50%;
  159. }
  160. .user-name {
  161. max-width: 500rpx;
  162. font-size: 30rpx;
  163. font-family: PingFang SC;
  164. font-weight: 500;
  165. color: #FFFFFF;
  166. }
  167. .user-phone {
  168. padding-top: 10rpx;
  169. font-size: 22rpx;
  170. font-family: PingFang SC;
  171. font-weight: 400;
  172. color: #FFFFFF;
  173. }
  174. }
  175. .apply-info {
  176. padding: 25rpx 0 0 100rpx;
  177. justify-content: space-between;
  178. .img-wrap {
  179. .upimg {
  180. width: 153rpx;
  181. height: 152rpx;
  182. border-radius: 10rpx;
  183. background-color: #999;
  184. margin-left: 10rpx;
  185. }
  186. }
  187. .btn-wrap {
  188. align-self: flex-end;
  189. color: #FAD6B0;
  190. font-size: 24rpx;
  191. font-family: PingFang SC;
  192. font-weight: 500;
  193. color: #FAD6B0;
  194. .btn {
  195. width: 98rpx;
  196. line-height: 47rpx;
  197. text-align: center;
  198. }
  199. .btn-reject {
  200. border: 1px solid #FAD6B0;
  201. border-radius: 5rpx;
  202. color: #FAD6B0;
  203. }
  204. .btn-pass {
  205. background: linear-gradient(-74deg, #CE9C6D, #FFECD6);
  206. border-image: linear-gradient(115deg, #FEEBD5, #FFFFFF, #E1AD7D) 1 1;
  207. box-shadow: 3rpx 4rpx 5rpx 0rpx rgba(151, 118, 74, 0.5);
  208. border-radius: 5rpx;
  209. color: #874B19;
  210. margin-left: 10rpx;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>