dcc
2024-06-13 24e2c4a6983d3ed1c67080b460f7e28f5e2e55f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<template>
  <div id="miningMachineHome">
    <div class="miningMachineHome">
      <assets-head :title="$t('矿机')" :showLeft="true" :goHome="goHome"></assets-head>
 
      <div class="box-border px-8 mt-10">
        <div class="flex justify-between text-grey relative">
          <div class="flex flex-col">
            <span class="text-grey text-30">{{ $t('托管金额') }}({{ minglist.buyCurrency
              ? minglist.buyCurrency.toUpperCase() : 'USDT' }})</span>
            <span class="text-66 mt-55 font-bold textColor">{{ minglist.amount_sum }}</span>
          </div>
        </div>
        <div class="flex mt-11 justify-between text-26 mb-9">
          <div class="flex flex-col ">
            <div class="text-grey text-26">{{ $t('预计日收益')
            }}({{ minglist.outputCurrency ? minglist.outputCurrency.toUpperCase() : 'USDT' }})</div>
            <div class="mt-4 mb-2 text-36 textColor">{{ minglist.today_profit }}</div>
          </div>
          <div class="flex flex-col">
            <div class="text-grey text-26">{{ $t('累计收益')
            }}({{ minglist.outputCurrency ? minglist.outputCurrency.toUpperCase() : 'USDT' }})</div>
            <div class="mt-4 mb-2 text-36 textColor">{{ minglist.aready_profit }}</div>
          </div>
          <div class="flex flex-col">
            <div class="text-grey text-26">{{ $t('托管订单') }}</div>
            <div class="mt-4 mb-2 text-36 textColor">{{ minglist.order_sum }}</div>
          </div>
        </div>
      </div>
      <div class="flex justify-between box-border px-8 mt-11">
        <div @click="$router.push('/cryptos/funds?tab=3&index=1')"
          class="greyBg textColor w-96 py-3 rounded-md text-28 text-center mr-5 active activeBKClick">{{ $t('托管订单') }}
        </div>
        <div @click="$router.push('/cryptos/machine-rule')"
          class="greyBg text-grey w-96 py-3 rounded-md text-28 text-center activeClick">{{ $t('规则') }}</div>
      </div>
      <div class="px-8 mt-10 pb-20">
        <div v-for="(item, index) in list" :key="index"
          class="card flex justify-between items-center relative rounded-md borderColor financialBackground">
          <div class="title absolute px-4 py-2 text-26 text-white top-0 left-22"
            :class="item.on_sale === '0' ? 'inactive' : 'bg-green'">
            <!-- {{item.on_sale==='0'?$t('已锁定,联系客服'):$t('日收益率')}}{{item.on_sale==='0'?null:item.daily_rate}}{{item.on_sale==='0'?null:index===0?'':'%'}} -->
            {{ item.on_sale === '0' ? $t('已锁定,联系客服') : (item.test === 'Y' ? item.cycle + $t('天') + $t('预期收益') + ' ' +
              item.all_rate
              +
              'USDT' : $t('30天预期收益') + ' ' + item.all_rate + '%') }}
          </div>
          <div class="flex justify-start items-center flex-1" @click="click_buy(item, index)">
            <img v-if="index === 0" class="w-32 h-32 mr-4" src="./images/machine1.png" alt="">
            <img v-else-if="index === 1" class="w-32 h-32 mr-4" src="./images/machine_asic.png" alt="">
            <img v-else-if="index === 2" class="w-32 h-32 mr-4" src="./images/machine_ex.png" alt="">
            <img v-else-if="index === 3" class="w-32 h-32 mr-4" src="./images/machine_fpga.png" alt="">
            <img v-else-if="index === 4" class="w-32 h-32 mr-4" src="./images/machine_ipfs.png" alt="">
            <img v-else-if="index === 5" class="w-32 h-32 mr-4" src="./images/machine_gpu.png" alt="">
            <img v-else-if="index === 6" class="w-32 h-32 mr-4" src="./images/machine_ck6.png" alt="">
            <img v-else class="w-32 h-32 mr-4" src="./images/machine_ex.png" alt="">
            <div class="flex flex-col items-start">
              <span class="text-36 font-semibold textColor" style="max-width:200px;">
                <template v-if="$i18n.locale === 'CN'">
                  {{ item.name_cn }}
                </template>
                <template v-else-if="$i18n.locale === 'zh-CN'">
                  {{ item.name }}
                </template>
                <template v-else>
                  {{ item.name_en }}
                </template>
              </span>
              <!-- <span class="text-26 mt-6 mb-4 textColor">{{item.on_sale==='0'?$t('已锁定,联系客服'):$t('日收益率')}}{{' '}}{{item.on_sale==='0'?null:item.daily_rate}}{{item.on_sale==='0'?null:index===0?'':'%'}}</span> -->
              <span class="text-26 mt-6 mb-4 textColor">{{ $t('日收益率') }}{{ item.daily_rate }}{{ item.test === 'Y' ?
                'USDT'
                : '%'
              }}</span>
              <span class="text-26 mb-4 textColor">{{ $t('限额') }} {{ item.investment_min + '-' }}{{ item.investment_max
              }}
                {{ item.buy_currency ? item.buy_currency.toUpperCase() : '--' }}</span>
              <span class="text-26 textColor">{{ $t('周期') }} {{ item.cycle == 0 ? $t('无限期') : item.cycle + $t('天')
              }}</span>
            </div>
          </div>
          <div @click="item.on_sale === '0' ? null : $router.push({
            path: '/cryptos/machine-buy',
            query: { obj: JSON.stringify(item) }
          })" class="py-4 w-44 text-28 font-semibold text-center rounded-md"
            :class="item.on_sale === '0' ? 'inactive activeDisableClick' : 'active activeBKClick'">{{
              item.on_sale === '0' ? $t('已锁定') : item.test ? $t('立即体验') : $t('立即租用') }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import assetsHead from '@/components/Transform/assets-head/index.vue';
import { getMachineList } from "@/service/financialManagement.api.js";
import { getMiningRevenueStatisticsList } from "@/service/financialManagement.api.js";
export default {
  name: "fundHome",
  components: {
    assetsHead,
  },
  data() {
    return {
      goHome: false,
      minglist: {},
      list: []
    }
  },
  methods: {
    click_share() {
      this.$router.push('/promote');
    },
    click_buy(item, index) {
      item['mine_index'] = index
      this.$router.push({
        path: '/cryptos/pool-lock',
        //query: item
        query: { obj: JSON.stringify(item) }
      })
    }
  },
  activated() {
    getMachineList().then(res => {
      //console.log('矿机列表', res)
      this.list = res
      //console.log(this.list)
    })
    getMiningRevenueStatisticsList(
      this.$store.state.user.userInfo.token
    ).then(res => {
      //console.log('矿机收益', res)
      this.minglist = res
    })
  },
  created() {
    console.log(this.$i18n.locale)
    getMachineList().then(res => {
      //console.log('矿机列表',res)
      this.list = res
    })
    getMiningRevenueStatisticsList(
      this.$store.state.user.userInfo.token
    ).then(res => {
      //console.log('矿机收益',res)
      this.minglist = res
    })
  }
}
</script>
 
<style lang="scss" scoped>
#miningMachineHome {
  .activeBKClick {
    &:active {
 
      background: $btn_main;
      border-color: $btn_main;
 
      opacity: 0.5;
    }
  }
 
  .activeClick {
    &:active {
      background: $grey_bg;
      opacity: 0.6;
    }
  }
 
  .activeDisableClick {
    &:active {
      background: $grey_bg;
      opacity: 0.5;
    }
  }
 
  .miningMachineHome {
    width: 100%;
    box-sizing: border-box;
  }
 
  .active {
    color: $white;
 
    background: $btn_main;
    border-color: $btn_main;
  }
 
  .inactive {
    color: $text_color;
    background: $grey_bg;
    border-color: $grey_bg;
  }
 
  .title {
    border-radius: 0 0 8px 8px;
  }
 
  .card {
    padding: 80px 22px 22px 22px;
    margin-bottom: 32px;
  }
}
</style>