<template>
|
<v-page>
|
<v-header :title="$t('common.c6')" >
|
<template #right>
|
<v-link to="/pages/mining/myMining" class="d-flex align-center">
|
{{$t('common.c16')}}
|
</v-link>
|
</template>
|
</v-header>
|
<!-- <v-header class="nav_bar m-y-xs" :left-text="$t('base.a1')" :title="$t('common.c6')" :left-arrow="false">
|
<template #right>
|
<v-link to="/pages/mining/myMining" class="d-flex align-center">
|
{{$t('common.c16')}}
|
</v-link>
|
</template>
|
</v-header> -->
|
|
<view class="layout-main">
|
<scroll-view
|
@refresherrefresh="onRefresh"
|
:refresher-enabled="refresherEnabled&&scrollTop<50"
|
:refresher-triggered="refreshing"
|
refresher-background="transparent"
|
:refresher-threshold="50"
|
>
|
<view class="head_info m-y-md ">
|
<view class="w-12/12 m-t-xs">
|
<view class="fn-center w-max">
|
<view
|
@click="urls(item.id)"
|
class="m-b-md m-x-md rounded-xs bg-panel-3 box-shadow link-active d-flex justify-between align-center p-x-md p-y-xs box-size p-x-xs"
|
v-for="(item,index) in list"
|
:key="index"
|
>
|
<view class="fn-left w-5/12">
|
<view class="d-flex align-center">
|
<text class="fn-bold fn-14 color-light">{{ item.kj_name }}</text>
|
<!-- <text class="color-default fn-12 m-l-xs">{{ $t("first.b8") }}</text> -->
|
</view>
|
<view class="d-flex align-center fn-12 m-t-xs">
|
{{ $t("common.c7") }} :{{ item.annualized_rate}}%
|
</view>
|
<view class="d-flex align-center fn-12 m-t-xs">
|
{{ $t("common.c8") }} :{{ item.cycle}} {{ $t("common.c9")}}
|
</view>
|
</view>
|
<view class="fn-left align-end w-4/12">
|
<view class="d-flex align-end fn-12">{{$t('common.c12')}}</view>
|
<view class="m-t-xs">
|
{{ omitTo(item.amount,2) }}{{item.coin_name}}
|
</view>
|
</view>
|
<view class="fn-right w-3/12 positions">
|
<view class="charts-box m-t-xs">
|
<van-button size="small" type="primary">{{$t("common.c21")}}</van-button>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</scroll-view>
|
</view>
|
</v-page>
|
</template>
|
<script>
|
import { mapState, mapActions } from "vuex";
|
import math from "@/utils/class/math.js";
|
import Mining from "@/api/mining.js";
|
import Wallet from "@/api/wallet";
|
export default {
|
name: "mining",
|
data() {
|
return {
|
list: [],
|
scrollTop:0,
|
refreshing:false,
|
active: 0,
|
};
|
},
|
|
props: {
|
refresherEnabled:{
|
default:true,
|
required:false,
|
type:Boolean
|
},
|
},
|
watch: {
|
|
},
|
methods: {
|
onRefresh(){
|
if (this.refreshing) return;
|
this.refreshing = true;
|
this.upDateData(),
|
setTimeout(() => {
|
this.refreshing = false;
|
}, 1000)
|
},
|
scroll(event){
|
this.scrollTop = event.detail.scrollTop
|
},
|
|
// 获取矿机列表
|
upDateData() {
|
Mining.getMarketList().then((res) => {
|
this.list = res.data;
|
});
|
},
|
urls(id){
|
uni.setStorageSync('k_id',id)
|
uni.navigateTo({
|
url:'/pages/mining/index'
|
})
|
},
|
omitTo:math.omitTo,
|
},
|
mounted() {
|
|
},
|
created() {
|
this.upDateData();
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.tabs-main {
|
::v-deep.van-tabs {
|
width: 100%;
|
}
|
::v-deep.van-tabs__wrap,
|
::v-deep.van-tabs__content {
|
// width: 100%;
|
}
|
::v-deep.van-tabs__content {
|
flex: 1;
|
overflow: hidden;
|
}
|
::v-deep.van-pull-refresh {
|
height: calc(100vh - 200px);
|
overflow-y: auto;
|
}
|
::v-deep.van-cell {
|
background: transparent;
|
&::after {
|
border-width: 0;
|
}
|
}
|
::v-deep .van-cell__left-icon {
|
color: $white;
|
}
|
}
|
.bgb3 {
|
background: url(../../static/img/bgb3.png) no-repeat;
|
background-size: 100% auto;
|
background-position: right bottom;
|
&.bgb3-white {
|
background-image: url(../../static/img/light/bgb3.png);
|
}
|
}
|
.bgb4 {
|
background: url(../../static/img/bgb4.png) no-repeat;
|
background-size: 100% auto;
|
background-position: right bottom;
|
}
|
.pos {
|
position: relative;
|
}
|
.posa {
|
position: absolute;
|
}
|
.rounded-ms{
|
border-radius: 10px;
|
}
|
.p-y-xxs{
|
padding: 5px 0;
|
}
|
.w-33{
|
width: 30%;
|
}
|
.w-50{
|
width: 50%;
|
}
|
.wallet{
|
border-radius: 30px;
|
}
|
.text-none{
|
text-decoration: none;
|
}
|
::v-deep .van-cell{
|
background-color: $panel-3;
|
}
|
::v-deep .van-cell{
|
background-color:transparent;
|
padding: 0 10px;
|
}
|
</style>
|