porducthall.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <view class="container">
  3. <view class="carousel">
  4. <swiper indicator-dots :circular="true" duration="400">
  5. <swiper-item class="swiper-item" v-for="(item, index) in imageList" :key="index">
  6. <view class="image-wrapper"><image :src="item" class="loaded" mode="scaleToFill"></image></view>
  7. </swiper-item>
  8. </swiper>
  9. <view class="title flex">
  10. <view class="title-num">
  11. <text>¥</text>
  12. {{ info.hanging_price }}
  13. </view>
  14. <view class="title-time">挂售时间:{{ info.time }}</view>
  15. </view>
  16. </view>
  17. <view class="title-main flex">
  18. <view class="tm-left">
  19. <view class="tm-title clamp">{{ info.name }}</view>
  20. <view class="tm-people flex">
  21. <image class="people-image" src="../../static/img/people.png" mode=""></image>
  22. <view class="people-name">归属人:{{ info.user_nickname }}</view>
  23. </view>
  24. </view>
  25. <view class="tm-right flex">
  26. <!-- <view class="tmr-item" @click="isDjs()">
  27. <image class="tmr-image" src="../../static/img/shua.png" mode=""></image>
  28. <view class="tmr-font">刷新倒计时</view>
  29. </view> -->
  30. <view class="tmr-item" @click="nav('/pages/hall/history?id=' + id)">
  31. <image class="tmr-image1" src="../../static/img/yuan.png" mode=""></image>
  32. <view class="tmr-font">溯源</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="dz"></view>
  37. <!-- <view class="introduce">
  38. <view class="introduct-title">
  39. <image class="introduce-image" src="../../static/img/productIcon.png" mode=""></image>
  40. <view class="introduce-font">艺术品挂售交易平台</view>
  41. </view>
  42. <view class="introduct-main">
  43. <view class="im-item">
  44. <image class="im-image" src="../../static/img/jian.png" mode=""></image>
  45. <view class="im-font">大师作品</view>
  46. </view>
  47. <view class="im-item">
  48. <image class="im-image" src="../../static/img/zheng.png" mode=""></image>
  49. <view class="im-font">证书收藏</view>
  50. </view>
  51. <view class="im-item">
  52. <image class="im-image" src="../../static/img/gong.png" mode=""></image>
  53. <view class="im-font">自由交易</view>
  54. </view>
  55. </view>
  56. </view> -->
  57. <view class="dz"></view>
  58. <view class="explain">
  59. <view class="explain-title">商品挂售说明</view>
  60. <view class="explain-main">
  61. <view class="explainImage-box">
  62. <image class="explain-image-item" src="../../static/img/lc1.png" mode=""></image>
  63. <image class="explain-image-jiant" src="../../static/img/jingt.png" mode=""></image>
  64. <image class="explain-image-item" src="../../static/img/lc2.png" mode=""></image>
  65. <image class="explain-image-jiant" src="../../static/img/jingt.png" mode=""></image>
  66. <image class="explain-image-item" src="../../static/img/lc3.png" mode=""></image>
  67. <image class="explain-image-jiant" src="../../static/img/jingt.png" mode=""></image>
  68. <image class="explain-image-item" src="../../static/img/lc4.png" mode=""></image>
  69. </view>
  70. <view class="explainfont-box">
  71. <view class="explain-font-item">挂售商品</view>
  72. <view class="explain-font-item">支付货款</view>
  73. <view class="explain-font-item">卖家发货</view>
  74. <view class="explain-font-item">挂售/提货</view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="detail-desc">
  79. <view class="d-header"><text>商品详情</text></view>
  80. <rich-text class="detail-centent" :nodes="info.description"></rich-text>
  81. <view class="contentBottomHeight"></view>
  82. </view>
  83. <view class="bottom flex">
  84. <view class="bottom-item">
  85. <image class="bi-image" src="../../static/img/quan.png" mode=""></image>
  86. <view class="bottom-font">广告值</view>
  87. <!-- <view class="bottom-num">200</view> -->
  88. </view>
  89. <view class="shu"></view>
  90. <view class="bottom-item" @click="openKf()">
  91. <image class="bi-image" src="../../static/img/kf.png" mode=""></image>
  92. <view class="bottom-font">联系</view>
  93. <view class="bottom-num">客服</view>
  94. </view>
  95. <view class="btn" @click="buy()">{{ isbuy ? '立即购买' : countdown_time }}</view>
  96. </view>
  97. <uni-popup ref="popupkf" type="center">
  98. <view class="popup-box">
  99. <view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
  100. <view class="mian">
  101. <view class="delivery">
  102. <view class="title">已经为您定制专属客服</view>
  103. <image src="../../static/img/img010.png" mode=""></image>
  104. </view>
  105. <view class="nocancel">客服VX:{{ text }}</view>
  106. <view class="comfirm-box">
  107. <view class="cancel" @click="cancel">取消</view>
  108. <view class="comfirm" @click="comfirm(text)">复制微信</view>
  109. </view>
  110. </view>
  111. </view>
  112. </uni-popup>
  113. </view>
  114. </template>
  115. <script>
  116. import { details, purchase, count_down } from '@/api/hall.js';
  117. import { getTime } from '@/utils/rocessor.js';
  118. export default {
  119. data() {
  120. return {
  121. text: '123456',
  122. id: '',
  123. uid: '',
  124. name: '',
  125. peoplename: '',
  126. info: '',
  127. imageList: [],
  128. countdown_time: '',
  129. canbuy: 0, //结束时间
  130. isbuy: false,
  131. time: '', //进场时间
  132. timers: '' //延时器id
  133. };
  134. },
  135. onLoad(option) {
  136. this.id = option.id;
  137. this.uid = option.uid;
  138. this.name = option.name;
  139. this.peoplename = option.peoplename;
  140. },
  141. onShow() {
  142. this.loadData();
  143. this.isDjs();
  144. },
  145. onHide() {
  146. clearTimeout(this.timers);
  147. },
  148. // 监听页面卸载
  149. onUnload() {
  150. // 关闭倒计时
  151. clearTimeout(this.timers);
  152. },
  153. // 监听页面后退
  154. onBackPress() {
  155. // 关闭倒计时
  156. clearTimeout(this.timers);
  157. },
  158. methods: {
  159. isDjs() {
  160. clearTimeout(this.timers);
  161. count_down({ id: this.uid }).then(({ data }) => {
  162. this.canbuy = data.times;
  163. let day = getTime(this.canbuy * 1000).split(' ');
  164. this.time = day[1];
  165. this.counTime();
  166. });
  167. },
  168. counTime() {
  169. //获取当前时间
  170. let data = new Date();
  171. let newTime = data.getTime();
  172. //结束时间
  173. let end = this.canbuy;
  174. //时间差
  175. let leftTime = end * 1000 - newTime;
  176. console.log(leftTime);
  177. console.log(this.la, '2222222');
  178. if (leftTime <= 0) {
  179. console.log('已结束');
  180. this.isbuy = true;
  181. return;
  182. }
  183. //定义保存倒计时时间
  184. let m, s;
  185. if (leftTime >= 0) {
  186. m = Math.floor((leftTime / 1000 / 60) % 60);
  187. s = Math.floor((leftTime / 1000) % 60);
  188. this.second = s;
  189. this.la = m + s;
  190. //倒计时赋值view
  191. this.countdown_time = `${m}:${s}`;
  192. this.timers = setTimeout(this.counTime, 1000);
  193. //显示动态时间效果
  194. if (s < 10) {
  195. return (this.countdown_time = `${m}:0${s}`);
  196. this.timers = setTimeout(this.counTime, 1000);
  197. }
  198. if (m < 10) {
  199. return (this.countdown_time = `0${m}:${s}`);
  200. this.timers = setTimeout(this.counTime, 1000);
  201. }
  202. }
  203. },
  204. loadData() {
  205. details({ product_id: this.id })
  206. .then(({ data }) => {
  207. console.log(data);
  208. this.imageList = data.slider_image;
  209. if (data.description != '') {
  210. data.description = data.description.replace(/\<img/gi, '<img class="rich-img"');
  211. }
  212. this.info = data;
  213. })
  214. .catch(e => {});
  215. },
  216. // 打开客服
  217. openKf() {
  218. this.$refs.popupkf.open();
  219. },
  220. // 关闭客服
  221. cancel() {
  222. this.$refs.popupkf.close();
  223. },
  224. nav(url) {
  225. uni.navigateTo({
  226. url
  227. });
  228. },
  229. buy() {
  230. if (!this.isbuy) {
  231. return this.$api.msg('还未到购买时间');
  232. }
  233. purchase({ product_id: this.id })
  234. .then(({ data }) => {
  235. uni.navigateTo({
  236. url: '/pages/money/paySuccess?type=1&uid=' + this.uid + +'&name=' + this.name + '&peoplename=' + this.peoplename
  237. });
  238. console.log(data);
  239. })
  240. .catch(e => {
  241. console.log(e);
  242. });
  243. }
  244. }
  245. };
  246. </script>
  247. <style lang="less">
  248. .carousel {
  249. width: 750rpx;
  250. height: 710rpx;
  251. position: relative;
  252. swiper {
  253. height: 100%;
  254. }
  255. .image-wrapper {
  256. width: 100%;
  257. height: 100%;
  258. }
  259. .swiper-item {
  260. display: flex;
  261. justify-content: center;
  262. align-content: center;
  263. // height: 750rpx;
  264. height: 710rpx;
  265. overflow: hidden;
  266. image {
  267. width: 100%;
  268. height: 100%;
  269. }
  270. }
  271. .title {
  272. background: linear-gradient(90deg, #ef4e51 0%, #f4713b 100%);
  273. width: 750rpx;
  274. position: absolute;
  275. bottom: 0;
  276. padding: 30rpx;
  277. .title-num {
  278. font-size: 50rpx;
  279. font-family: PingFang SC;
  280. font-weight: bold;
  281. color: #ffffff;
  282. text {
  283. font-size: 30rpx;
  284. }
  285. }
  286. .title-time {
  287. font-size: 28rpx;
  288. font-family: PingFang SC;
  289. font-weight: bold;
  290. color: #ffffff;
  291. }
  292. }
  293. }
  294. .title-main {
  295. padding: 30rpx 30rpx 30rpx 22rpx;
  296. .tm-left {
  297. width: 50%;
  298. .tm-title {
  299. width: 100%;
  300. font-size: 30rpx;
  301. font-family: PingFang SC;
  302. font-weight: bold;
  303. color: #1d2023;
  304. }
  305. .tm-people {
  306. margin-top: 30rpx;
  307. justify-content: flex-start;
  308. .people-image {
  309. width: 22rpx;
  310. height: 22rpx;
  311. flex-shrink: 0;
  312. }
  313. .people-name {
  314. margin-left: 12rpx;
  315. font-size: 24rpx;
  316. font-family: PingFang SC;
  317. font-weight: 500;
  318. color: #333333;
  319. }
  320. }
  321. }
  322. .tm-right {
  323. justify-content: flex-end;
  324. .tmr-item {
  325. margin-left: 38rpx;
  326. display: flex;
  327. flex-direction: column;
  328. align-items: center;
  329. .tmr-image {
  330. width: 42rpx;
  331. height: 38rpx;
  332. }
  333. .tmr-image1 {
  334. width: 42rpx;
  335. height: 42rpx;
  336. }
  337. .tmr-font {
  338. margin-top: 16rpx;
  339. font-size: 24rpx;
  340. font-family: PingFang SC;
  341. font-weight: 500;
  342. color: #333333;
  343. }
  344. }
  345. }
  346. }
  347. .dz {
  348. width: 750rpx;
  349. height: 20rpx;
  350. background: #f8f6f6;
  351. }
  352. .introduce {
  353. padding: 40rpx 24rpx;
  354. .introduct-title {
  355. display: flex;
  356. align-items: center;
  357. .introduce-image {
  358. width: 36rpx;
  359. height: 36rpx;
  360. }
  361. .introduce-font {
  362. margin-left: 10rpx;
  363. font-size: 28rpx;
  364. font-family: PingFang SC;
  365. font-weight: bold;
  366. color: #333333;
  367. }
  368. }
  369. .introduct-main {
  370. display: flex;
  371. justify-content: space-between;
  372. margin-top: 26rpx;
  373. .im-item {
  374. display: flex;
  375. align-items: center;
  376. .im-image {
  377. width: 44rpx;
  378. height: 44rpx;
  379. }
  380. .im-font {
  381. margin-left: 6rpx;
  382. font-size: 28rpx;
  383. font-family: PingFang SC;
  384. font-weight: bold;
  385. color: #333333;
  386. }
  387. }
  388. }
  389. }
  390. .explain {
  391. padding: 40rpx 34rpx 46rpx 34rpx;
  392. .explain-title {
  393. font-size: 32rpx;
  394. font-family: PingFang SC;
  395. font-weight: bold;
  396. color: #333333;
  397. }
  398. .explain-main {
  399. margin-top: 52rpx;
  400. .explainImage-box {
  401. display: flex;
  402. justify-content: space-around;
  403. align-items: center;
  404. .explain-image-item {
  405. width: 42rpx;
  406. height: 40rpx;
  407. }
  408. .explain-image-jiant {
  409. width: 38rpx;
  410. height: 10rpx;
  411. }
  412. }
  413. .explainfont-box {
  414. margin-top: 20rpx;
  415. display: flex;
  416. justify-content: space-between;
  417. .explain-font-item {
  418. font-size: 28rpx;
  419. font-family: PingFang SC;
  420. font-weight: 500;
  421. color: #333333;
  422. }
  423. }
  424. }
  425. }
  426. .detail-desc {
  427. background: #fff;
  428. margin-top: 16rpx;
  429. /deep/ img {
  430. max-width: 100% !important;
  431. display: inline !important;
  432. }
  433. /deep/ div {
  434. max-width: 100% !important;
  435. }
  436. .d-header {
  437. display: flex;
  438. justify-content: center;
  439. align-items: center;
  440. height: 80rpx;
  441. font-size: 30rpx;
  442. color: #303133;
  443. position: relative;
  444. text {
  445. padding: 0 20rpx;
  446. background: #fff;
  447. position: relative;
  448. z-index: 1;
  449. }
  450. &:after {
  451. position: absolute;
  452. left: 50%;
  453. top: 50%;
  454. transform: translateX(-50%);
  455. width: 300rpx;
  456. height: 0;
  457. content: '';
  458. border-bottom: 1px solid #ccc;
  459. }
  460. }
  461. }
  462. .bottom {
  463. position: fixed;
  464. z-index: 10;
  465. bottom: 0;
  466. background: #ffffff;
  467. width: 750rpx;
  468. height: 146rpx;
  469. justify-content: flex-start;
  470. .bottom-item {
  471. margin-left: 42rpx;
  472. display: flex;
  473. flex-direction: column;
  474. align-items: center;
  475. .bi-image {
  476. width: 38rpx;
  477. height: 34rpx;
  478. }
  479. .bottom-font {
  480. margin-top: 14rpx;
  481. font-size: 24rpx;
  482. font-family: PingFang SC;
  483. font-weight: bold;
  484. color: #333333;
  485. }
  486. .bottom-num {
  487. line-height: 1;
  488. font-size: 24rpx;
  489. font-family: PingFang SC;
  490. font-weight: bold;
  491. color: #333333;
  492. }
  493. }
  494. .shu {
  495. margin-left: 38rpx;
  496. width: 2px;
  497. height: 74rpx;
  498. background: #c0bfc0;
  499. }
  500. .btn {
  501. margin-left: 40rpx;
  502. width: 430rpx;
  503. height: 80rpx;
  504. background: #fd3b39;
  505. border-radius: 20rpx;
  506. text-align: center;
  507. font-size: 34rpx;
  508. font-family: PingFang SC;
  509. font-weight: bold;
  510. color: #ffffff;
  511. line-height: 80rpx;
  512. }
  513. }
  514. .popup-box {
  515. width: 522rpx;
  516. height: 605rpx;
  517. background-color: #ffffff;
  518. border-radius: 20rpx;
  519. position: relative;
  520. .img {
  521. position: relative;
  522. top: -56rpx;
  523. left: 0;
  524. width: 522rpx;
  525. height: 132rpx;
  526. display: flex;
  527. justify-content: center;
  528. image {
  529. border-radius: 20rpx 20rpx 0 0;
  530. width: 450rpx;
  531. height: 132rpx;
  532. }
  533. }
  534. .mian {
  535. margin-top: -44rpx;
  536. display: flex;
  537. flex-direction: column;
  538. align-items: center;
  539. // padding: 32rpx 32rpx;
  540. background-color: #ffffff;
  541. border-radius: 0 0 20rpx 20rpx;
  542. text-align: center;
  543. .delivery {
  544. font-size: 40rpx;
  545. color: #333333;
  546. display: flex;
  547. align-items: center;
  548. flex-direction: column;
  549. .title {
  550. }
  551. image {
  552. margin-top: 48rpx;
  553. width: 172rpx;
  554. height: 160rpx;
  555. }
  556. }
  557. .nocancel {
  558. font-size: 32rpx;
  559. color: #333333;
  560. margin-top: 14rpx;
  561. }
  562. .comfirm-box {
  563. margin-top: 52rpx;
  564. display: flex;
  565. // margin-bottom: 32rpx;
  566. // justify-content: space-around;
  567. .cancel {
  568. display: flex;
  569. align-items: center;
  570. justify-content: center;
  571. width: 197rpx;
  572. height: 74rpx;
  573. border: 1px solid #dcc786;
  574. border-radius: 38rpx;
  575. font-size: 32rpx;
  576. color: #605128;
  577. }
  578. .comfirm {
  579. margin-left: 32rpx;
  580. display: flex;
  581. align-items: center;
  582. justify-content: center;
  583. width: 197rpx;
  584. height: 74rpx;
  585. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  586. border-radius: 38px;
  587. font-size: 32rpx;
  588. color: #605128;
  589. }
  590. }
  591. }
  592. }
  593. // 文章页底部高度撑开
  594. .contentBottomHeight {
  595. height: 150rpx;
  596. }
  597. </style>