shoppingDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  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. 单份{{orderList.unit}}数
  85. </view>
  86. <view class="details-right">
  87. {{orderList.step*1}}{{orderList.unit}}
  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. {{orderList.unit}}+{{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" v-html="detail">
  144. </scroll-view>
  145. </swiper-item>
  146. <swiper-item class="tab-content">
  147. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData" v-html="problem">
  148. </scroll-view>
  149. </swiper-item>
  150. </swiper>
  151. <view class="lala">
  152. <!-- <uni-number-box class="step" :value="num" :disabled="false" @eventChange="numberChange"></uni-number-box> -->
  153. <view class="buy" @click="buy()">
  154. 立即购买
  155. </view>
  156. </view>
  157. </view>
  158. </template>
  159. <script>
  160. import {
  161. miningDateils,
  162. buyMining
  163. } from '@/api/calculation.js';
  164. import uniNumberBox from '@/components/uni-number-box.vue';
  165. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  166. import empty from '@/components/empty';
  167. export default {
  168. components: {
  169. uniLoadMore,
  170. empty,
  171. uniNumberBox
  172. },
  173. data() {
  174. return {
  175. detail: '',
  176. problem: '',
  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({}, this.id).then(res => {
  240. console.log(res, '2222');
  241. obj.orderList = res.data
  242. obj.detail = res.data.detail
  243. if(res.data.detail!= null){
  244. obj.detail = res.data.detail.replace(/\<p/gi,'<p')
  245. }
  246. obj.problem = res.data.problem
  247. console.log(obj.orderList, '数据');
  248. })
  249. },
  250. numberChange(data) {
  251. let obj = this;
  252. obj.num = data.number;
  253. console.log(obj.num, '2222');
  254. },
  255. //顶部tab点击
  256. tabClick(index) {
  257. this.tabCurrentIndex = index;
  258. },
  259. //swiper 切换
  260. changeTab(e) {
  261. this.tabCurrentIndex = e.target.current;
  262. this.loadData('tabChange');
  263. },
  264. }
  265. }
  266. </script>
  267. <style lang="scss">
  268. page,
  269. .content {
  270. margin: 0;
  271. padding: 0;
  272. height: 100%;
  273. width: 100%;
  274. background: #F5F5F5;
  275. }
  276. .lala {
  277. display: flex;
  278. justify-content: space-around;
  279. .buy {
  280. width: 338rpx;
  281. height: 65rpx;
  282. background: #FF6600;
  283. border-radius: 10rpx;
  284. font-size: 27rpx;
  285. font-family: PingFang SC;
  286. font-weight: bold;
  287. color: #FFFFFF;
  288. line-height: 65rpx;
  289. text-align: center;
  290. }
  291. }
  292. .top {
  293. padding-top: 50rpx;
  294. background: #FFFFFF;
  295. }
  296. .banner-img {
  297. margin: 0 auto;
  298. margin-bottom: 50rpx;
  299. width: 386rpx;
  300. height: 289rpx;
  301. image {
  302. width: 100%;
  303. height: 100%;
  304. }
  305. }
  306. .banner-title {
  307. background: #FFFFFF;
  308. padding: 30rpx;
  309. display: flex;
  310. justify-content: space-between;
  311. .title {
  312. display: flex;
  313. align-items: center;
  314. .img {
  315. width: 32rpx;
  316. height: 32rpx;
  317. // background: #FF6600;
  318. border-radius: 50%;
  319. image {
  320. width: 100%;
  321. height: 100%;
  322. }
  323. }
  324. .tit {
  325. margin-left: 10rpx;
  326. display: flex;
  327. flex-direction: column;
  328. justify-content: center;
  329. align-items: center;
  330. .text {
  331. font-size: 19rpx;
  332. font-family: PingFang SC;
  333. font-weight: bold;
  334. color: #141E47;
  335. }
  336. }
  337. }
  338. }
  339. .xuangou-box {
  340. background: #FFFFFF;
  341. margin: 15rpx 0;
  342. display: flex;
  343. justify-content: space-between;
  344. padding: 30rpx;
  345. .xuangou-left {
  346. display: flex;
  347. align-items: center;
  348. .package {
  349. font-size: 27rpx;
  350. font-weight: bold;
  351. color: #141E47;
  352. // line-height: 98rpx;
  353. }
  354. .package-title {
  355. font-size: 16rpx;
  356. font-weight: bold;
  357. color: #FF6600;
  358. width: 120rpx;
  359. margin-left: 10rpx;
  360. background: #FFF3EB;
  361. border: 1px solid #FF6600;
  362. text-align: center;
  363. padding: 3rpx 9rpx;
  364. }
  365. }
  366. .xuangou-right {
  367. color: #999999;
  368. }
  369. }
  370. .navbar {
  371. display: flex;
  372. height: 40px;
  373. padding: 0 5px;
  374. background: #fff;
  375. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  376. position: relative;
  377. z-index: 10;
  378. .nav-item {
  379. flex: 1;
  380. display: flex;
  381. justify-content: center;
  382. align-items: center;
  383. height: 100%;
  384. font-size: 15px;
  385. color: #9A9EAE;
  386. position: relative;
  387. &.current {
  388. color: #FF6600;
  389. &:after {
  390. content: '';
  391. position: absolute;
  392. left: 50%;
  393. bottom: 0;
  394. transform: translateX(-50%);
  395. width: 44px;
  396. height: 0;
  397. border-bottom: 2px solid #FF6600;
  398. }
  399. }
  400. }
  401. }
  402. .swiper-box {
  403. height: 500rpx;
  404. }
  405. .tab-content {
  406. height: 500rpx;
  407. }
  408. .list-scroll-content {
  409. height: 500rpx;
  410. }
  411. .uni-swiper-item {
  412. height: auto;
  413. }
  414. .order-item {
  415. display: flex;
  416. flex-direction: column;
  417. padding-left: 30rpx;
  418. background: #fff;
  419. margin-top: 16rpx;
  420. .i-top {
  421. display: flex;
  422. align-items: center;
  423. height: 80rpx;
  424. padding-right: 30rpx;
  425. font-size: $font-base;
  426. color: $font-color-dark;
  427. position: relative;
  428. .time {
  429. flex: 1;
  430. }
  431. .state {
  432. color: $base-color;
  433. }
  434. .del-btn {
  435. padding: 10rpx 0 10rpx 36rpx;
  436. font-size: $font-lg;
  437. color: $font-color-light;
  438. position: relative;
  439. &:after {
  440. content: '';
  441. width: 0;
  442. height: 30rpx;
  443. border-left: 1px solid $border-color-dark;
  444. position: absolute;
  445. left: 20rpx;
  446. top: 50%;
  447. transform: translateY(-50%);
  448. }
  449. }
  450. }
  451. /* 多条商品 */
  452. .goods-box {
  453. height: 160rpx;
  454. padding: 20rpx 0;
  455. white-space: nowrap;
  456. .goods-item {
  457. width: 120rpx;
  458. height: 120rpx;
  459. display: inline-block;
  460. margin-right: 24rpx;
  461. }
  462. .goods-img {
  463. display: block;
  464. width: 100%;
  465. height: 100%;
  466. }
  467. }
  468. /* 单条商品 */
  469. .goods-box-single {
  470. display: flex;
  471. padding: 20rpx 0;
  472. .goods-img {
  473. display: block;
  474. width: 120rpx;
  475. height: 120rpx;
  476. }
  477. .right {
  478. flex: 1;
  479. display: flex;
  480. flex-direction: column;
  481. padding: 0 30rpx 0 24rpx;
  482. overflow: hidden;
  483. .row {
  484. margin-top: 10rpx;
  485. }
  486. .row_title {
  487. padding: 5rpx 10rpx;
  488. background-color: #dddddd;
  489. border-radius: 10rpx;
  490. font-size: 22rpx;
  491. color: #ffffff;
  492. }
  493. .title {
  494. font-size: $font-base + 2rpx;
  495. color: $font-color-dark;
  496. line-height: 1;
  497. width: 80%;
  498. }
  499. .attr-box {
  500. display: flex;
  501. justify-content: flex-end;
  502. font-size: $font-sm + 2rpx;
  503. color: $font-color-light;
  504. }
  505. .price {
  506. display: inline;
  507. font-size: $font-base + 2rpx;
  508. color: $font-color-dark;
  509. &:before {
  510. content: '¥';
  511. font-size: $font-sm;
  512. }
  513. }
  514. }
  515. }
  516. .price-box {
  517. display: flex;
  518. justify-content: flex-end;
  519. align-items: baseline;
  520. padding: 20rpx 30rpx;
  521. font-size: $font-sm + 2rpx;
  522. color: $font-color-light;
  523. .num {
  524. margin: 0 8rpx;
  525. color: $font-color-dark;
  526. }
  527. .price {
  528. font-size: $font-lg;
  529. color: $font-color-dark;
  530. &:before {
  531. content: '¥';
  532. font-size: $font-sm;
  533. margin: 0 2rpx 0 8rpx;
  534. }
  535. }
  536. }
  537. .action-box {
  538. display: flex;
  539. justify-content: flex-end;
  540. align-items: center;
  541. height: 100rpx;
  542. position: relative;
  543. padding-right: 30rpx;
  544. }
  545. .action-btn {
  546. width: 160rpx;
  547. height: 60rpx;
  548. margin: 0;
  549. margin-left: 24rpx;
  550. padding: 0;
  551. text-align: center;
  552. line-height: 60rpx;
  553. font-size: $font-sm + 2rpx;
  554. color: $font-color-dark;
  555. background: #fff;
  556. border-radius: 100px;
  557. &:after {
  558. border-radius: 100px;
  559. }
  560. &.recom {
  561. color: $base-color;
  562. &:after {
  563. border-color: $base-color;
  564. }
  565. }
  566. &.evaluate {
  567. color: $color-yellow;
  568. &:after {
  569. border-color: $color-yellow;
  570. }
  571. }
  572. }
  573. }
  574. /* load-more */
  575. .uni-load-more {
  576. display: flex;
  577. flex-direction: row;
  578. height: 80rpx;
  579. align-items: center;
  580. justify-content: center;
  581. }
  582. .uni-load-more__text {
  583. font-size: 28rpx;
  584. color: #999;
  585. }
  586. .uni-load-more__img {
  587. height: 24px;
  588. width: 24px;
  589. margin-right: 10px;
  590. }
  591. .uni-load-more__img>view {
  592. position: absolute;
  593. }
  594. .uni-load-more__img>view view {
  595. width: 6px;
  596. height: 2px;
  597. border-top-left-radius: 1px;
  598. border-bottom-left-radius: 1px;
  599. background: #999;
  600. position: absolute;
  601. opacity: 0.2;
  602. transform-origin: 50%;
  603. animation: load 1.56s ease infinite;
  604. }
  605. .uni-load-more__img>view view:nth-child(1) {
  606. transform: rotate(90deg);
  607. top: 2px;
  608. left: 9px;
  609. }
  610. .uni-load-more__img>view view:nth-child(2) {
  611. transform: rotate(180deg);
  612. top: 11px;
  613. right: 0;
  614. }
  615. .uni-load-more__img>view view:nth-child(3) {
  616. transform: rotate(270deg);
  617. bottom: 2px;
  618. left: 9px;
  619. }
  620. .uni-load-more__img>view view:nth-child(4) {
  621. top: 11px;
  622. left: 0;
  623. }
  624. .load1,
  625. .load2,
  626. .load3 {
  627. height: 24px;
  628. width: 24px;
  629. }
  630. .load2 {
  631. transform: rotate(30deg);
  632. }
  633. .load3 {
  634. transform: rotate(60deg);
  635. }
  636. .load1 view:nth-child(1) {
  637. animation-delay: 0s;
  638. }
  639. .load2 view:nth-child(1) {
  640. animation-delay: 0.13s;
  641. }
  642. .load3 view:nth-child(1) {
  643. animation-delay: 0.26s;
  644. }
  645. .load1 view:nth-child(2) {
  646. animation-delay: 0.39s;
  647. }
  648. .load2 view:nth-child(2) {
  649. animation-delay: 0.52s;
  650. }
  651. .load3 view:nth-child(2) {
  652. animation-delay: 0.65s;
  653. }
  654. .load1 view:nth-child(3) {
  655. animation-delay: 0.78s;
  656. }
  657. .load2 view:nth-child(3) {
  658. animation-delay: 0.91s;
  659. }
  660. .load3 view:nth-child(3) {
  661. animation-delay: 1.04s;
  662. }
  663. .load1 view:nth-child(4) {
  664. animation-delay: 1.17s;
  665. }
  666. .load2 view:nth-child(4) {
  667. animation-delay: 1.3s;
  668. }
  669. .load3 view:nth-child(4) {
  670. animation-delay: 1.43s;
  671. }
  672. @-webkit-keyframes load {
  673. 0% {
  674. opacity: 1;
  675. }
  676. 100% {
  677. opacity: 0.2;
  678. }
  679. }
  680. .details {
  681. background: #fff;
  682. padding: 45rpx 30rpx;
  683. .details-box {
  684. margin: 15rpx 0;
  685. display: flex;
  686. justify-content: space-between;
  687. .details-left {
  688. font-size: 21rpx;
  689. font-weight: bold;
  690. color: #141E47;
  691. }
  692. .details-right {
  693. font-size: 21rpx;
  694. font-weight: bold;
  695. color: #141E47;
  696. }
  697. }
  698. }
  699. </style>