index.vue 13 KB

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