txxq.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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" :style="{ height: height }">
  9. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="getData" :style="{ height: height }">
  10. <!-- 空白页 -->
  11. <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
  12. <!-- 订单列表 -->
  13. <view class="order-item" v-for="(item, index) in tabItem.list" :key="index">
  14. <view class="title-box">
  15. <view class="title">
  16. 提现金额:{{(item.money*1).toFixed(2)}}({{item.reflectType}})
  17. </view>
  18. <view class="title">
  19. 提现账号:{{item.reflectInfo.name}}({{item.reflectInfo.account}})
  20. </view>
  21. <view class="time">
  22. {{$utils.formatDate(item.createTime)}}
  23. </view>
  24. </view>
  25. <view class="money">
  26. {{item.reflectStatus == 3?"无效":(item.reflectStatus == 4?"未打款":"已打款")}}
  27. </view>
  28. </view>
  29. <u-loadmore :status="tabItem.loadingType" v-if="!(tabItem.loaded && tabItem.list.length == 0)"/>
  30. </scroll-view>
  31. </swiper-item>
  32. </swiper>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. height: '',
  40. tabCurrentIndex: 0,
  41. navlist: [{
  42. status: 1,
  43. title: '未审核',
  44. list: [],
  45. page: 1,
  46. pageSize: 10,
  47. loaded: false,
  48. loadingType: 'loadmore'
  49. },
  50. {
  51. status: 2,
  52. title: '已审核',
  53. list: [],
  54. page: 1,
  55. pageSize: 10,
  56. loaded: false,
  57. loadingType: 'loadmore'
  58. }
  59. ]
  60. }
  61. },
  62. onLoad(opt) {
  63. },
  64. onShow() {
  65. this.getData()
  66. },
  67. onReachBottom() {
  68. // this.getData()
  69. },
  70. onReady() {
  71. var _this = this;
  72. uni.getSystemInfo({
  73. success: resu => {
  74. const query = uni.createSelectorQuery();
  75. query.select('.swiper-box').boundingClientRect();
  76. query.exec(function(res) {
  77. _this.height = resu.windowHeight - res[0].top + 'px';
  78. console.log('打印页面的剩余高度', _this.height);
  79. });
  80. },
  81. fail: res => {}
  82. });
  83. },
  84. methods: {
  85. //顶部tab点击
  86. tabClick(index) {
  87. this.tabCurrentIndex = index;
  88. this.getData('tab')
  89. },
  90. getData(type) {
  91. let that = this
  92. let item = that.navlist[that.tabCurrentIndex]
  93. if(type == 'tab') {
  94. item.loadingType = 'loadmore'
  95. item.list = []
  96. item.page = 1
  97. item.loaded = false
  98. }
  99. if (item.loadingType == 'nomore' || item.loadingType == 'loading') {
  100. return
  101. }
  102. item.loadingType = 'loading'
  103. that.$u.api.ygTxList({
  104. page: item.page,
  105. pageSize: item.pageSize,
  106. auditStatus: item.status
  107. }).then(res => {
  108. item.list = item.list.concat(res.data)
  109. item.page++
  110. if (item.limit == res.data.length) {
  111. item.loadingType = 'loadmore'
  112. } else {
  113. item.loadingType = 'nomore'
  114. }
  115. item.loaded = true
  116. })
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. // .order-item {
  123. // height: 207rpx;
  124. // width: 100%;
  125. // background-color: #fff;
  126. // padding: 30rpx 30rpx;
  127. // line-height: 1.5;
  128. // display: flex;
  129. // align-items: center;
  130. // border-bottom: 1rpx solid #F0F0F0;
  131. // .logo {
  132. // flex-shrink: 0;
  133. // margin-right: 20rpx;
  134. // width: 147rpx;
  135. // height: 147rpx;
  136. // border-radius: 20rpx;
  137. // background-color: #eee;
  138. // }
  139. // .title-box {
  140. // height: 100%;
  141. // flex-grow: 1;
  142. // padding-right: 50rpx;
  143. // display: flex;
  144. // flex-direction: column;
  145. // justify-content: space-between;
  146. // align-items: flex-start;
  147. // .title {
  148. // font-size: 30rpx;
  149. // color: #333333;
  150. // }
  151. // .time {
  152. // font-size: 36rpx;
  153. // font-weight: bold;
  154. // color: #E02020;
  155. // &::before {
  156. // content: '¥';
  157. // font-size: 24rpx;
  158. // }
  159. // }
  160. // }
  161. // .money {
  162. // flex-shrink: 0;
  163. // padding: 8rpx 12rpx;
  164. // background: #FEE1D7;
  165. // border-radius: 5px;
  166. // color: #fd5b23;
  167. // font-size: 26rpx;
  168. // text-align: right;
  169. // display: flex;
  170. // align-items: center;
  171. // justify-content: flex-end;
  172. // image {
  173. // width: 10rpx;
  174. // height: 20rpx;
  175. // margin-left: 15rpx;
  176. // }
  177. // .status {
  178. // color: #AEAEAE;
  179. // }
  180. // }
  181. // }
  182. .swiper-box {
  183. background-color: #fff;
  184. .order-item:last-child {
  185. margin-bottom: 60rpx;
  186. }
  187. .order-item {
  188. width: 100%;
  189. // background-color: red;
  190. padding: 20rpx 30rpx;
  191. line-height: 1.5;
  192. display: flex;
  193. align-items: center;
  194. .title-box {
  195. flex-grow: 1;
  196. padding-right: 50rpx;
  197. .title {
  198. font-size: 30rpx;
  199. color: #333333;
  200. }
  201. .time {
  202. font-size: 26rpx;
  203. color: #AEAEAE;
  204. }
  205. }
  206. .money {
  207. color: #fd5b23;
  208. font-size: 26rpx;
  209. text-align: right;
  210. .status {
  211. color: #AEAEAE;
  212. }
  213. }
  214. }
  215. }
  216. .navbar {
  217. // margin-top: 20rpx;
  218. display: flex;
  219. height: 88rpx;
  220. padding: 0 5px;
  221. background: #fff;
  222. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  223. position: relative;
  224. z-index: 10;
  225. .nav-item {
  226. flex: 1;
  227. display: flex;
  228. justify-content: center;
  229. align-items: center;
  230. height: 100%;
  231. font-size: 15px;
  232. color: #999999;
  233. position: relative;
  234. &.current {
  235. color: #000;
  236. &:after {
  237. content: '';
  238. position: absolute;
  239. left: 50%;
  240. bottom: 0;
  241. transform: translateX(-50%);
  242. width: 44px;
  243. height: 0;
  244. border-bottom: 2px solid #fe5b38;
  245. }
  246. }
  247. }
  248. }
  249. </style>