123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <view class="earning-box">
- <en-list ref="earningObj" @getList="getList">
- <template v-slot:listInfo="{pagingData}">
- <view class="earning-list">
- <view v-for="item in pagingData" class="item">
- <view class="list-item">
- <view class="item-line">
- <view class="item-text">BNB</view>
- </view>
- <view class="item-line line-text">
- <view class="item-text">{{$t('index.index.list.item.title')}}</view>
- </view>
- <view class="item-line" v-if="item.hash">
- <view class="item-text">Hash</view>
- <view class="item-text text-hash" @click="goToUrl(item.hash)">
- {{item.hash}}
- </view>
- </view>
- <view class="item-line" v-if="item.nbn_money>0">
- <view class="item-text">BNB Number</view>
- <view class="item-text text-two">
- <view class="text-img">
- <image src="@/static/img/index/bnb2.png"></image>
- </view>
- <view class="text">{{(item.nbn_money).toFixed(6)*1}}</view>
- </view>
- </view>
- <view class="item-line" v-if="item.db_money>0">
- <view class="item-text">{{$t('index.index.list.item.integral')}}</view>
- <view class="item-text text-two">
- <view class="text-img">
- <image src="@/static/img/index/jf.svg"></image>
- </view>
- <view class="text">{{(item.db_money).toFixed(6)*1}}</view>
- </view>
- </view>
- <view class="item-line">
- <view class="item-text">{{$t('index.index.list.item.service')}}</view>
- <view class="item-text">{{(item.service_money).toFixed(6)*1}}</view>
- </view>
- <view class="item-line">
- <view class="item-text">{{$t('index.index.list.item.date')}}</view>
- <view class="item-text">{{item.created_at}}</view>
- </view>
- </view>
- <division class="division-item"></division>
- </view>
- </view>
- </template>
- </en-list>
- </view>
- </template>
- <script>
- import EnList from "@/components/en-list/en-list";
- import {getEarnings} from "@/api/contract";
- import Division from "@/pages/index/components/division";
- export default {
- name: "earning-list",
- components: {Division, EnList},
- props: {},
- data() {
- return {}
- },
- watch: {},
- mounted() {
- },
- methods: {
- goToUrl(tx){
- window.location.href='https://bscscan.com/tx/'+tx
- },
- getList(page) {
- let token=uni.getStorageSync('token')
- if(token){
- getEarnings({'page': page}).then((res) => {
- if (res.code === 1) {
- this.$refs.earningObj.setList(res.data.items, res.data.total)
- this.$emit('setTotal',res.data.total)
- }
- })
- }else {
- this.$refs.earningObj.setList([], 0)
- this.$emit('setTotal',0)
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .earning-box {
- .earning-list {
- .list-item {
- margin-top: 20rpx;
- .item-line {
- margin-bottom: 20rpx;
- display: flex;
- justify-content: space-between;
- .item-text {
- font-size: 26rpx;
- color: rgb(177, 177, 177);
- line-height: 42rpx;
- height: 42rpx;
- }
- .text-hash{
- max-width: 200rpx;
- overflow-x:hidden;
- text-overflow: ellipsis;
- }
- .text-two {
- display: flex;
- justify-content: right;
- .text-img {
- display: inline-block;
- padding: 6rpx;
- background: rgb(0, 87, 255);
- border-radius: 50%;
- height: 42rpx;
- width: 42rpx;
- box-sizing: border-box;
- image {
- width: 30rpx;
- height: 30rpx;
- z-index: 100;
- }
- }
- .text {
- margin-left: 10rpx;
- font-size: 30rpx;
- }
- }
- }
- .line-text {
- margin-bottom: 40rpx;
- .item-text {
- font-weight: bold;
- font-size: 26rpx;
- color: #222;
- }
- }
- }
- .item:last-child {
- .division-item {
- display: none;
- }
- }
- }
- }
- </style>
|