index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="container">
  3. <view class="list-box">
  4. <view class="list flex">
  5. <view class="list-tpls">
  6. <view class="tpls-num">{{list.all}}T</view>
  7. <view class="tpls-name">总算力</view>
  8. </view>
  9. <view class="level-box">
  10. <image src="../../static/img/img28.png"></image>
  11. <view class="level">V{{level}}</view>
  12. </view>
  13. </view>
  14. <view class="list-item flex">
  15. <view class="item-tpl">
  16. <view class="tpl name">已P好</view>
  17. <view class="tpl num">{{list.doing}}T</view>
  18. </view>
  19. <view class="item-tpl">
  20. <view class="tpl name">P盘中</view>
  21. <view class="tpl num">{{list.stand}}T</view>
  22. </view>
  23. </view>
  24. <view class="list-item">
  25. <view class="item-tpl tols">
  26. <view class="tpl name">累计挖币</view>
  27. <view class="tpl num">{{list.all_mining}}XCH</view>
  28. </view>
  29. <!-- <view class="item-tpl">
  30. <view class="tpl name">当前锁仓</view>
  31. <view class="tpl num">{{list.all_lock}}FIL</view>
  32. </view> -->
  33. </view>
  34. <view class="submit-box flex">
  35. <view class="submit" @click="navTo('/pages/calculation/myCalculation')">我的算力</view>
  36. <view class="submit" @click="navTo('/pages/calculation/buyCalculation')">购买算力</view>
  37. </view>
  38. </view>
  39. <image @click="navTo('/pages/calculation/computer')" class="logo-img" src="../../static/img/img34.png"></image>
  40. <!-- <view class="item-box">
  41. <view class="item-tile flex_item">
  42. <image src="../../static/img/img02.png"></image>
  43. <view class="title">f0111469/存储0.0TB</view>
  44. </view>
  45. <view class="item-list flex">
  46. <view class="tpl-box">
  47. <view class="flex tpl">
  48. <view class="name">今日挖币</view>
  49. <image src="../../static/img/img03.png"></image>
  50. </view>
  51. <view class="list-tip">0.0FIL</view>
  52. </view>
  53. <view class="tpl-box">
  54. <view class="flex tpl">
  55. <view class="name">挖矿到期</view>
  56. <image src="../../static/img/img03.png"></image>
  57. </view>
  58. <view class="list-tip">0.0FIL</view>
  59. </view>
  60. <view class="tpl-box">
  61. <view class="flex tpl">
  62. <view class="name">销售奖励</view>
  63. <image src="../../static/img/img03.png"></image>
  64. </view>
  65. <view class="list-tip">0.0FIL</view>
  66. </view>
  67. </view>
  68. <view class="item-list flex">
  69. <view class="tpl-box">
  70. <view class="flex tpl">
  71. <view class="name">挖币奖励</view>
  72. <image src="../../static/img/img03.png"></image>
  73. </view>
  74. <view class="list-tip">0.0FIL</view>
  75. </view>
  76. <view class="tpl-box">
  77. <view class="flex tpl">
  78. <view class="name">已释放FIL</view>
  79. <image src="../../static/img/img03.png"></image>
  80. </view>
  81. <view class="list-tip">0.0FIL</view>
  82. </view>
  83. <view class="tpl-box">
  84. <view class="flex tpl">
  85. <view class="name">锁仓FIL</view>
  86. <image src="../../static/img/img03.png"></image>
  87. </view>
  88. <view class="list-tip">0.0FIL</view>
  89. </view>
  90. </view>
  91. </view> -->
  92. </view>
  93. </template>
  94. <script>
  95. import { mining,miningIndex } from '@/api/calculation.js';
  96. export default {
  97. data() {
  98. return {
  99. list:'',
  100. level:'',
  101. };
  102. },
  103. onLoad(option){
  104. let userInfo = uni.getStorageSync('userInfo') || '';
  105. this.level = userInfo.level;
  106. this.loadData();
  107. },
  108. onShow() {
  109. },
  110. //下拉刷新
  111. onPullDownRefresh() {
  112. this.loadData();
  113. setTimeout(function () {
  114. uni.stopPullDownRefresh();
  115. }, 1000);
  116. },
  117. methods: {
  118. // 请求载入数据
  119. async loadData() {
  120. let obj = this;
  121. miningIndex({}).then(({ data }) => {
  122. obj.list = data;
  123. });
  124. },
  125. /**
  126. * 统一跳转接口,拦截未登录路由
  127. * navigator标签现在默认没有转场动画,所以用view
  128. */
  129. navTo(url) {
  130. uni.navigateTo({
  131. url
  132. });
  133. },
  134. }
  135. };
  136. </script>
  137. <style lang="scss">
  138. page {
  139. min-height: 100%;
  140. background-color: #ffffff;
  141. .container {
  142. width: 100%;
  143. padding: 20rpx 40rpx;
  144. }
  145. }
  146. .list-box{
  147. padding:30rpx 25rpx;
  148. background-image: url(../../static/img/img42.png);
  149. background-size: 100% 100%;
  150. .list{
  151. padding:30rpx 0rpx;
  152. margin-bottom: 40rpx !important;
  153. .list-tpls{
  154. .tpls-num{
  155. font-weight: bold;
  156. color: #333333;
  157. font-size: 40rpx;
  158. padding-bottom: 30rpx;
  159. }
  160. }
  161. .level-box{
  162. position: relative;
  163. image{
  164. width: 128rpx;
  165. height:45rpx;
  166. }
  167. .level{
  168. position: absolute;
  169. top: 12rpx;
  170. left: 62rpx;
  171. font-size: 24rpx;
  172. color: #826740;
  173. font-weight: bold;
  174. }
  175. }
  176. }
  177. .list-item{
  178. // padding: 90rpx 118rpx 0 118rpx;
  179. margin-bottom: 15rpx;
  180. .item-tpl{
  181. text-align: center;
  182. background-color: #FFFFFF;
  183. padding: 41rpx 0;
  184. width: 48%;
  185. .name{
  186. color: #666666;
  187. font-size: 24rpx;
  188. }
  189. .num{
  190. font-size: 32rpx;
  191. color: #333333;
  192. font-weight: bold;
  193. padding-top: 10rpx;
  194. }
  195. }
  196. }
  197. .tols{
  198. width: 100% !important;
  199. }
  200. .submit-box{
  201. margin-top: 50rpx;
  202. .submit{
  203. background-color: #5771DF;
  204. color: #FFFFFF;
  205. font-size: 30rpx;
  206. padding: 25rpx 0;
  207. width: 40%;
  208. text-align: center;
  209. border-radius: 50rpx;
  210. }
  211. }
  212. }
  213. .logo-img{
  214. width: 100%;
  215. height: 208rpx;
  216. margin: 40rpx 0rpx;
  217. }
  218. .item-box{
  219. padding: 15rpx 25rpx;
  220. .item-tile{
  221. padding-bottom: 80rpx;
  222. .title{
  223. padding-left: 15rpx;
  224. font-weight: bold;
  225. color: #333333;
  226. font-size: 30rpx;
  227. }
  228. image{
  229. width: 44rpx;
  230. height: 44rpx;
  231. }
  232. }
  233. .item-list{
  234. padding-bottom: 67rpx;
  235. .tpl-box{
  236. .tpl{
  237. .name{
  238. color: #666666;
  239. font-size: 24rpx;
  240. padding-right: 10rpx;
  241. padding-bottom: 15rpx;
  242. }
  243. image{
  244. width: 25rpx;
  245. height: 25rpx;
  246. }
  247. }
  248. .list-tip{
  249. font-size: 28rpx;
  250. font-weight: bold;
  251. color: #333333;
  252. }
  253. }
  254. }
  255. }
  256. </style>