1
jhzh
2025-06-16 1760942f9204e56032ca93ff1b720bbf966dd495
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
<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>