|
@@ -11,8 +11,8 @@
|
|
|
<view class="cell-tip">{{ls.machine.first_step_time + ls.machine.second_step_time + ls.machine.third_step_time}}天矿机</view>
|
|
|
<view class="flex cell-tpl">
|
|
|
<view class="tpl">
|
|
|
- <view class="">单价</view>
|
|
|
- <view class="">{{ls.machine.cost_money}}</view>
|
|
|
+ <view class="">单价(T)</view>
|
|
|
+ <view class="">{{ls.machine.cost_money * 1}} {{ls.machine.cost_money_type}}</view>
|
|
|
</view>
|
|
|
<view class="tpl">
|
|
|
<view class="">有效算力</view>
|
|
@@ -29,8 +29,15 @@
|
|
|
<view class="cell-info flex">
|
|
|
<view class="tip">购买时间:{{ls._pay_time}}</view>
|
|
|
</view>
|
|
|
- <view class="cell-info flex">
|
|
|
- <view class="tip">倒计时:</view>
|
|
|
+ <view class="cell-info flex" v-if="ls.status == 0">
|
|
|
+ <view class="tip">倒计时:<uni-countdown
|
|
|
+ color="#FFF"
|
|
|
+ background-color="#BAC1EF"
|
|
|
+ :day="ls.stopTimeD"
|
|
|
+ :hour="ls.stopTimeH"
|
|
|
+ :minute="ls.stopTimeM"
|
|
|
+ :second="ls.stopTimeS"
|
|
|
+ ></uni-countdown></view>
|
|
|
</view>
|
|
|
<!-- <view class="cell-info flex">
|
|
|
<view class="tip">正式挖矿时间:{{ls.mining_start_time}}</view>
|
|
@@ -45,9 +52,11 @@
|
|
|
<script>
|
|
|
import { mymining } from '@/api/calculation.js';
|
|
|
import empty from '@/components/empty';
|
|
|
+import { timeComputed } from '@/utils/rocessor.js';
|
|
|
+import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
- empty
|
|
|
+ empty,uniCountdown
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -71,10 +80,42 @@ export default {
|
|
|
page:1,
|
|
|
limit:1000,
|
|
|
}).then(({ data }) => {
|
|
|
- console.log(data);
|
|
|
- obj.list = data.data;
|
|
|
+ console.log(data,"基础数据")
|
|
|
+ obj.list = data.data;
|
|
|
+ obj.list = data.data.map((e,ind) => {
|
|
|
+ let ar = e;
|
|
|
+ console.log(e,"饿");
|
|
|
+ // 判断是否为进行中的活动
|
|
|
+ if (ar.status === 0) {
|
|
|
+ // 计算倒计时时间
|
|
|
+ obj.timeComputed(ar.mining_start_time * 1000, ar);
|
|
|
+ } else {
|
|
|
+ // 获取距离开始还需要多少时间
|
|
|
+ let arTime = ar.time.split(':');
|
|
|
+ let h = arTime[0];
|
|
|
+ let m = arTime[1];
|
|
|
+ let time = new Date();
|
|
|
+ // 设置时间
|
|
|
+ time.setHours(h, m, 0);
|
|
|
+ // 计算倒计时时间
|
|
|
+ obj.timeComputed(time.getTime(), ar);
|
|
|
+ }
|
|
|
+
|
|
|
+ return e;
|
|
|
+ })
|
|
|
});
|
|
|
},
|
|
|
+ // 计算倒计时时间
|
|
|
+ timeComputed(da, ar) {
|
|
|
+ let obj = this;
|
|
|
+ // 计算时间,保存需要多少时间到期
|
|
|
+ let stopTime = timeComputed(da);
|
|
|
+ console.log(stopTime);
|
|
|
+ ar.stopTimeD = stopTime.day;
|
|
|
+ ar.stopTimeH = stopTime.hours;
|
|
|
+ ar.stopTimeM = stopTime.minutes;
|
|
|
+ ar.stopTimeS = stopTime.seconds;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|