index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. <template v-if="list.all > 0">
  15. <view class="list-item flex">
  16. <view class="item-tpl">
  17. <view class="tpl name">有效算力</view>
  18. <view class="tpl num">{{list.doing}}T</view>
  19. </view>
  20. <view class="item-tpl">
  21. <view class="tpl name">待生效算力</view>
  22. <view class="tpl num">{{list.stand}}T</view>
  23. </view>
  24. </view>
  25. <view class="list-item">
  26. <view class="item-tpl tols">
  27. <view class="tpl name">累计挖币</view>
  28. <view class="tpl num">{{list.all_mining}}XCH</view>
  29. </view>
  30. <!-- <view class="item-tpl">
  31. <view class="tpl name">当前锁仓</view>
  32. <view class="tpl num">{{list.all_lock}}FIL</view>
  33. </view> -->
  34. </view>
  35. </template>
  36. <template v-else>
  37. <view class="img-box">
  38. <image src="../../static/img/img52.png"></image>
  39. <view class="img-btn-box">
  40. <view class="img-btn" v-for="item in moneyNumber" :key="item" @click="imgClick"></view>
  41. </view>
  42. </view>
  43. <!-- <view>您当前算力为0,是否立即购买算力</view> -->
  44. </template>
  45. <!-- <view class="list-item flex">
  46. <view class="item-tpl">
  47. <view class="tpl name">有效算力</view>
  48. <view class="tpl num">{{list.doing}}T</view>
  49. </view>
  50. <view class="item-tpl">
  51. <view class="tpl name">待生效算力</view>
  52. <view class="tpl num">{{list.stand}}T</view>
  53. </view>
  54. </view>
  55. <view class="list-item">
  56. <view class="item-tpl tols">
  57. <view class="tpl name">累计挖币</view>
  58. <view class="tpl num">{{list.all_mining}}XCH</view>
  59. </view> -->
  60. <!-- <view class="item-tpl">
  61. <view class="tpl name">当前锁仓</view>
  62. <view class="tpl num">{{list.all_lock}}FIL</view>
  63. </view> -->
  64. <!-- </view> -->
  65. <view class="submit-box flex">
  66. <view class="submit" @click="navTo('/pages/calculation/myCalculation')">我的算力</view>
  67. <view class="submit" @click="navToo('/pages/calculation/buyCalculation')">购买算力</view>
  68. </view>
  69. </view>
  70. <image @click="navTo('/pages/calculation/computer')" class="logo-img" src="../../static/img/img34.png"></image>
  71. <!-- <view class="item-box">
  72. <view class="item-tile flex_item">
  73. <image src="../../static/img/img02.png"></image>
  74. <view class="title">f0111469/存储0.0TB</view>
  75. </view>
  76. <view class="item-list flex">
  77. <view class="tpl-box">
  78. <view class="flex tpl">
  79. <view class="name">今日挖币</view>
  80. <image src="../../static/img/img03.png"></image>
  81. </view>
  82. <view class="list-tip">0.0FIL</view>
  83. </view>
  84. <view class="tpl-box">
  85. <view class="flex tpl">
  86. <view class="name">挖矿到期</view>
  87. <image src="../../static/img/img03.png"></image>
  88. </view>
  89. <view class="list-tip">0.0FIL</view>
  90. </view>
  91. <view class="tpl-box">
  92. <view class="flex tpl">
  93. <view class="name">销售奖励</view>
  94. <image src="../../static/img/img03.png"></image>
  95. </view>
  96. <view class="list-tip">0.0FIL</view>
  97. </view>
  98. </view>
  99. <view class="item-list flex">
  100. <view class="tpl-box">
  101. <view class="flex tpl">
  102. <view class="name">挖币奖励</view>
  103. <image src="../../static/img/img03.png"></image>
  104. </view>
  105. <view class="list-tip">0.0FIL</view>
  106. </view>
  107. <view class="tpl-box">
  108. <view class="flex tpl">
  109. <view class="name">已释放FIL</view>
  110. <image src="../../static/img/img03.png"></image>
  111. </view>
  112. <view class="list-tip">0.0FIL</view>
  113. </view>
  114. <view class="tpl-box">
  115. <view class="flex tpl">
  116. <view class="name">锁仓FIL</view>
  117. <image src="../../static/img/img03.png"></image>
  118. </view>
  119. <view class="list-tip">0.0FIL</view>
  120. </view>
  121. </view>
  122. </view> -->
  123. </view>
  124. </template>
  125. <script>
  126. import { mining,miningIndex } from '@/api/calculation.js';
  127. export default {
  128. data() {
  129. return {
  130. list:'',
  131. level:'',
  132. moneyNumber: 6
  133. };
  134. },
  135. onLoad(option){
  136. let userInfo = uni.getStorageSync('userInfo') || '';
  137. this.level = userInfo.level;
  138. this.loadData();
  139. },
  140. onShow() {
  141. },
  142. //下拉刷新
  143. onPullDownRefresh() {
  144. this.loadData();
  145. setTimeout(function () {
  146. uni.stopPullDownRefresh();
  147. }, 1000);
  148. },
  149. methods: {
  150. // 请求载入数据
  151. async loadData() {
  152. let obj = this;
  153. miningIndex({}).then(({ data }) => {
  154. obj.list = data;
  155. console.log(obj.list)
  156. });
  157. },
  158. /**
  159. * 统一跳转接口,拦截未登录路由
  160. * navigator标签现在默认没有转场动画,所以用view
  161. */
  162. navTo(url) {
  163. uni.navigateTo({
  164. url
  165. });
  166. },
  167. navToo(url) {
  168. uni.switchTab({
  169. url
  170. })
  171. },
  172. imgClick() {
  173. this.navTo('/pages/calculation/buyCalculation')
  174. }
  175. }
  176. };
  177. </script>
  178. <style lang="scss">
  179. page {
  180. min-height: 100%;
  181. background-color: #ffffff;
  182. .container {
  183. width: 100%;
  184. padding: 20rpx 40rpx;
  185. }
  186. }
  187. .list-box{
  188. padding:30rpx 25rpx;
  189. background-image: url(../../static/img/img42.png);
  190. background-size: 100% 100%;
  191. .list{
  192. padding:30rpx 0rpx;
  193. margin-bottom: 40rpx !important;
  194. .list-tpls{
  195. .tpls-num{
  196. font-weight: bold;
  197. color: #333333;
  198. font-size: 40rpx;
  199. padding-bottom: 30rpx;
  200. }
  201. }
  202. .level-box{
  203. position: relative;
  204. image{
  205. width: 128rpx;
  206. height:45rpx;
  207. }
  208. .level{
  209. position: absolute;
  210. top: 12rpx;
  211. left: 62rpx;
  212. font-size: 24rpx;
  213. color: #826740;
  214. font-weight: bold;
  215. }
  216. }
  217. }
  218. .list-item{
  219. // padding: 90rpx 118rpx 0 118rpx;
  220. margin-bottom: 15rpx;
  221. .item-tpl{
  222. text-align: center;
  223. background-color: #FFFFFF;
  224. padding: 41rpx 0;
  225. width: 48%;
  226. .name{
  227. color: #666666;
  228. font-size: 24rpx;
  229. }
  230. .num{
  231. font-size: 32rpx;
  232. color: #333333;
  233. font-weight: bold;
  234. padding-top: 10rpx;
  235. }
  236. }
  237. }
  238. .tols{
  239. width: 100% !important;
  240. }
  241. .submit-box{
  242. margin-top: 50rpx;
  243. .submit{
  244. background-color: #5771DF;
  245. color: #FFFFFF;
  246. font-size: 30rpx;
  247. padding: 25rpx 0;
  248. width: 48%;
  249. text-align: center;
  250. border-radius: 50rpx;
  251. }
  252. }
  253. }
  254. .logo-img{
  255. width: 100%;
  256. height: 208rpx;
  257. margin: 40rpx 0rpx;
  258. }
  259. .item-box{
  260. padding: 15rpx 25rpx;
  261. .item-tile{
  262. padding-bottom: 80rpx;
  263. .title{
  264. padding-left: 15rpx;
  265. font-weight: bold;
  266. color: #333333;
  267. font-size: 30rpx;
  268. }
  269. image{
  270. width: 44rpx;
  271. height: 44rpx;
  272. }
  273. }
  274. .item-list{
  275. padding-bottom: 67rpx;
  276. .tpl-box{
  277. .tpl{
  278. .name{
  279. color: #666666;
  280. font-size: 24rpx;
  281. padding-right: 10rpx;
  282. padding-bottom: 15rpx;
  283. }
  284. image{
  285. width: 25rpx;
  286. height: 25rpx;
  287. }
  288. }
  289. .list-tip{
  290. font-size: 28rpx;
  291. font-weight: bold;
  292. color: #333333;
  293. }
  294. }
  295. }
  296. }
  297. .img-box {
  298. width: 550rpx;
  299. height: 345rpx;
  300. margin: 0 auto;
  301. image {
  302. width: 100%;
  303. height: 100%;
  304. }
  305. .img-btn-box {
  306. height: 50rpx;
  307. width: 100%;
  308. display: flex;
  309. justify-content: space-between;
  310. position: relative;
  311. bottom: 55rpx;
  312. .img-btn {
  313. bottom: 0;
  314. width: 50rpx;
  315. height: 50rpx;
  316. // background-color: red;
  317. }
  318. }
  319. }
  320. </style>