box_info.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. <template>
  2. <view class="index">
  3. <view class="aa">
  4. <view class="indextop">
  5. <view class="" @click="back">
  6. <image src="@/static/2.png" mode="widthFix" style="width: 32rpx;"></image>
  7. </view>
  8. <view class="">
  9. <!-- <image src="@/static/index/9.png" mode="widthFix" style="width: 44rpx;"></image> -->
  10. </view>
  11. </view>
  12. <view class="">
  13. <view style="height: 50rpx;"></view>
  14. <view class="goods">
  15. <image :src="details.box_img" mode="widthFix">
  16. </image>
  17. </view>
  18. </view>
  19. <!-- 台子 -->
  20. <view class="Table">
  21. <image src="/static/index/details/table.png" mode="widthFix" style="width: 750rpx;"></image>
  22. </view>
  23. <!-- 台子 结束-->
  24. <!-- 限量 -->
  25. </view>
  26. <view class="name">
  27. <view class="list_title">
  28. <text>¥</text>{{ details.price }}
  29. </view>
  30. <view class="num-pric">
  31. <view class="">
  32. {{ details.box_name }}
  33. </view>
  34. <view>
  35. <view class="num_box">
  36. <view>限量</view>
  37. <view>{{ details.num }}份</view>
  38. </view>
  39. <!-- <view class="num_box">
  40. <view>剩余</view>
  41. <view>{{ details.sell_num || 0 }}份</view>
  42. </view> -->
  43. </view>
  44. </view>
  45. </view>
  46. <!-- <view class="brand">
  47. <view class="">
  48. <image src="/static/index/013.png" mode="widthFix" style="width: 100%;"></image>
  49. </view>
  50. <view class="">
  51. <view class="" v-for="(item,index) in coll" :key="index">
  52. <view class="">
  53. <view class="">
  54. <image :src="item.coll.cover" mode="" style="width: 188rpx;height: 124rpx;"></image>
  55. </view>
  56. </view>
  57. <view class="">
  58. <view class="">
  59. {{item.coll.name}}
  60. </view>
  61. <view class="">
  62. <view class="">
  63. 概率{{item.virtual}}%
  64. </view>
  65. <view class="" style="margin-left: 20rpx;">
  66. 原价 {{item.coll.price}}
  67. </view>
  68. </view>
  69. </view>
  70. <view class="">
  71. <image src="/static/index/014.png" mode="" style="width: 156rpx;height: 124rpx;"></image>
  72. </view>
  73. </view>
  74. </view>
  75. </view> -->
  76. <view class="desc">
  77. <view class="">
  78. 藏品故事
  79. </view>
  80. <view class="" v-html="content" style="width: 100%;">
  81. </view>
  82. </view>
  83. <view class="desc">
  84. <view class="" style="color: #fff;">
  85. 购买须知
  86. </view>
  87. <view class="">
  88. 为更好服务平台的各位会员,特此公告数字藏品的二次交易细则。鉴于
  89. 不同属性的数字艺术的二次交易细则各有不同,请各位用户务必审慎阅
  90. 读并同意相关规则后进行相应操作,以免造成不必要损失。<br />
  91. 1、依据我国法律要求,特定条件下的数宇藏品的二次交易不支持任何
  92. 形式的变相炒作,我们坚决反对数字藏品炒作、场外交易、欺诈,或以
  93. 任何其他非法、侵权方式使用的违法违规行为,请大家注意甄别上述涉
  94. 嫌网络欺诈的行为及其相关风险。<br />
  95. 2、数字藏品为虛拟数字商品,仅限20周岁(不含)以上,60周岁
  96. (含)以下,已实名认证的中国大陆用户购买。<br />
  97. 3、本商品一经出售不支持退货。
  98. </view>
  99. </view>
  100. <view class="btn" @click="showRecharge=true">
  101. <view class="buy">
  102. <view class="" v-if="$store.state.is_send==1"
  103. @click="href('/pages/index/Details/passon/passon?id='+openid+'&goodsname='+name+'&img='+img+'&type=2')">
  104. 转赠
  105. </view>
  106. </view>
  107. <!-- 价格 -->
  108. <!-- 可以购买状态 -->
  109. <view class="buy">
  110. <view class="" @click="openbox">
  111. 开启
  112. </view>
  113. </view>
  114. <view class="buy" v-if="$store.state.is_mark==1">
  115. <view class="" @click="show_resale=true">
  116. 转售
  117. </view>
  118. </view>
  119. </view>
  120. <u-popup :show="show_resale" mode="center" :round="10">
  121. <view class="">
  122. <view class="resale_box">
  123. <view class="resale_title">
  124. 请输入转售价格
  125. </view>
  126. <view class="resale_input">
  127. <my-input :reserve="false" :ph="'请输入转售金额'" :type="'number'" :label="'元'"
  128. @input_content="changeMoney"></my-input>
  129. </view>
  130. <view class="resale_input" style="margin-top: 32rpx;">
  131. <my-input :reserve="false" :ph="'请输入支付密码'" :type="'password'" :label="''"
  132. @input_content="changePass"></my-input>
  133. </view>
  134. <view class="resale_btnbox">
  135. <view class="" @click="show_resale=false">
  136. 取消
  137. </view>
  138. <view class="" @click="resale">
  139. 确定
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </u-popup>
  145. <!-- //开盒子动画 -->
  146. <!-- v-show="showaction" -->
  147. <view class="action" v-show="showaction"></view>
  148. <!-- //开盒子动画 -->
  149. <!-- //开盒动画之后的背景 -->
  150. <view class="action_bcg colorBlack" @click="href('/pages/collection/collection')" v-if="showaction_bcg">
  151. <view class="action_title">
  152. 恭喜获得
  153. </view>
  154. <view class="tips_head">
  155. <!-- <view class="line_left"></view> -->
  156. <view class="" style="text-align: center; margin-top: 30rpx;">{{result_name}}</view>
  157. <!-- <view class="line_right"></view> -->
  158. </view>
  159. <view class="box_img" style="width: 445rpx;margin: 30rpx auto;">
  160. <image :src="result_img" mode="" style="width:445rpx;height:445rpx;"></image>
  161. </view>
  162. <view class="tips_close" style="text-align: center;">
  163. 按任意地方查看该藏品
  164. </view>
  165. </view>
  166. <!-- //开盒动画之后的背景 结束 -->
  167. </view>
  168. </template>
  169. <script>
  170. import myInput from "@/components/my/input_sz.vue"
  171. import navHeader from "@/components/my/nav_header.vue"
  172. export default {
  173. components: {
  174. myInput,
  175. navHeader
  176. },
  177. onLoad(e) {
  178. this.openid = e.openid
  179. this.id = e.id
  180. },
  181. onShow() {
  182. this.get_box_info()
  183. },
  184. data() {
  185. return {
  186. id: "", //藏品或者盲盒id
  187. name: "", //藏品或者盲盒详情
  188. img: "", //盲盒图片
  189. time: "", //盲盒获取时间
  190. showaction: false, //动画开启状态
  191. showaction_bcg: false, //动画背景状态
  192. openid: "", //开盲盒需要的id
  193. result_img: "", //开盲盒之后中奖的图片
  194. result_name: "", //开盲盒之后的名字
  195. content: "", //内容详情
  196. //藏品或者盲盒详情
  197. show_resale: false, //是否显示转售弹框
  198. resale_money: "", //转售金额
  199. pass: "",
  200. details: {}
  201. }
  202. },
  203. methods: {
  204. //提交转售
  205. resale() {
  206. this.$api.pop("提交中", "loading")
  207. // type1藏品 2盲盒
  208. this.api.resale(this.resale_money, 2, this.openid, this.pass).then(res => {
  209. if (res.code == 1) {
  210. this.$api.pop("转售成功")
  211. setTimeout(() => {
  212. this.$api.totabar("/pages/market/market")
  213. }, 500)
  214. }
  215. console.log(res)
  216. })
  217. },
  218. changeMoney(e) {
  219. this.resale_money = e
  220. },
  221. changePass(e) {
  222. this.pass = e;
  223. },
  224. //开盲盒子
  225. openbox() {
  226. uni.showToast({
  227. title: "加载中",
  228. icon: "loading"
  229. })
  230. this.api.open_box(this.openid).then(res => {
  231. if (res.code == 1) {
  232. this.result_img = res.data.cover
  233. this.result_name = res.data.name
  234. uni.hideToast()
  235. this.showaction = true
  236. setTimeout(() => {
  237. this.showaction = false
  238. this.showaction_bcg = true
  239. }, 2000)
  240. }
  241. console.log(res)
  242. })
  243. },
  244. //获取盲盒详情
  245. get_box_info() {
  246. this.api.box_info(this.id).then(res => {
  247. this.details = res.data
  248. this.name = res.data.box_name
  249. this.img = res.data.box_img
  250. this.time = res.data.create_at
  251. this.id = res.data.id
  252. this.content = this.$api.turnhtml(res.data.desc)
  253. })
  254. }
  255. }
  256. }
  257. </script>
  258. <style lang="less" scoped>
  259. .index {
  260. padding-bottom: 200rpx;
  261. .name {
  262. width: 686rpx;
  263. font-size: 40rpx;
  264. box-sizing: border-box;
  265. border-radius: 24rpx;
  266. box-sizing: border-box;
  267. background: #1D1F1E;
  268. z-index: 9999;
  269. position: relative;
  270. padding-bottom: 24rpx;
  271. margin: 32rpx auto 24rpx;
  272. .num-pric {
  273. background: #171918;
  274. width: 590rpx;
  275. margin: auto;
  276. border-radius: 24rpx;
  277. padding-bottom: 24rpx;
  278. padding: 24rpx 0 24rpx 24rpx;
  279. >view:first-child {
  280. font-size: 32rpx;
  281. color: #fff;
  282. font-weight: 500;
  283. }
  284. >view:last-child {
  285. display: flex;
  286. font-size: 24rpx;
  287. text-align: center;
  288. line-height: 40rpx;
  289. .num_box {
  290. display: flex;
  291. margin-top: 24rpx;
  292. margin-right: 24rpx;
  293. >view:first-child {
  294. background: #F4E0BD;
  295. width: 72rpx;
  296. height: 40rpx;
  297. color: #000;
  298. border-radius: 8rpx;
  299. }
  300. >view:last-child {
  301. background: #4B4B4B;
  302. height: 40rpx;
  303. padding: 0 5rpx;
  304. color: #F4E0BD;
  305. border-radius: 8rpx;
  306. margin-left: 8rpx;
  307. }
  308. }
  309. }
  310. }
  311. .list_title {
  312. padding: 20rpx 0 20rpx 32rpx;
  313. font-size: 40rpx;
  314. font-family: Tahoma-Bold, Tahoma;
  315. font-weight: bold;
  316. background: linear-gradient(180deg, #69FF60 0%, #0C9D5B 100%);
  317. -webkit-background-clip: text;
  318. -webkit-text-fill-color: transparent;
  319. }
  320. }
  321. .desc {
  322. width: 622rpx;
  323. margin: auto;
  324. font-size: 32rpx;
  325. background: #1D1F1E;
  326. padding: 24rpx 32rpx 32rpx 32rpx;
  327. border-radius: 24rpx;
  328. margin-top: 24rpx;
  329. color: #fff;
  330. >view:first-child {
  331. font-weight: bold;
  332. margin-bottom: 16rpx;
  333. }
  334. >view:last-child {
  335. font-size: 26rpx;
  336. color: #fff;
  337. margin: auto;
  338. }
  339. }
  340. }
  341. /deep/.u-popup__content {
  342. background: #1D1F1E;
  343. }
  344. .resale_box {
  345. /* width: 540rpx; */
  346. /* padding: 0 10rpx; */
  347. background: #1D1F1E;
  348. border-radius: 20rpx;
  349. }
  350. .resale_title {
  351. text-align: center;
  352. margin: 65rpx auto;
  353. color: #fff;
  354. }
  355. .resale_btnbox {
  356. width: 710rpx;
  357. height: 88rpx;
  358. display: flex;
  359. justify-content: space-between;
  360. margin-top: 70rpx;
  361. margin-bottom: 70rpx;
  362. box-sizing: border-box;
  363. padding-left: 30rpx;
  364. padding-right: 30rpx;
  365. }
  366. .resale_btnbox>view {
  367. width: 290rpx;
  368. height: 78rpx;
  369. border-radius: 16rpx;
  370. text-align: center;
  371. font-size: 28rpx;
  372. line-height: 78rpx;
  373. }
  374. .resale_btnbox>view:first-child {
  375. color: #69FF60;
  376. border: 1px solid #69FF60;
  377. }
  378. .resale_btnbox>view:last-child {
  379. background: linear-gradient(180deg, #69FF60 0%, #0C9D5B 100%);
  380. color: #000;
  381. }
  382. .action {
  383. width: 100%;
  384. height: 100vh;
  385. position: fixed;
  386. left: 0;
  387. top: 0;
  388. background: url("@/static/openbox.gif");
  389. background-size: 100% 100%;
  390. z-index: 99999;
  391. }
  392. .action_bcg {
  393. width: 100%;
  394. height: 100vh;
  395. position: fixed;
  396. left: 0;
  397. top: 0;
  398. background: url("@/static/openbox_bcg.gif");
  399. background-size: 100% 100%;
  400. z-index: 999999;
  401. box-sizing: border-box;
  402. padding-top: 200rpx;
  403. }
  404. .action_title {
  405. text-align: center;
  406. font-size: 60rpx;
  407. font-weight: bolder;
  408. }
  409. .indextop {
  410. display: flex;
  411. justify-content: space-between;
  412. padding: 50rpx 32rpx 0;
  413. align-items: center;
  414. }
  415. .goods {
  416. width: 580rpx;
  417. margin: 0 auto 50rpx;
  418. -webkit-animation: ud 2s linear infinite;
  419. animation: ud 2s linear infinite;
  420. }
  421. .goods image {
  422. left: 0;
  423. top: 0;
  424. }
  425. .goods image:nth-child(1) {
  426. width: 580rpx;
  427. height: 580rpx;
  428. // border: 2rpx solid #0C0E0D;
  429. transform: rotateY(0deg) translateZ(10rpx);
  430. }
  431. .goods image:nth-child(2) {
  432. width: 16rpx;
  433. height: 432rpx;
  434. // border-left: 2rpx solid #0C0E0D;
  435. // border-right: 2rpx solid #0C0E0D;
  436. transform: rotateY(90deg) translateZ(422rpx);
  437. }
  438. .goods image:nth-child(3) {
  439. width: 428rpx;
  440. height: 428rpx;
  441. // border: 2rpx solid #0C0E0D;
  442. transform: rotateY(180deg) translateZ(10rpx);
  443. }
  444. .goods image:nth-child(4) {
  445. width: 16rpx;
  446. height: 432rpx;
  447. // border-left: 2rpx solid #0C0E0D;
  448. // border-right: 2rpx solid #0C0E0D;
  449. transform: rotateY(270deg) translateZ(10rpx);
  450. }
  451. .goods view {
  452. position: absolute;
  453. left: -20rpx;
  454. top: -20rpx;
  455. width: 382rpx;
  456. height: 382rpx;
  457. padding: 20px;
  458. // border: 6rpx solid white;
  459. border-radius: 16rpx;
  460. }
  461. .goods_full {
  462. margin-top: 44rpx;
  463. }
  464. .Table {
  465. text-align: center;
  466. margin-top: -30rpx;
  467. }
  468. .collection_info {
  469. width: 622rpx;
  470. height: 208rpx;
  471. border: 1px solid #DDDDDD;
  472. border-radius: 40rpx;
  473. margin: auto;
  474. padding: 0 32rpx;
  475. >view {
  476. height: 88rpx;
  477. line-height: 88rpx;
  478. display: flex;
  479. justify-content: space-between;
  480. align-items: center;
  481. >view:first-child {
  482. color: #434343;
  483. font-size: 28rpx;
  484. }
  485. >view:last-child {
  486. color: #000;
  487. font-size: 30rpx;
  488. image {
  489. margin-left: 8rpx;
  490. }
  491. }
  492. }
  493. >view:last-child {
  494. margin-top: 16rpx;
  495. }
  496. }
  497. .brand {
  498. padding: 0 32rpx;
  499. margin: 40rpx 0;
  500. >view {
  501. >view {
  502. display: flex;
  503. justify-content: space-between;
  504. width: 678rpx;
  505. height: 140rpx;
  506. align-items: center;
  507. border: 1px solid #EFEFEF;
  508. padding-left: 8rpx;
  509. margin-bottom: 20rpx;
  510. >view:nth-child(2) {
  511. >view:first-child {
  512. font-weight: bold;
  513. font-size: 32rpx;
  514. }
  515. >view:last-child {
  516. display: flex;
  517. font-size: 24rpx;
  518. justify-content: space-between;
  519. margin-top: 12rpx;
  520. }
  521. }
  522. }
  523. }
  524. }
  525. .btn {
  526. position: fixed;
  527. bottom: 0;
  528. height: 128rpx;
  529. /* background: rgba(0, 0, 0, .6); */
  530. z-index: 9999;
  531. background: #000;
  532. display: flex;
  533. box-sizing: border-box;
  534. padding: 0 20rpx;
  535. width: 100%;
  536. .bom_price {
  537. text {
  538. font-size: 36rpx;
  539. }
  540. font-size: 56rpx;
  541. }
  542. >view {
  543. align-self: center;
  544. }
  545. }
  546. .buy {
  547. width: 222rpx;
  548. height: 92rpx;
  549. border-radius: 164rpx;
  550. text-align: center;
  551. line-height: 92rpx;
  552. color: #000;
  553. font-size: 28rpx;
  554. letter-spacing: 4rpx;
  555. text-align: center;
  556. display: flex;
  557. margin-right: 20rpx;
  558. }
  559. .buy>view {
  560. align-self: center;
  561. width: 444rpx;
  562. height: 92rpx;
  563. border-radius: 92rpx;
  564. margin-left: auto;
  565. text-align: center;
  566. background: linear-gradient(180deg, #69FF60 0%, #0C9D5B 100%);
  567. color: #000;
  568. }
  569. .soldout {
  570. width: 240rpx;
  571. height: 84rpx;
  572. border-radius: 164rpx;
  573. margin-left: auto;
  574. text-align: center;
  575. line-height: 84rpx;
  576. font-size: 36rpx;
  577. letter-spacing: 4rpx;
  578. }
  579. .soon {
  580. width: 240rpx;
  581. height: 84rpx;
  582. /* background: #1C1C1E; */
  583. border-radius: 164rpx;
  584. margin-left: auto;
  585. text-align: center;
  586. /* color: #fff; */
  587. font-size: 34rpx;
  588. letter-spacing: 4rpx;
  589. text-align: center;
  590. display: flex;
  591. flex-direction: column;
  592. justify-content: center;
  593. }
  594. .soon>view:last-child {
  595. font-size: 24rpx;
  596. letter-spacing: 2rpx;
  597. }
  598. .passon {
  599. text-align: center;
  600. /* display: flex; */
  601. color: #fff;
  602. font-size: 30rpx;
  603. }
  604. @-webkit-keyframes ud {
  605. 25% {
  606. -webkit-transform: translateY(-10rpx);
  607. }
  608. 50%,
  609. 100% {
  610. -webkit-transform: translateY(0);
  611. }
  612. 75% {
  613. -webkit-transform: translateY(10rpx);
  614. }
  615. }
  616. @keyframes ud {
  617. 25% {
  618. transform: translateY(-10rpx);
  619. }
  620. 50%,
  621. 100% {
  622. transform: translateY(0);
  623. }
  624. 75% {
  625. transform: translateY(10rpx);
  626. }
  627. }
  628. </style>