index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <template>
  2. <view class="container">
  3. <view class="tiele-index">首页</view>
  4. <view class="swiper">
  5. <view class="swiper-box">
  6. <swiper circular="true" autoplay="true" @change="swiperChange">
  7. <swiper-item v-for="swiper in banner" :key="swiper.id" @click="ToBanner(swiper)"><image :src="swiper.pic"></image></swiper-item>
  8. </swiper>
  9. <view class="indicator"><view class="dots" v-for="(swiper, index) in banner" :class="[swiperCurrent >= index ? 'on' : '']" :key="index"></view></view>
  10. </view>
  11. </view>
  12. <view class="notice-box">
  13. <view class="notice-title flex_item">
  14. <image src="../../static/img/img31.png"></image>
  15. <view class="title">通知</view>
  16. </view>
  17. <view class="notice-list flex">
  18. <view class="notice-tpl" @click="navTo('/pages/index/information')">
  19. <image src="../../static/img/img02.png"></image>
  20. <view class="name">产品专题</view>
  21. </view>
  22. <view class="notice-tpl" @click="navTo('/pages/index/pingtai')"> <!-- @click="navTo('/pages/index/introduce')" -->
  23. <image src="../../static/img/img03.png"></image>
  24. <view class="name">平台介绍</view>
  25. </view>
  26. <view class="notice-tpl" @click="navTo('/pages/index/notice')">
  27. <image src="../../static/img/img04.png"></image>
  28. <view class="name">通知公告</view>
  29. </view>
  30. <view class="notice-tpl" @click="navTo('/pages/index/share')">
  31. <image src="../../static/img/img05.png"></image>
  32. <view class="name">好友邀请</view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- <image class="logo-img" @click="navTo('/pages/index/information')" src="../../static/img/img44.png"></image> -->
  37. <view class="notice-box">
  38. <!-- <view class="notice-title flex_item">
  39. <image src="../../static/img/img32.png"></image>
  40. <view class="title">行情</view>
  41. </view>
  42. <view class="quotation-list">
  43. <view class="quotation-tpl" v-for="(ls,index) in list" :key='index' v-if="ls.name!='USDT'">
  44. <view class="tpl title">{{ls.name}}/USDT</view>
  45. <view class="tpl num">{{ls.usdt}}</view>
  46. <view class="tpl money">¥{{ls.price}}</view>
  47. <view class="tip-box">
  48. <image src="../../static/img/img30.png"></image>
  49. <view class="tip" v-if="ls.up > 0">{{ls.up * 100}}%</view>
  50. <view class="tip grenn" v-if="ls.up == 0 || ls.up < 0">{{ls.up * 100}}%</view>
  51. </view>
  52. </view>
  53. </view> -->
  54. <view class="title">
  55. 六牛云储运营数据
  56. </view>
  57. <view class="info-box">
  58. <view class="top">
  59. <view class="top-left">Filcoin</view>
  60. <view class="top-right">
  61. <view class="top-right-top">
  62. 全网算力
  63. </view>
  64. <view class="top-right-bottom">
  65. 7.255 EiB
  66. </view>
  67. </view>
  68. </view>
  69. <view class="middle">
  70. <view class="middle-item">
  71. <view class="item-name">
  72. 今日新增算力
  73. </view>
  74. <view class="item-val">
  75. 285.77 TiB
  76. </view>
  77. </view>
  78. <view class="middle-item">
  79. <view class="item-name text-right">
  80. 平台总算力
  81. </view>
  82. <view class="item-val text-right">
  83. 25.770 PiB
  84. </view>
  85. </view>
  86. </view>
  87. <view class="bottom">
  88. <view class="bottom-item">
  89. <view class="item-name" style="color: #FB3A2F;">
  90. 今日单T产量>>>
  91. </view>
  92. <view class="item-val">
  93. 0.0255 FIL
  94. </view>
  95. </view>
  96. <view class="bottom-item">
  97. <view class="item-name text-right">
  98. FIL/USDT
  99. </view>
  100. <view class="item-val text-right">
  101. $53.800
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="title" style="padding-top: 24rpx;">
  107. Swarm资讯
  108. </view>
  109. <view class="info-box">
  110. <view class="top">
  111. <view class="top-left">Bzz</view>
  112. <view class="top-right">
  113. <view class="top-right-top">
  114. </view>
  115. <view class="top-right-bottom">
  116. </view>
  117. </view>
  118. </view>
  119. <view class="middle">
  120. <view class="middle-item">
  121. <view class="item-name">
  122. 可达节点数量
  123. </view>
  124. <view class="item-val">
  125. 9789.00
  126. </view>
  127. </view>
  128. <view class="middle-item">
  129. <view class="item-name text-right">
  130. 活跃节点总数
  131. </view>
  132. <view class="item-val text-right">
  133. 258125
  134. </view>
  135. </view>
  136. </view>
  137. <view class="bottom">
  138. <view class="bottom-item">
  139. <view class="item-name">
  140. 不可达节点数量
  141. </view>
  142. <view class="item-val">
  143. 254562.00
  144. </view>
  145. </view>
  146. <view class="bottom-item">
  147. <view class="item-name text-right">
  148. 已兑换总额
  149. </view>
  150. <view class="item-val text-right">
  151. 1.9565 gbzz
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <view class="title" style="padding-top: 24rpx;">
  157. 活动中心
  158. </view>
  159. <image src="../../static/img/ad.png" mode="" class="ad"></image>
  160. <view class="tit">
  161. 六牛云储FIL节点
  162. </view>
  163. <view class="kg-item">
  164. <view class="item-na">
  165. 矿工号:<text>f073844</text>
  166. </view>
  167. <view class="item-info">
  168. <view class="item-name">账户余额</view>
  169. <view class="item-val">152415.2 FIL</view>
  170. </view>
  171. <view class="item-info">
  172. <view class="item-name">可用余额</view>
  173. <view class="item-val">1725.123 FIL</view>
  174. </view>
  175. <view class="item-info">
  176. <view class="item-name">扇区抵押</view>
  177. <view class="item-val">100961.12 FIL</view>
  178. </view>
  179. <view class="item-info">
  180. <view class="item-name">挖矿锁仓</view>
  181. <view class="item-val">15996.266 FIL</view>
  182. </view>
  183. <view class="item-info">
  184. <view class="item-name">全网占比</view>
  185. <view class="item-val">0.15%</view>
  186. </view>
  187. <view class="item-info">
  188. <view class="item-name">全网排名</view>
  189. <view class="item-val">142</view>
  190. </view>
  191. <view class="item-info">
  192. <view class="item-name">原值算力</view>
  193. <view class="item-val">10.23 PiiB</view>
  194. </view>
  195. <view class="item-info">
  196. <view class="item-name">累计出块份数</view>
  197. <view class="item-val">5554</view>
  198. </view>
  199. <view class="item-info">
  200. <view class="item-name">累计出块奖励</view>
  201. <view class="item-val">125236.08 FIL</view>
  202. </view>
  203. <view class="item-info">
  204. <view class="item-name">扇区大小</view>
  205. <view class="item-val">32.0GiB</view>
  206. </view>
  207. </view>
  208. <view class="kg-item">
  209. <view class="item-na">
  210. 矿工号:<text>f020742</text>
  211. </view>
  212. <view class="item-info">
  213. <view class="item-name">账户余额</view>
  214. <view class="item-val">152415.2 FIL</view>
  215. </view>
  216. <view class="item-info">
  217. <view class="item-name">可用余额</view>
  218. <view class="item-val">1725.123 FIL</view>
  219. </view>
  220. <view class="item-info">
  221. <view class="item-name">扇区抵押</view>
  222. <view class="item-val">100961.12 FIL</view>
  223. </view>
  224. <view class="item-info">
  225. <view class="item-name">挖矿锁仓</view>
  226. <view class="item-val">15996.266 FIL</view>
  227. </view>
  228. <view class="item-info">
  229. <view class="item-name">全网占比</view>
  230. <view class="item-val">0.15%</view>
  231. </view>
  232. <view class="item-info">
  233. <view class="item-name">全网排名</view>
  234. <view class="item-val">142</view>
  235. </view>
  236. <view class="item-info">
  237. <view class="item-name">原值算力</view>
  238. <view class="item-val">10.23 PiiB</view>
  239. </view>
  240. <view class="item-info">
  241. <view class="item-name">累计出块份数</view>
  242. <view class="item-val">5554</view>
  243. </view>
  244. <view class="item-info">
  245. <view class="item-name">累计出块奖励</view>
  246. <view class="item-val">125236.08 FIL</view>
  247. </view>
  248. <view class="item-info">
  249. <view class="item-name">扇区大小</view>
  250. <view class="item-val">32.0GiB</view>
  251. </view>
  252. </view>
  253. </view>
  254. <view class="list-box flex">
  255. <image src="../../static/img/img45.png"></image>
  256. <image src="../../static/img/img46.png"></image>
  257. </view>
  258. </view>
  259. </template>
  260. <script>
  261. import { interceptor } from '@/utils/loginUtils';
  262. import { loadIndexs,moneyType } from '@/api/index.js';
  263. import { mapState } from 'vuex';
  264. export default {
  265. data() {
  266. return {
  267. swiperCurrent: 0,
  268. banner: [],
  269. list:''
  270. };
  271. },
  272. computed: {
  273. ...mapState(['loginInterceptor','hasLogin']),
  274. },
  275. onLoad: function(option) {
  276. if (option.spread) {
  277. // 存储其他邀请人
  278. uni.setStorageSync('spread', option.spread);
  279. }
  280. },
  281. onShow: function() {
  282. // 判断是否强制登录
  283. if (this.loginInterceptor && !this.hasLogin) {
  284. // 登录拦截
  285. interceptor();
  286. }else{
  287. this.loadData();
  288. this.moneyType();
  289. }
  290. },
  291. //下拉刷新
  292. onPullDownRefresh() {
  293. this.loadData();
  294. this.moneyType();
  295. setTimeout(function () {
  296. uni.stopPullDownRefresh();
  297. }, 1000);
  298. },
  299. methods: {
  300. // 请求载入数据
  301. async loadData() {
  302. let obj = this;
  303. loadIndexs({}).then(({ data }) => {
  304. obj.banner = data.banner;
  305. });
  306. },
  307. moneyType(){
  308. let obj = this;
  309. moneyType({index:1}).then(({ data }) => {
  310. obj.list = data;
  311. console.log('list-----',obj.list)
  312. });
  313. },
  314. /**
  315. * 统一跳转接口,拦截未登录路由
  316. * navigator标签现在默认没有转场动画,所以用view
  317. */
  318. navTo(url) {
  319. uni.navigateTo({
  320. url
  321. });
  322. },
  323. //轮播图
  324. swiperChange(e) {
  325. let index = e.detail.current;
  326. this.swiperCurrent = index;
  327. },
  328. }
  329. };
  330. </script>
  331. <style lang="scss">
  332. page {
  333. min-height: 100%;
  334. background-color: #ffffff;
  335. .container {
  336. width: 100%;
  337. padding: 25rpx 40rpx;
  338. }
  339. }
  340. .tiele-index{
  341. font-weight: 500;
  342. font-size: 50rpx;
  343. padding: 15% 0rpx 30rpx 0rpx;
  344. }
  345. .top-head {
  346. position: fixed;
  347. top: 0;
  348. z-index: 99;
  349. width: 100%;
  350. background-color: #272f41;
  351. padding: 15rpx 35rpx;
  352. color: #edc959;
  353. image {
  354. width: 80rpx;
  355. height: 80rpx;
  356. }
  357. .top-name {
  358. padding-left: 15rpx;
  359. }
  360. }
  361. //轮播图
  362. .swiper {
  363. width: 100%;
  364. display: flex;
  365. justify-content: center;
  366. border-radius: 15rpx;
  367. .swiper-box {
  368. width: 100%;
  369. height: 335rpx;
  370. overflow: hidden;
  371. // box-shadow: 0upx 8upx 25upx rgba(0, 0, 0, 0.2);
  372. //兼容ios,微信小程序
  373. border-radius: 15rpx;
  374. position: relative;
  375. z-index: 1;
  376. swiper {
  377. width: 100%;
  378. height: 100%;
  379. swiper-item {
  380. image {
  381. width: 100%;
  382. height: 100%;
  383. border-radius: 15rpx;
  384. }
  385. }
  386. }
  387. .indicator {
  388. position: absolute;
  389. bottom: 20upx;
  390. left: 20upx;
  391. background-color: rgba(255, 255, 255, 0.4);
  392. width: 150upx;
  393. height: 5upx;
  394. border-radius: 3upx;
  395. overflow: hidden;
  396. display: flex;
  397. .dots {
  398. width: 0upx;
  399. background-color: rgba(255, 255, 255, 1);
  400. transition: all 0.3s ease-out;
  401. &.on {
  402. width: (100%/3);
  403. }
  404. }
  405. }
  406. }
  407. }
  408. .notice-box{
  409. .text-right {
  410. text-align: right;
  411. }
  412. padding: 40rpx 0rpx;
  413. .title {
  414. font-size: 28rpx;
  415. padding-bottom: 19rpx;
  416. font-family: PingFang SC;
  417. font-weight: bold;
  418. color: #000000;
  419. position: relative;
  420. left: -13rpx;
  421. }
  422. .info-box {
  423. width: 678rpx;
  424. height: 282rpx;
  425. margin: 0 auto;
  426. background: #FFFFFF;
  427. border: 2px solid #5771DF;
  428. border-radius: 5rpx;
  429. padding: 15rpx 22rpx 25rpx;
  430. font-size: 22rpx;
  431. font-family: PingFang SC;
  432. font-weight: 500;
  433. color: #333333;
  434. // line-height: 1;
  435. display: flex;
  436. flex-direction: column;
  437. justify-content: space-between;
  438. // justify-content: ;
  439. .top {
  440. display: flex;
  441. align-items: center;
  442. justify-content: space-between;
  443. .top-left {
  444. font-size: 63rpx;
  445. font-family: PingFang SC;
  446. font-weight: bold;
  447. color: #5771DF;
  448. }
  449. .top-right {
  450. text-align: right;
  451. .top-right-bottom {
  452. font-size: 30rpx;
  453. font-family: PingFang SC;
  454. font-weight: bold;
  455. color: #5771DF;
  456. }
  457. }
  458. }
  459. .middle {
  460. display: flex;
  461. justify-content: space-between;
  462. .middle-item {
  463. display: flex;
  464. flex-direction: column;
  465. .item-val {
  466. font-size: 30rpx;
  467. font-family: PingFang SC;
  468. font-weight: bold;
  469. color: #5771DF;
  470. }
  471. }
  472. }
  473. .bottom {
  474. display: flex;
  475. justify-content: space-between;
  476. .item-val {
  477. display: flex;
  478. // justify-content: ;
  479. font-size: 30rpx;
  480. font-family: PingFang SC;
  481. font-weight: bold;
  482. color: #5771DF;
  483. }
  484. }
  485. }
  486. .ad {
  487. display: block;
  488. margin: 0 auto;
  489. width: 678rpx;
  490. height: 162rpx;
  491. }
  492. .tit {
  493. margin: 0 auto;
  494. margin-top: 31rpx;
  495. width: 678rpx;
  496. height: 59rpx;
  497. background: #5771DF;
  498. border-radius: 5rpx;
  499. text-align: center;
  500. font-size: 28rpx;
  501. font-family: PingFang SC;
  502. font-weight: bold;
  503. color: #FFFFFF;
  504. line-height: 59rpx;
  505. }
  506. .kg-item {
  507. height: 100%;
  508. height: 610rpx;
  509. border-bottom: 1px solid #F3F4F6;
  510. padding: 40rpx 17rpx 0;
  511. line-height: 1;
  512. font-size: 28rpx;
  513. font-family: PingFang SC;
  514. font-weight: bold;
  515. color: #333333;
  516. .item-na {
  517. padding-bottom: 39rpx;
  518. text {
  519. color:#FB3A2F;
  520. }
  521. }
  522. .item-info {
  523. padding-left: 16rpx;
  524. font-size: 24rpx;
  525. font-family: PingFang SC;
  526. font-weight: bold;
  527. color: #333333;
  528. line-height: 1;
  529. padding-bottom: 24rpx;
  530. display: flex;
  531. justify-content: space-between;
  532. }
  533. }
  534. .notice-title{
  535. padding-bottom: 30rpx;
  536. image{
  537. width:35rpx;
  538. height: 32rpx;
  539. }
  540. .title{
  541. font-size: 34rpx;
  542. font-weight: bold;
  543. font-style: italic;
  544. color: #333333;
  545. margin-left: 15rpx;
  546. }
  547. }
  548. .notice-list{
  549. .notice-tpl{
  550. image{
  551. width: 99rpx;
  552. height: 113rpx;
  553. }
  554. .name{
  555. font-size: 26rpx;
  556. color: #5D616D;
  557. }
  558. }
  559. }
  560. }
  561. .logo-img{
  562. width: 100%;
  563. height: 210rpx;
  564. }
  565. .quotation-list{
  566. display: flex;
  567. flex-wrap: wrap;
  568. .quotation-tpl{
  569. position: relative;
  570. padding: 22rpx 24rpx;
  571. height: 220rpx;
  572. overflow: hidden;
  573. display: flex;
  574. flex-direction: column;
  575. width:31%;
  576. margin-bottom: 4%;
  577. margin-right: 2%;
  578. // &:nth-child(2n + 1) {
  579. // margin-right: 2%;
  580. // }
  581. .tpl{
  582. z-index: 99;
  583. position: relative;
  584. font-size: 24rpx;
  585. padding-bottom: 10rpx;
  586. }
  587. .title{
  588. color: #333333;
  589. font-weight: bold;
  590. padding-bottom: 21rpx !important;
  591. }
  592. .num{
  593. color: #FB3A2F;
  594. }
  595. .money{
  596. color: #666666;
  597. }
  598. .tip-box{
  599. image{
  600. width: 100%;
  601. height: 118rpx;
  602. position: absolute;
  603. bottom: 0;
  604. left: 0;
  605. }
  606. .tip{
  607. position: relative;
  608. color: #FB3A2F;
  609. font-size: 26rpx;
  610. text-align: center;
  611. font-weight: 600;
  612. padding-top: 25rpx;
  613. }
  614. .grenn{
  615. color: #606266;
  616. }
  617. }
  618. }
  619. }
  620. .list-box{
  621. image{
  622. width: 326rpx;
  623. height: 210rpx;
  624. }
  625. }
  626. </style>