shoppingDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. <template>
  2. <view class="content">
  3. <view class="header-box">
  4. <view class="top" >
  5. <view class="banner-img">
  6. <image src="../../static/img/img01.png" mode=""></image>
  7. </view>
  8. <view class="banner-title">
  9. <view class="title">
  10. <view class="img">
  11. <image src="../../static/index/index08.png" mode=""></image>
  12. </view>
  13. <view class="tit">
  14. <view class="text">
  15. 单台价格
  16. </view>
  17. <view class="text">
  18. ¥{{orderList.cost_money*1}}{{orderList.cost_money_type}}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="title">
  23. <view class="img">
  24. <image src="../../static/index/index11.png" mode=""></image>
  25. </view>
  26. <view class="tit">
  27. <view class="text">
  28. 电费
  29. </view>
  30. <view class="text">
  31. {{(orderList.electric_fee*1).toFixed(2)}}USDT/天
  32. </view>
  33. </view>
  34. </view>
  35. <view class="title">
  36. <view class="img">
  37. <image src="../../static/index/index07.png" mode=""></image>
  38. </view>
  39. <view class="tit">
  40. <view class="text">
  41. 运维服务费
  42. </view>
  43. <view class="text">
  44. {{ orderList.service_ratio }}%
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- <view class="xuangou-box">
  51. <view class="xuangou-left">
  52. <view class="package">
  53. 选购电费包
  54. </view>
  55. <view class="package-title">
  56. 屯币必备
  57. </view>
  58. </view>
  59. <view class="xuangou-right">
  60. >
  61. </view>
  62. </view> -->
  63. </view>
  64. <view class="navbar">
  65. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  66. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  67. </view>
  68. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  69. <swiper-item class="tab-content">
  70. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  71. <!-- 空白页 -->
  72. <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
  73. <view class="details">
  74. <view class="details-box">
  75. <view class="details-left">
  76. 合约矿机
  77. </view>
  78. <view class="details-right">
  79. {{orderList.name}}
  80. </view>
  81. </view>
  82. <view class="details-box">
  83. <view class="details-left">
  84. 单份T数
  85. </view>
  86. <view class="details-right">
  87. {{orderList.step*1}}T
  88. </view>
  89. </view>
  90. <!-- <view class="details-box">
  91. <view class="details-left">
  92. 起赎金额
  93. </view>
  94. <view class="details-right">
  95. 10元
  96. </view>
  97. </view> -->
  98. <view class="details-box">
  99. <view class="details-left">
  100. 电价
  101. </view>
  102. <view class="details-right">
  103. {{orderList.electric_price}}元/度
  104. </view>
  105. </view>
  106. <view class="details-box">
  107. <view class="details-left">
  108. 每日功耗
  109. </view>
  110. <view class="details-right">
  111. {{(orderList.power*24).toFixed(2)}}W
  112. </view>
  113. </view>
  114. <view class="details-box">
  115. <view class="details-left">
  116. 维保费
  117. </view>
  118. <view class="details-right">
  119. 按实际情况收取
  120. </view>
  121. </view>
  122. <view class="details-box">
  123. <view class="details-left">
  124. 平台佣金
  125. </view>
  126. <view class="details-right">
  127. 回本前
  128. </view>
  129. </view>
  130. <view class="details-box">
  131. <view class="details-left">
  132. 算力到账日
  133. </view>
  134. <view class="details-right">
  135. T+{{orderList.stand_time}}
  136. </view>
  137. </view>
  138. </view>
  139. <!-- <uni-load-more :status="tabItem.loadingType"></uni-load-more> -->
  140. </scroll-view>
  141. </swiper-item>
  142. <swiper-item class="tab-content">
  143. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  144. <!-- 空白页 -->
  145. <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
  146. <!-- <uni-load-more :status="tabItem.loadingType"></uni-load-more> -->
  147. {{orderList.detail}}
  148. </scroll-view>
  149. </swiper-item>
  150. <swiper-item class="tab-content">
  151. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  152. {{orderList.problem}}
  153. </scroll-view>
  154. </swiper-item>
  155. </swiper>
  156. <view class="lala">
  157. <!-- <uni-number-box class="step" :value="num" :disabled="false" @eventChange="numberChange"></uni-number-box> -->
  158. <view class="buy" @click="buy()">
  159. 立即购买
  160. </view>
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import { miningDateils, buyMining } from '@/api/calculation.js';
  166. import uniNumberBox from '@/components/uni-number-box.vue';
  167. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  168. import empty from '@/components/empty';
  169. export default {
  170. components: {
  171. uniLoadMore,
  172. empty,
  173. uniNumberBox
  174. },
  175. data() {
  176. return {
  177. id:'',
  178. tabCurrentIndex: 0,
  179. orderList: [],
  180. num: 1,
  181. navList: [{
  182. state: 0,
  183. text: '购买说明',
  184. loadingType: 'more',
  185. page: 1, //当前页数
  186. limit: 10 //每次信息条数
  187. },
  188. {
  189. state: 1,
  190. text: '产品介绍',
  191. loadingType: 'more',
  192. page: 1, //当前页数
  193. limit: 10 //每次信息条数
  194. },
  195. {
  196. state: 3,
  197. text: '常见问题',
  198. loadingType: 'more',
  199. orderList: [],
  200. page: 1, //当前页数
  201. limit: 10 //每次信息条数
  202. },
  203. ]
  204. };
  205. },
  206. created() {
  207. this.loadData()
  208. },
  209. computed: {
  210. money() {
  211. return this.num * this.price;
  212. },
  213. },
  214. onShow() {
  215. this.loadData()
  216. },
  217. onLoad(options) {
  218. console.log(options,'2222');
  219. this.id = options.id
  220. this.loadData()
  221. },
  222. methods: {
  223. server(){
  224. this.$refs.popup.open();
  225. },
  226. close(){
  227. this.$refs.popup.close();
  228. },
  229. buy() {
  230. // let list = JSON.stringify(this.list)
  231. uni.navigateTo({
  232. url: '/pages/calculation/pay?&id=' + this.id
  233. });
  234. // console.log(this.list,'--------------***********')
  235. // console.log('buy click')
  236. },
  237. loadData() {
  238. let obj = this
  239. miningDateils(
  240. {},this.id).then(res=>{
  241. console.log(res,'2222');
  242. obj.orderList =res.data
  243. console.log(obj.orderList,'数据');
  244. })
  245. },
  246. numberChange(data) {
  247. let obj = this;
  248. obj.num = data.number;
  249. console.log(obj.num, '2222');
  250. },
  251. //顶部tab点击
  252. tabClick(index) {
  253. this.tabCurrentIndex = index;
  254. },
  255. //swiper 切换
  256. changeTab(e) {
  257. this.tabCurrentIndex = e.target.current;
  258. this.loadData('tabChange');
  259. },
  260. }
  261. }
  262. </script>
  263. <style lang="scss">
  264. page,
  265. .content {
  266. margin: 0;
  267. padding: 0;
  268. height: 100%;
  269. width: 100%;
  270. background: #F5F5F5;
  271. }
  272. .lala{
  273. display: flex;
  274. justify-content: space-around;
  275. .buy{
  276. width: 338rpx;
  277. height: 65rpx;
  278. background: #FF6600;
  279. border-radius: 10rpx;
  280. font-size: 27rpx;
  281. font-family: PingFang SC;
  282. font-weight: bold;
  283. color: #FFFFFF;
  284. line-height: 65rpx;
  285. text-align: center;
  286. }
  287. }
  288. .top {
  289. padding-top: 50rpx;
  290. background: #FFFFFF;
  291. }
  292. .banner-img {
  293. margin: 0 auto;
  294. margin-bottom: 50rpx;
  295. width: 386rpx;
  296. height: 289rpx;
  297. image {
  298. width: 100%;
  299. height: 100%;
  300. }
  301. }
  302. .banner-title {
  303. background: #FFFFFF;
  304. padding: 30rpx;
  305. display: flex;
  306. justify-content: space-between;
  307. .title {
  308. display: flex;
  309. align-items: center;
  310. .img {
  311. width: 32rpx;
  312. height: 32rpx;
  313. // background: #FF6600;
  314. border-radius: 50%;
  315. image {
  316. width: 100%;
  317. height: 100%;
  318. }
  319. }
  320. .tit {
  321. margin-left: 10rpx;
  322. display: flex;
  323. flex-direction: column;
  324. justify-content: center;
  325. align-items: center;
  326. .text {
  327. font-size: 19rpx;
  328. font-family: PingFang SC;
  329. font-weight: bold;
  330. color: #141E47;
  331. }
  332. }
  333. }
  334. }
  335. .xuangou-box {
  336. background: #FFFFFF;
  337. margin: 15rpx 0;
  338. display: flex;
  339. justify-content: space-between;
  340. padding: 30rpx;
  341. .xuangou-left {
  342. display: flex;
  343. align-items: center;
  344. .package {
  345. font-size: 27rpx;
  346. font-weight: bold;
  347. color: #141E47;
  348. // line-height: 98rpx;
  349. }
  350. .package-title {
  351. font-size: 16rpx;
  352. font-weight: bold;
  353. color: #FF6600;
  354. width: 120rpx;
  355. margin-left: 10rpx;
  356. background: #FFF3EB;
  357. border: 1px solid #FF6600;
  358. text-align: center;
  359. padding: 3rpx 9rpx;
  360. }
  361. }
  362. .xuangou-right {
  363. color: #999999;
  364. }
  365. }
  366. .navbar {
  367. display: flex;
  368. height: 40px;
  369. padding: 0 5px;
  370. background: #fff;
  371. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  372. position: relative;
  373. z-index: 10;
  374. .nav-item {
  375. flex: 1;
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. height: 100%;
  380. font-size: 15px;
  381. color: #9A9EAE;
  382. position: relative;
  383. &.current {
  384. color: #FF6600;
  385. &:after {
  386. content: '';
  387. position: absolute;
  388. left: 50%;
  389. bottom: 0;
  390. transform: translateX(-50%);
  391. width: 44px;
  392. height: 0;
  393. border-bottom: 2px solid #FF6600;
  394. }
  395. }
  396. }
  397. }
  398. .swiper-box {
  399. height: 500rpx;
  400. }
  401. .tab-content {
  402. height: 500rpx;
  403. }
  404. .list-scroll-content {
  405. height: 500rpx;
  406. }
  407. .uni-swiper-item {
  408. height: auto;
  409. }
  410. .order-item {
  411. display: flex;
  412. flex-direction: column;
  413. padding-left: 30rpx;
  414. background: #fff;
  415. margin-top: 16rpx;
  416. .i-top {
  417. display: flex;
  418. align-items: center;
  419. height: 80rpx;
  420. padding-right: 30rpx;
  421. font-size: $font-base;
  422. color: $font-color-dark;
  423. position: relative;
  424. .time {
  425. flex: 1;
  426. }
  427. .state {
  428. color: $base-color;
  429. }
  430. .del-btn {
  431. padding: 10rpx 0 10rpx 36rpx;
  432. font-size: $font-lg;
  433. color: $font-color-light;
  434. position: relative;
  435. &:after {
  436. content: '';
  437. width: 0;
  438. height: 30rpx;
  439. border-left: 1px solid $border-color-dark;
  440. position: absolute;
  441. left: 20rpx;
  442. top: 50%;
  443. transform: translateY(-50%);
  444. }
  445. }
  446. }
  447. /* 多条商品 */
  448. .goods-box {
  449. height: 160rpx;
  450. padding: 20rpx 0;
  451. white-space: nowrap;
  452. .goods-item {
  453. width: 120rpx;
  454. height: 120rpx;
  455. display: inline-block;
  456. margin-right: 24rpx;
  457. }
  458. .goods-img {
  459. display: block;
  460. width: 100%;
  461. height: 100%;
  462. }
  463. }
  464. /* 单条商品 */
  465. .goods-box-single {
  466. display: flex;
  467. padding: 20rpx 0;
  468. .goods-img {
  469. display: block;
  470. width: 120rpx;
  471. height: 120rpx;
  472. }
  473. .right {
  474. flex: 1;
  475. display: flex;
  476. flex-direction: column;
  477. padding: 0 30rpx 0 24rpx;
  478. overflow: hidden;
  479. .row {
  480. margin-top: 10rpx;
  481. }
  482. .row_title {
  483. padding: 5rpx 10rpx;
  484. background-color: #dddddd;
  485. border-radius: 10rpx;
  486. font-size: 22rpx;
  487. color: #ffffff;
  488. }
  489. .title {
  490. font-size: $font-base + 2rpx;
  491. color: $font-color-dark;
  492. line-height: 1;
  493. width: 80%;
  494. }
  495. .attr-box {
  496. display: flex;
  497. justify-content: flex-end;
  498. font-size: $font-sm + 2rpx;
  499. color: $font-color-light;
  500. }
  501. .price {
  502. display: inline;
  503. font-size: $font-base + 2rpx;
  504. color: $font-color-dark;
  505. &:before {
  506. content: '¥';
  507. font-size: $font-sm;
  508. }
  509. }
  510. }
  511. }
  512. .price-box {
  513. display: flex;
  514. justify-content: flex-end;
  515. align-items: baseline;
  516. padding: 20rpx 30rpx;
  517. font-size: $font-sm + 2rpx;
  518. color: $font-color-light;
  519. .num {
  520. margin: 0 8rpx;
  521. color: $font-color-dark;
  522. }
  523. .price {
  524. font-size: $font-lg;
  525. color: $font-color-dark;
  526. &:before {
  527. content: '¥';
  528. font-size: $font-sm;
  529. margin: 0 2rpx 0 8rpx;
  530. }
  531. }
  532. }
  533. .action-box {
  534. display: flex;
  535. justify-content: flex-end;
  536. align-items: center;
  537. height: 100rpx;
  538. position: relative;
  539. padding-right: 30rpx;
  540. }
  541. .action-btn {
  542. width: 160rpx;
  543. height: 60rpx;
  544. margin: 0;
  545. margin-left: 24rpx;
  546. padding: 0;
  547. text-align: center;
  548. line-height: 60rpx;
  549. font-size: $font-sm + 2rpx;
  550. color: $font-color-dark;
  551. background: #fff;
  552. border-radius: 100px;
  553. &:after {
  554. border-radius: 100px;
  555. }
  556. &.recom {
  557. color: $base-color;
  558. &:after {
  559. border-color: $base-color;
  560. }
  561. }
  562. &.evaluate {
  563. color: $color-yellow;
  564. &:after {
  565. border-color: $color-yellow;
  566. }
  567. }
  568. }
  569. }
  570. /* load-more */
  571. .uni-load-more {
  572. display: flex;
  573. flex-direction: row;
  574. height: 80rpx;
  575. align-items: center;
  576. justify-content: center;
  577. }
  578. .uni-load-more__text {
  579. font-size: 28rpx;
  580. color: #999;
  581. }
  582. .uni-load-more__img {
  583. height: 24px;
  584. width: 24px;
  585. margin-right: 10px;
  586. }
  587. .uni-load-more__img>view {
  588. position: absolute;
  589. }
  590. .uni-load-more__img>view view {
  591. width: 6px;
  592. height: 2px;
  593. border-top-left-radius: 1px;
  594. border-bottom-left-radius: 1px;
  595. background: #999;
  596. position: absolute;
  597. opacity: 0.2;
  598. transform-origin: 50%;
  599. animation: load 1.56s ease infinite;
  600. }
  601. .uni-load-more__img>view view:nth-child(1) {
  602. transform: rotate(90deg);
  603. top: 2px;
  604. left: 9px;
  605. }
  606. .uni-load-more__img>view view:nth-child(2) {
  607. transform: rotate(180deg);
  608. top: 11px;
  609. right: 0;
  610. }
  611. .uni-load-more__img>view view:nth-child(3) {
  612. transform: rotate(270deg);
  613. bottom: 2px;
  614. left: 9px;
  615. }
  616. .uni-load-more__img>view view:nth-child(4) {
  617. top: 11px;
  618. left: 0;
  619. }
  620. .load1,
  621. .load2,
  622. .load3 {
  623. height: 24px;
  624. width: 24px;
  625. }
  626. .load2 {
  627. transform: rotate(30deg);
  628. }
  629. .load3 {
  630. transform: rotate(60deg);
  631. }
  632. .load1 view:nth-child(1) {
  633. animation-delay: 0s;
  634. }
  635. .load2 view:nth-child(1) {
  636. animation-delay: 0.13s;
  637. }
  638. .load3 view:nth-child(1) {
  639. animation-delay: 0.26s;
  640. }
  641. .load1 view:nth-child(2) {
  642. animation-delay: 0.39s;
  643. }
  644. .load2 view:nth-child(2) {
  645. animation-delay: 0.52s;
  646. }
  647. .load3 view:nth-child(2) {
  648. animation-delay: 0.65s;
  649. }
  650. .load1 view:nth-child(3) {
  651. animation-delay: 0.78s;
  652. }
  653. .load2 view:nth-child(3) {
  654. animation-delay: 0.91s;
  655. }
  656. .load3 view:nth-child(3) {
  657. animation-delay: 1.04s;
  658. }
  659. .load1 view:nth-child(4) {
  660. animation-delay: 1.17s;
  661. }
  662. .load2 view:nth-child(4) {
  663. animation-delay: 1.3s;
  664. }
  665. .load3 view:nth-child(4) {
  666. animation-delay: 1.43s;
  667. }
  668. @-webkit-keyframes load {
  669. 0% {
  670. opacity: 1;
  671. }
  672. 100% {
  673. opacity: 0.2;
  674. }
  675. }
  676. .details {
  677. background: #fff;
  678. padding: 45rpx 30rpx;
  679. .details-box {
  680. margin: 15rpx 0;
  681. display: flex;
  682. justify-content: space-between;
  683. .details-left {
  684. font-size: 21rpx;
  685. font-weight: bold;
  686. color: #141E47;
  687. }
  688. .details-right {
  689. font-size: 21rpx;
  690. font-weight: bold;
  691. color: #141E47;
  692. }
  693. }
  694. }
  695. </style>