| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <template>
- <view class="sharerevenue">
- <view class="top-jg"></view>
- <view class="nav-wrapper">邀请算力收益 3%</view>
- <view class="all-num">
- <view class="">
- <view class="title">总收益</view>
- <view class="num">{{ allIncome }}FIL</view>
- </view>
- <view class="">
- <view class="title">累计释放</view>
- <view class="num">{{ ljIncome }}FIL</view>
- </view>
- <view class="">
- <view class="title">待释放</view>
- <view class="num">{{ wait }}FIL</view>
- </view>
- </view>
- <view class="tip">
- <view class="line"></view>
- <view class="title">每日收益记录</view>
- <view class="line"></view>
- </view>
- <scroll-view :style="{ height: height }" class="days" scroll-y>
- <empty v-if="navList[currentIndex].loaded === true && navList[currentIndex].list.length === 0"></empty>
- <view class="day-item" v-for="(item,index) in navList[currentIndex].list" :key="index">
- <view class="item-time">2021-05-02</view>
- <view class="item-wrap">
- <view class="item">
- <view class="item-title">
- 今日可用
- <text>25%</text>
- </view>
- <view class="item-value">0.09FIL</view>
- </view>
- <view class="item">
- <view class="item-title">
- 今日冻结
- <text>25%</text>
- </view>
- <view class="item-value">0.09FIL</view>
- </view>
- <view class="item">
- <view class="item-title">
- 今日释放
- <text>1/150</text>
- </view>
- <view class="item-value">0.09FIL</view>
- </view>
- </view>
- <uni-load-more :status="tabItem.loadingType"></uni-load-more>
- </view>
-
- </scroll-view>
- </view>
- </template>
- <script>
- import empty from '@/components/empty';
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- export default {
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- navList: [
- {
- title: 'Fil',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more'
- },
- // {
- // title: 'Chia',
- // list: [],
- // page: 1,
- // limit: 10,
- // loadingType: 'more'
- // },
- // {
- // title: 'Bzz',
- // list: [],
- // page: 1,
- // limit: 10,
- // loadingType: 'more'
- // }
- ],
- currentIndex: 0,
- height: 0,
- allIncome: 0, //总收益
- ljIncome: 0, //累计收益
- wait: 0 //待释放
- };
- },
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.days').boundingClientRect();
- query.exec(function(res) {
- console.log(res, 'ddddddddddddd');
- _this.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- onLoad() {
- this.loadData();
- },
- methods: {
- //切换币种
- navClick(index) {
- this.currentIndex = index;
- this.loadData('tabChange');
- },
- loadData(source) {
- //这里是将list挂载到nav列表下
- let index = this.currentIndex;
- let navItem = this.navList[index];
- // let state = navItem.state;
- if (source === 'tabChange' && navItem.loaded === true) {
- //tab切换只有第一次需要加载数据
- return;
- }
- if (navItem.loadingType === 'loading') {
- //防止重复加载
- return;
- }
- if (navItem.loadingType === 'noMore') {
- //防止重复加载
- return;
- }
- // 修改当前对象状态为加载中
- navItem.loadingType = 'loading';
- // orderList({
- // type: state,
- // page: navItem.page,
- // limit: navItem.limit
- // })
- // .then(({ data }) => {
- // let arr = data.map(e => {
- // return e;
- // });
- // navItem.list = navItem.list.concat(arr);
- // // console.log(navItem.orderList);
- // navItem.page++;
- // if (navItem.limit == data.length) {
- // //判断是否还有数据, 有改为 more, 没有改为noMore
- // navItem.loadingType = 'more';
- // return;
- // } else {
- // //判断是否还有数据, 有改为 more, 没有改为noMore
- // navItem.loadingType = 'noMore';
- // }
- // this.$set(navItem, 'loaded', true);
- // })
- // .catch(e => {
- // console.log(e);
- // });
- let arr = []
- navItem.list = navItem.list.concat(arr)
- navItem.page++
- navItem.loadingType = 'noMore'
- this.$set(navItem, 'loaded', true)
- console.log(this.navList)
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- page {
- width: 100%;
- }
- .top-jg {
- height: 55rpx;
- }
- .nav-wrapper {
- margin: 0rpx auto 61rpx;
- width: 627rpx;
- height: 60rpx;
- line-height: 60rpx;
- // border: 2px solid #5771df;
- border-radius: 5rpx;
- text-align: center;
- background-color: #5771df;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- }
- .all-num {
- width: 627rpx;
- margin: 0 auto;
- display: flex;
- justify-content: space-between;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- view {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .title {
- padding-bottom: 20rpx;
- }
- .num {
- font-weight: 500;
- }
- }
- }
- .tip {
- width: 627rpx;
- margin: 80rpx auto 70rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .line {
- width: 193rpx;
- height: 2rpx;
- background: #5771df;
- }
- .title {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #5771df;
- }
- }
- .days {
- // background-color: red;
- padding: 0 65rpx;
- .day-item {
- height: 198rpx;
- border-bottom: 1px solid #f3f4f6;
- background-color: #fff;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- padding: 20rpx 0;
- .item {
- display: flex;
- justify-content: space-between;
- text {
- display: inline-block;
- margin-left: 10rpx;
- }
- }
- .item-time {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- padding-bottom: 20rpx;
- }
- .item-wrap {
- display: flex;
- justify-content: space-between;
- .item {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- align-items: center;
- .item-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- line-height: 1;
- padding-bottom: 23rpx;
- }
- .item-value {
- line-height: 1;
- font-size: 29rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fb3a2f;
- }
- }
- }
- }
- }
- </style>
|