123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <template>
- <view class="content">
- <view class="navbar">
- <view v-for="(item, index) in navlist" :key="index" class="nav-item"
- :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
- </view>
- <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
- <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex" :style="{ height: height }">
- <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="getData" :style="{ height: height }">
- <!-- 空白页 -->
- <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
- <!-- 订单列表 -->
- <view class="order-item" v-for="(item, index) in tabItem.list" :key="index">
- <view class="title-box">
- <view class="title">
- 提现金额:{{(item.money*1).toFixed(2)}}({{item.reflectType}})
- </view>
- <view class="title">
- 提现账号:{{item.reflectInfo.name}}({{item.reflectInfo.account}})
- </view>
- <view class="time">
- {{$utils.formatDate(item.createTime)}}
- </view>
- </view>
- <view class="money">
- {{item.reflectStatus == 3?"无效":(item.reflectStatus == 4?"未打款":"已打款")}}
- </view>
- </view>
- <u-loadmore :status="tabItem.loadingType" v-if="!(tabItem.loaded && tabItem.list.length == 0)"/>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- height: '',
- tabCurrentIndex: 0,
- navlist: [{
- status: 1,
- title: '未审核',
- list: [],
- page: 1,
- pageSize: 10,
- loaded: false,
- loadingType: 'loadmore'
- },
- {
- status: 2,
- title: '已审核',
- list: [],
- page: 1,
- pageSize: 10,
- loaded: false,
- loadingType: 'loadmore'
- }
- ]
- }
- },
- onLoad(opt) {
- },
- onShow() {
- this.getData()
- },
- onReachBottom() {
- // this.getData()
- },
- onReady() {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- _this.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- methods: {
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- this.getData('tab')
- },
- getData(type) {
- let that = this
- let item = that.navlist[that.tabCurrentIndex]
- if(type == 'tab') {
- item.loadingType = 'loadmore'
- item.list = []
- item.page = 1
- item.loaded = false
- }
- if (item.loadingType == 'nomore' || item.loadingType == 'loading') {
- return
- }
- item.loadingType = 'loading'
- that.$u.api.ygTxList({
- page: item.page,
- pageSize: item.pageSize,
- auditStatus: item.status
- }).then(res => {
- item.list = item.list.concat(res.data)
- item.page++
- if (item.limit == res.data.length) {
- item.loadingType = 'loadmore'
- } else {
- item.loadingType = 'nomore'
- }
- item.loaded = true
- })
- }
- }
- }
- </script>
- <style lang="scss">
- // .order-item {
- // height: 207rpx;
- // width: 100%;
- // background-color: #fff;
- // padding: 30rpx 30rpx;
- // line-height: 1.5;
- // display: flex;
- // align-items: center;
- // border-bottom: 1rpx solid #F0F0F0;
- // .logo {
- // flex-shrink: 0;
- // margin-right: 20rpx;
- // width: 147rpx;
- // height: 147rpx;
- // border-radius: 20rpx;
- // background-color: #eee;
- // }
- // .title-box {
- // height: 100%;
- // flex-grow: 1;
- // padding-right: 50rpx;
- // display: flex;
- // flex-direction: column;
- // justify-content: space-between;
- // align-items: flex-start;
- // .title {
- // font-size: 30rpx;
- // color: #333333;
- // }
- // .time {
- // font-size: 36rpx;
- // font-weight: bold;
- // color: #E02020;
- // &::before {
- // content: '¥';
- // font-size: 24rpx;
- // }
- // }
- // }
- // .money {
- // flex-shrink: 0;
- // padding: 8rpx 12rpx;
- // background: #FEE1D7;
- // border-radius: 5px;
- // color: #fd5b23;
- // font-size: 26rpx;
- // text-align: right;
- // display: flex;
- // align-items: center;
- // justify-content: flex-end;
- // image {
- // width: 10rpx;
- // height: 20rpx;
- // margin-left: 15rpx;
- // }
- // .status {
- // color: #AEAEAE;
- // }
- // }
- // }
- .swiper-box {
- background-color: #fff;
- .order-item:last-child {
- margin-bottom: 60rpx;
- }
-
- .order-item {
- width: 100%;
- // background-color: red;
- padding: 20rpx 30rpx;
- line-height: 1.5;
- display: flex;
- align-items: center;
-
- .title-box {
- flex-grow: 1;
- padding-right: 50rpx;
-
- .title {
- font-size: 30rpx;
- color: #333333;
- }
-
- .time {
- font-size: 26rpx;
- color: #AEAEAE;
- }
- }
-
- .money {
- color: #fd5b23;
- font-size: 26rpx;
- text-align: right;
-
- .status {
- color: #AEAEAE;
- }
- }
- }
- }
- .navbar {
- // margin-top: 20rpx;
- display: flex;
- height: 88rpx;
- padding: 0 5px;
- background: #fff;
- box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
- position: relative;
- z-index: 10;
- .nav-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 15px;
- color: #999999;
- position: relative;
- &.current {
- color: #000;
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 44px;
- height: 0;
- border-bottom: 2px solid #fe5b38;
- }
- }
- }
- }
- </style>
|