123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <template>
- <view class="sharerevenue">
- <view class="top-jg"></view>
- <view class="nav-wrapper">
- <view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ active: currentIndex === index }" @click="navClick(index)">{{ item.title }}</view>
- </view>
- <!-- <view class="top-jg"></view> -->
- <!-- <view class="nav-wrapper">邀请算力收益</view> -->
- <!-- <view class="all-num">
- <view class="">
- <view class="title">总收益</view>
- <view class="num">{{ allIncome }}{{ navList[currentIndex].unit }}</view>
- </view>
- <view class="">
- <view class="title">累计释放</view>
- <view class="num">{{ ljIncome }}{{ navList[currentIndex].unit }}</view>
- </view>
- <view class="">
- <view class="title">待释放</view>
- <view class="num">{{ wait }}{{ navList[currentIndex].unit }}</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">{{item.add_time}}</view>
- <view class="">
- 今日推荐奖励:{{item.number}}{{item.category}}
- </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';
- import { mining, miningIndex, myMiningGet ,getMyShare} from '@/api/calculation.js';
- import { moneyLog, recharge } from '@/api/finance.js';
- export default {
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- navList: [
- {
- title: 'Fil',
- unit: 'FIL',
- slUnit: 'T',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more'
- },
- {
- title: 'Chia',
- unit: 'XCH',
- slUnit: 'T',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more'
- },
- {
- title: 'Bzz',
- unit: 'BZZ',
- slUnit: '节点',
- 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();
- // this.getIndexDate()
- },
- methods: {
- //切换币种
- navClick(index) {
- this.currentIndex = index;
- this.loadData('tabChange');
- },
- loadData(source) {
- console.log('loadnoe');
- //这里是将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';
- moneyLog(
- {
- page: navItem.page,
- limit: navItem.limit,
- type: 'group_create_brokerage'
- },
- navItem.unit
- ).then(({ data }) => {
- // obj.typeList = data.type_list;
- // obj.list = data.list;
- // console.log(obj.list);
- console.log(data,'5555555555555555')
- let arr = data.list.map(e => {
- return e;
- });
- console.log(arr)
- navItem.list = navItem.list.concat(arr);
- navItem.page++;
- if (navItem.limit == data.list.data.length) {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- navItem.loadingType = 'more';
- console.log('more');
- return;
- } else {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- navItem.loadingType = 'noMore';
- console.log('noMore');
- }
- this.$set(navItem, 'loaded', true);
- }).catch(e => {
- console.log(e);
- });
- // myMiningGet({
- // type: navItem.unit,
- // page: navItem.page,
- // limit: navItem.limit
- // })
- // .then(({ data }) => {
- // console.log(data, '888888888888888888888');
- // this.all_lock = data.all_lock;
- // this.all_get = data.all_get;
- // let arr = data.list.data.map(e => {
- // return e;
- // });
- // navItem.list = navItem.list.concat(arr);
- // console.log(arr);
- // navItem.page++;
- // if (navItem.limit == data.list.data.length) {
- // //判断是否还有数据, 有改为 more, 没有改为noMore
- // navItem.loadingType = 'more';
- // console.log('more');
- // return;
- // } else {
- // //判断是否还有数据, 有改为 more, 没有改为noMore
- // navItem.loadingType = 'noMore';
- // console.log('noMore');
- // }
- // this.$set(navItem, 'loaded', true);
- // })
- // .catch(e => {
- // console.log(e);
- // });
- },
- // getIndexDate() {
- // moneyLog(
- // {
- // page: 1,
- // limit: 100,
- // type: 'group_create_brokerage'
- // },
- // unit
- // ).then(({ data }) => {
- // // obj.typeList = data.type_list;
- // // obj.list = data.list;
- // // console.log(obj.list);
- // console.log(data,'5555555555555555')
- // });
- // }
- }
- };
- </script>
- <style lang="scss" scoped>
- page {
- width: 100%;
- }
- .top-jg {
- height: 55rpx;
- }
- .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;
- }
- }
- }
- }
- }
- .nav-wrapper {
- margin: 0rpx auto 10rpx;
- width: 627rpx;
- height: 60rpx;
- border: 2px solid #5771df;
- border-radius: 5rpx;
- display: flex;
- .nav-item {
- width: 209rpx;
- text-align: center;
- line-height: 60rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #5771df;
- }
- .active {
- background: #5771df;
- color: #fff;
- }
- }
- </style>
|