123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <template>
- <view class="container" style="padding-top: 100rpx;">
- <topView :backg="'#1A1A17'"></topView>
- <view class="infoBox">
- <view class="navBack" @click="navTo">
- <u-icon name="arrow-left" size="25" color="#fff" style="position: absolute;left: 0;top: 0;font-weight: bold;"></u-icon>
- <view class="title">{{$t("detailsTpl.我的矿机")}}</view>
- </view>
- <view class="infoItem" v-for="item,index in myLists" :key="index" v-if="item.status == 1">
- <view class="itemInfo">
- <view class="itemName">{{$t("detailsTpl.当前矿机")}}</view>
- <view class="flex infos">
- <view class="infoTip flex_item">
- <image :src="'https://www.bscnice.com'+item.machine.image" style="width: 130rpx;height:130rpx;border: 2rpx solid #8D7049;
- border-radius: 25rpx;"></image>
- <view class="nameBox">
- <view class="nameTip">{{item.machine.name}}</view>
- <view class="price">{{$t("details.价格")}}:<text class="priTip">{{item.machine.price * 1}}NUSD</text></view>
- </view>
- </view>
- <view class="statusBox flex_item">
- <view class="status">{{$t("detailsTpl.工作中")}}</view>
- <view class="statusTip"></view>
- </view>
- </view>
- </view>
- <view class="flex numBox">
- <view class="numTpl">
- <view class="num">{{info.sent * 1}}</view>
- <view class="name">{{$t("detailsTpl.已释放")}}</view>
- </view>
- <view class="partition"></view>
- <view class="numTpl">
- <view class="num">{{info.wait}}</view>
- <view class="name">{{$t("detailsTpl.待释放")}}</view>
- </view>
- </view>
- </view>
- <view class="noDate" v-if="myLists.length == 0">{{$t("detailsTpl.暂无工作中的矿机列表")}}</view>
- <view class="navList flex">
- <view class="navItem" v-for="item,index in navList" :key="index" @click="clickTab(index)">
- <view class="navName" :class="{ active: currTab == index }">{{item}}</view>
- <image v-if="currTab == index" src="/static/img/img28.png" class="navTip"></image>
- </view>
- </view>
- <view class="listBox" v-if="list.length > 0">
- <view class="listTpl flex" v-for="item,index in list" :key="index">
- <view class="tpl">
- <view class="addr">{{currTab == 0?typeList[item.type]:item.machine.name}}</view>
- <view class="time">{{item.createtime }}</view>
- </view>
- <view class="num add" v-if="currTab == 0">+{{item.money * 1}}</view>
- <view class="num" v-if="currTab == 1">-{{item.machine.price * 1}}</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import topView from '../components/topView.vue';
- import { myList,getTokenLog} from '@/api/index.js';
- import{ getTime } from '@/utils/rocessor.js';
- export default {
- components: {
- topView
- },
- data () {
- return {
- myLists:[],//我的矿机列表
- list:[],
- navList:[this.$t("detailsTpl.释放记录"),this.$t("detailsTpl.购买记录")],
- currTab:0,
- info:'',
- typeList:''
- }
- },
- onShow () {
- this.loadData();
- this.getLog()
- },
- methods: {
- clickTab(index){
- this.currTab = index
- this.list = []
- if(index == 0){
- this.getLog()
- }else{
- this.loadData()
- }
- },
- loadData () {
- let obj = this
- myList({}).then(function(res){
- res.data.list.forEach(item => {
- item.createtime = getTime(item.createtime)
- })
- obj.myLists = res.data.list
- obj.info = res.data
- if(obj.currTab == 1){
- obj.list = res.data.list
- }
- })
- },
- getLog(){
- let obj = this
- getTokenLog({
- page:1,
- limit:100000,
- token:'NICE',
- pm:'',
- type:'day_mining'
- }).then(function(res){
- res.data.list.forEach(item => {
- item.createtime = getTime(item.createtime)
- })
- obj.list = res.data.list
- obj.typeList = res.data.type
- })
- },
- change(currentPage,type) {
- this.page.currentPage = currentPage;
- this.loadData()
- },
- navTo(){
- uni.navigateBack({
- delta: 1
- });
- },
- },
- }
- </script>
- <style lang="scss">
- page {
- width: 100%;
- min-height: 100vh;
- .container {
- width: 100%;
- min-height: 100vh;
- padding-bottom: 25rpx;
- }
- }
- .noDate{
- text-align: center;
- padding-top: 25rpx;
- opacity: 0.3;
- }
- .infoBox{
- padding: 0rpx 25rpx;
- color: #fff;
- .infoItem{
- margin-bottom: 25rpx;
- background: #1A1A17;
- padding: 35rpx 0rpx;
- border-radius: 20rpx;
- .numBox{
- padding-top: 25rpx;
- .numTpl{
- width: 45%;
- text-align: center;
- .name{
- font-weight: 500;
- font-size: 26rpx;
- color: #FFFFFF;
- padding-top: 10rpx;
- }
- .num{
- font-weight: bold;
- font-size: 34rpx;
- color: #FFFFFF;
- }
- }
- .partition{
- width: 2rpx;
- height: 119rpx;
- background: linear-gradient(0deg, rgba(255,255,255,0), #FFFFFF, rgba(255,255,255,0));
- }
- }
- }
- }
- .itemInfo{
- padding: 0rpx 25rpx;
- .itemName{
- font-weight: bold;
- font-size: 27rpx;
- padding-bottom: 20rpx;
- }
- .infos{
- border-bottom: 1rpx solid rgba(221, 225, 235, 0.2);
- padding-bottom: 25rpx;
- .infoTip{
- align-items: flex-start;
- .nameBox{
- padding-left: 25rpx;
- .nameTip{
- font-weight: bold;
- font-size: 32rpx;
- color: #FFFFFF;
- }
- .price{
- font-weight: 500;
- font-size: 24rpx;
- color: #999999;
- padding-top: 30rpx;
- .priTip{
- font-weight: 500;
- font-size: 26rpx;
- color: #999999;
- line-height: 44rpx;
- background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- }
- }
- }
- .statusBox{
- .status{
- font-weight: bold;
- font-size: 32rpx;
- color: #999999;
- background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- .statusTip{
- margin-left: 15rpx;
- width: 15rpx;
- height: 15rpx;
- background: linear-gradient(137deg, #FFF0CF, #CBA16B, #FCE9CF, #C29963);
- border-radius: 50%;
- }
- }
-
- }
- }
- .listBox{
- margin-top: 25rpx;
- background: #1A1A17;
- padding: 0rpx 25rpx;
- border: 4rpx solid #D7B381;
- border-radius: 30rpx;
- .listTpl{
- padding: 30rpx 0rpx;
- border-bottom: 1rpx solid rgba(240, 240, 240, 0.3);
- .tpl{
- .addr{
-
- }
- .time{
- font-weight: 500;
- font-size: 22rpx;
- padding-top: 15rpx;
- color: #999999;
- }
- }
- .num{
- font-weight: 400;
- font-size: 36rpx;
- color: #fff;
- }
- .add{
- color: #4C5D97;
- background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- }
- .listTpl:last-child{
- border-bottom: none !important;
- }
- }
- .navList{
- padding: 43rpx 120rpx;
- .navItem{
- width: 120rpx;
- position: relative;
- .navName{
- font-weight: bold;
- font-size: 29rpx;
- color: #FFFFFF;
- }
- .active{
- font-weight: bold;
- font-size: 29rpx;
- color: #FFFFFF;
- background: linear-gradient(258deg, #FFF0CF 0%, #CBA16B 30.0048828125%, #FCE9CF 67.67578125%, #C29963 100%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- .navTip{
- position: absolute;
- top: 45rpx;
- left: 35rpx;
- width: 45rpx;
- height: 11rpx;
- }
- }
- }
- .navBack{
- position: relative;
- color: #fff;
- text-align: center;
- margin: 30rpx 0rpx 40rpx 0rpx;
- .title{
- font-weight: bold;
- font-size: 34rpx;
- }
- }
- </style>
|