index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. let userInfo = uni.getStorageSync('userInfo') || '';
  110. this.level = userInfo.level;
  111. this.loadData();
  112. },
  113. //下拉刷新
  114. onPullDownRefresh() {
  115. this.loadData();
  116. setTimeout(function () {
  117. uni.stopPullDownRefresh();
  118. }, 1000);
  119. },
  120. methods: {
  121. // 请求载入数据
  122. async loadData() {
  123. let obj = this;
  124. miningIndex({}).then(({ data }) => {
  125. obj.list = data;
  126. });
  127. },
  128. /**
  129. * 统一跳转接口,拦截未登录路由
  130. * navigator标签现在默认没有转场动画,所以用view
  131. */
  132. navTo(url) {
  133. uni.navigateTo({
  134. url
  135. });
  136. },
  137. }
  138. };
  139. </script>
  140. <style lang="scss">
  141. page {
  142. min-height: 100%;
  143. background-color: #ffffff;
  144. .container {
  145. width: 100%;
  146. padding: 20rpx 40rpx;
  147. }
  148. }
  149. .list-box{
  150. padding:30rpx 25rpx;
  151. background-image: url(../../static/img/img42.png);
  152. background-size: 100% 100%;
  153. .list{
  154. padding:30rpx 0rpx;
  155. margin-bottom: 40rpx !important;
  156. .list-tpls{
  157. .tpls-num{
  158. font-weight: bold;
  159. color: #333333;
  160. font-size: 40rpx;
  161. padding-bottom: 30rpx;
  162. }
  163. }
  164. .level-box{
  165. position: relative;
  166. image{
  167. width: 128rpx;
  168. height:45rpx;
  169. }
  170. .level{
  171. position: absolute;
  172. top: 12rpx;
  173. left: 62rpx;
  174. font-size: 24rpx;
  175. color: #826740;
  176. font-weight: bold;
  177. }
  178. }
  179. }
  180. .list-item{
  181. // padding: 90rpx 118rpx 0 118rpx;
  182. margin-bottom: 15rpx;
  183. .item-tpl{
  184. text-align: center;
  185. background-color: #FFFFFF;
  186. padding: 41rpx 0;
  187. width: 48%;
  188. .name{
  189. color: #666666;
  190. font-size: 24rpx;
  191. }
  192. .num{
  193. font-size: 32rpx;
  194. color: #333333;
  195. font-weight: bold;
  196. padding-top: 10rpx;
  197. }
  198. }
  199. }
  200. .tols{
  201. width: 100% !important;
  202. }
  203. .submit-box{
  204. margin-top: 50rpx;
  205. .submit{
  206. background-color: #5771DF;
  207. color: #FFFFFF;
  208. font-size: 30rpx;
  209. padding: 25rpx 0;
  210. width: 40%;
  211. text-align: center;
  212. border-radius: 50rpx;
  213. }
  214. }
  215. }
  216. .logo-img{
  217. width: 100%;
  218. height: 208rpx;
  219. margin: 40rpx 0rpx;
  220. }
  221. .item-box{
  222. padding: 15rpx 25rpx;
  223. .item-tile{
  224. padding-bottom: 80rpx;
  225. .title{
  226. padding-left: 15rpx;
  227. font-weight: bold;
  228. color: #333333;
  229. font-size: 30rpx;
  230. }
  231. image{
  232. width: 44rpx;
  233. height: 44rpx;
  234. }
  235. }
  236. .item-list{
  237. padding-bottom: 67rpx;
  238. .tpl-box{
  239. .tpl{
  240. .name{
  241. color: #666666;
  242. font-size: 24rpx;
  243. padding-right: 10rpx;
  244. padding-bottom: 15rpx;
  245. }
  246. image{
  247. width: 25rpx;
  248. height: 25rpx;
  249. }
  250. }
  251. .list-tip{
  252. font-size: 28rpx;
  253. font-weight: bold;
  254. color: #333333;
  255. }
  256. }
  257. }
  258. }
  259. </style>