<template>
|
<view class="layout-page bg-panel-1" :style="themeStyle">
|
<v-header :title="$t('common.c10')" ></v-header>
|
<view class="layout-main">
|
<view class="w-12/12 m-t-xs">
|
<view class=" m-md p-md d-flex rounded bg-panel-3 box-shadow">
|
<view class="flex-fill">{{$t('common.c11')}} </view>
|
<view class="color-light"> <span class="fn-lg color-light"> {{miningInfo.kj_name}}</span></view>
|
</view>
|
</view>
|
<view class="w-12/12 m-t-xs">
|
<view class=" m-md p-md d-flex rounded bg-panel-3 box-shadow">
|
<view class="flex-fill">{{$t('common.c7')}} </view>
|
<view class="color-light"> <span class="fn-lg color-light"> {{miningInfo.annualized_rate}}%</span></view>
|
</view>
|
</view>
|
<view class="w-12/12 m-t-xs">
|
<view class=" m-md p-md d-flex rounded bg-panel-3 box-shadow">
|
<view class="flex-fill">{{$t('common.c8')}} </view>
|
<view class="color-light"> <span class="fn-lg color-light"> {{miningInfo.cycle}}</span></view>
|
</view>
|
</view>
|
<view class="w-12/12 m-t-xs">
|
<view class=" m-md p-md d-flex rounded bg-panel-3 box-shadow">
|
<view class="flex-fill">{{$t('common.c13')}} :</view>
|
<view class="color-light"> <span class="fn-lg color-light" style="display: flex;"> <input style="font-size: 14px;width:80px;" type="number" :min="miningInfo.amount" class="send-input t-28 " maxlength="200" v-model="amount">{{miningInfo.coin_name}}</span></view>
|
</view>
|
</view>
|
<view class="w-12/12 m-t-xs">
|
<view class=" m-md p-md d-flex rounded bg-panel-3 box-shadow">
|
<view class="flex-fill">{{$t('common.c14')}} </view>
|
<view class="color-light">{{miningInfo.coink_name}}</view>
|
</view>
|
</view>
|
<view class="w-10/12 m-x-auto m-t-xl">
|
<v-button block class="w-max m-y-md rounded-xs" type="red" @click="buyMining()">{{$t("common.c10")}}</v-button>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import Mining from "@/api/mining.js";
|
import { mapState, mapActions,mapGetters } from "vuex";
|
export default {
|
name: "index",
|
data() {
|
return{
|
miningId: uni.getStorageSync('k_id'),
|
miningInfo:"",
|
amount:'',
|
}
|
},
|
computed: {
|
...mapGetters(['themeStyle'])
|
},
|
created(){
|
//this.getMining();
|
},
|
mounted() {
|
this.$nextTick(function(){
|
this.miningId = uni.getStorageSync('k_id')
|
this.getMining()
|
})
|
},
|
methods:{
|
buyMining(){
|
let data2 ={
|
id:this.miningId,
|
amount:this.amount
|
}
|
Mining.buyMining(data2).then((res)=>{
|
if(res.code==0){
|
this.$toast(res.msg);
|
return;
|
}else if(res.code==200){
|
this.$toast(res.message);
|
setTimeout(() => {
|
this.$router.push('/pages/mining/myMining')
|
}, 1000)
|
}
|
})
|
},
|
getMining(){
|
let data1 ={
|
id:this.miningId,
|
}
|
// console.log(data1);
|
Mining.getMining(data1).then((res1)=>{
|
// console.log(res1.data);
|
if(res1.code==200){
|
this.miningInfo = res1.data;
|
}
|
});
|
|
},
|
},
|
}
|
</script>
|
|
<style>
|
</style>
|