top.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="bgcolor-white">
  3. <swiper
  4. class="screen-swiper bgcolor-white"
  5. :indicator-dots="false"
  6. circular="true"
  7. duration="400"
  8. >
  9. <swiper-item v-for="(item, index) in [cover]" :key="index">
  10. <view class="image-wrapper flex-column-align-center">
  11. <image :src="item" class="image" mode="aspectFit" />
  12. <!-- <view class="index flex-align">{{activeIndex + 1}}/{{pics.length}}</view> -->
  13. </view>
  14. </swiper-item>
  15. </swiper>
  16. <view :style="{ height: fill + 'px' }" class="bgcolor-wite"></view>
  17. <view
  18. v-if="depositData.sellType === 2"
  19. class="marginX16 marginT12 bgcolor-white radius12 pre-sale"
  20. >
  21. <view class="pre-sale_price">
  22. <view class="price_money">
  23. <view class="deposit paddingL16 paddingT5">
  24. <text class="font4">定金</text>
  25. <text class="font4 paddingL14">¥</text>
  26. <text class="font8 bold">{{ depositData.deposit }}</text>
  27. </view>
  28. <view class="full_payment paddingL16">
  29. <text class="font1">全款</text>
  30. <text class="font1 paddingL14">¥{{ depositData.price }}</text>
  31. </view>
  32. </view>
  33. <view class="price_time paddingL18">
  34. <text class="font1 marginB5">距预售结束:</text>
  35. <timer :targetTime="depositData.depositEndTime" />
  36. </view>
  37. </view>
  38. <view class="pre-sale_title marginL18 marginT20 marginB16">
  39. <view class="title_top marginB10">
  40. <view class="name">
  41. {{ depositData.name }}
  42. </view>
  43. <!-- <button class="share" open-type="share">
  44. <image class="img" :src="resource.share" />
  45. <text class="">分享</text>
  46. </button> -->
  47. </view>
  48. <!-- <view class="new marginR8">新品</view>
  49. <view class="purchase_limit">限购个</view> -->
  50. </view>
  51. <view class="pre-sale_process">
  52. <view class="left">预售流程</view>
  53. <view class="right">
  54. <view class="item">
  55. <text class="">预售时间</text>
  56. <text class="">
  57. {{ depositData.sellTime ? formatD(depositData.sellTime) : '待定' }}
  58. </text>
  59. </view>
  60. <view class="item">
  61. <text class="">定金截止时间</text>
  62. <text class="">
  63. {{
  64. depositData.depositEndTime
  65. ? formatD(depositData.depositEndTime)
  66. : '待定'
  67. }}
  68. </text>
  69. </view>
  70. <view class="item">
  71. <text class="">尾款开始时间</text>
  72. <text class="">
  73. {{
  74. depositData.restStartTime
  75. ? formatM(depositData.restStartTime)
  76. : '待定'
  77. }}
  78. </text>
  79. </view>
  80. <view class="item">
  81. <text class="">尾款截止时间</text>
  82. <text class="">
  83. {{
  84. depositData.restEndTime ? formatM(depositData.restEndTime) : '待定'
  85. }}
  86. </text>
  87. </view>
  88. <view class="item">
  89. <text class="">预计发货时间</text>
  90. <text class="">
  91. {{ depositData.chuheTime ? formatM(depositData.chuheTime) : '待定' }}
  92. </text>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <view v-else class="content-wrapper">
  98. <view class="flex-align-between">
  99. <view class="color-money">
  100. <text class="font4">¥</text>
  101. <text class="font8 bold">{{ subjectPrice ? subjectPrice : price }}</text>
  102. </view>
  103. <view v-if="finish" class="status finish flex-align-center">已成交</view>
  104. <view v-else-if="down" class="status off flex-align-center">已下架</view>
  105. </view>
  106. <view class="flex-align-between">
  107. <view>
  108. <view class="paddingT10 bold font6 color-1">{{ data.name }}</view>
  109. </view>
  110. <!-- <button class="share" open-type="share">
  111. <image class="img" :src="resource.share" />
  112. <text class="">分享</text>
  113. </button> -->
  114. </view>
  115. </view>
  116. </view>
  117. </template>
  118. <script>
  119. import resource from '@/utils/resource'
  120. import timer from '@/components/timer'
  121. import dayjs from 'dayjs'
  122. export default {
  123. components: { timer },
  124. props: {
  125. price: [String,Number],
  126. data: Object,
  127. cover: String,
  128. down: Boolean,
  129. finish: Boolean,
  130. depositData: Object,
  131. subjectPrice: String
  132. },
  133. data() {
  134. return {
  135. dayjs,
  136. resource,
  137. activeIndex: 0,
  138. pics: []
  139. }
  140. },
  141. computed: {
  142. fill() {
  143. let allHeight = uni.upx2px(750)
  144. let statusBarHeight = this.$store.state.systemInfo.statusBarHeight
  145. return allHeight - statusBarHeight - 35
  146. }
  147. },
  148. methods: {
  149. formatM(value) {
  150. return dayjs(value).format('YYYY-MM')
  151. },
  152. formatD(value) {
  153. return dayjs(value).format('YYYY-MM-DD')
  154. }
  155. },
  156. mounted() {
  157. this.pics = this.data.pic.split(',')
  158. wx.showShareMenu({
  159. withShareTicket: true,
  160. menus: ['shareAppMessage', 'shareTimeline']
  161. })
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .screen-swiper {
  167. position: absolute;
  168. top: 0;
  169. left: 0;
  170. right: 0;
  171. height: 750rpx;
  172. .image-wrapper {
  173. height: 100%;
  174. position: relative;
  175. .image {
  176. width: 100%;
  177. height: 750rpx;
  178. }
  179. .index {
  180. position: absolute;
  181. right: 28rpx;
  182. bottom: 28rpx;
  183. padding: 0 20rpx;
  184. height: 40rpx;
  185. border-radius: 20rpx;
  186. background: rgba($color: #000000, $alpha: 0.5);
  187. color: #fff;
  188. font-size: 24rpx;
  189. }
  190. }
  191. }
  192. .pre-sale {
  193. .pre-sale_price {
  194. display: flex;
  195. background-color: #fff1ec;
  196. .price_money {
  197. width: 419rpx;
  198. height: 106rpx;
  199. color: #fff;
  200. background: linear-gradient(270deg, #2affff 10%, #4d70f2 100%);
  201. border-radius: 24rpx 24rpx 24rpx 0rpx;
  202. .full_payment {
  203. color: #fdd9d6;
  204. }
  205. }
  206. .price_time {
  207. display: flex;
  208. flex-direction: column;
  209. align-items: center;
  210. justify-content: center;
  211. color: $color-theme;
  212. }
  213. }
  214. .pre-sale_title {
  215. .title_top {
  216. display: flex;
  217. align-items: center;
  218. .name {
  219. width: 524rpx;
  220. height: 32rpx;
  221. font-size: 32rpx;
  222. font-weight: 600;
  223. color: #000000;
  224. line-height: 32rpx;
  225. overflow: hidden;
  226. white-space: nowrap;
  227. text-overflow: ellipsis;
  228. }
  229. }
  230. .new {
  231. display: inline-block;
  232. color: #35d872;
  233. width: 76rpx;
  234. height: 41rpx;
  235. text-align: center;
  236. line-height: 42rpx;
  237. font-size: 22rpx;
  238. background: #e1f9ea;
  239. border-radius: 21rpx;
  240. }
  241. .purchase_limit {
  242. display: inline-block;
  243. color: #f4524d;
  244. min-width: 76rpx;
  245. height: 41rpx;
  246. font-size: 22rpx;
  247. text-align: center;
  248. line-height: 42rpx;
  249. background: #fdeded;
  250. border-radius: 21rpx;
  251. }
  252. }
  253. .pre-sale_process {
  254. display: flex;
  255. align-items: center;
  256. margin-left: 32rpx;
  257. border-top: 2rpx solid #eee;
  258. .left {
  259. width: 56rpx;
  260. height: 80rpx;
  261. font-size: 28rpx;
  262. color: #000000;
  263. font-weight: 400;
  264. margin-right: 32rpx;
  265. }
  266. .right {
  267. display: flex;
  268. width: 534rpx;
  269. overflow: scroll;
  270. .item {
  271. width: 800rpx;
  272. height: 140rpx;
  273. font-size: 22rpx;
  274. color: #999999;
  275. white-space: nowrap;
  276. display: flex;
  277. flex-direction: column;
  278. justify-content: space-evenly;
  279. align-items: center;
  280. margin-right: 50rpx;
  281. }
  282. }
  283. .right::-webkit-scrollbar {
  284. display: none;
  285. }
  286. }
  287. }
  288. .share {
  289. display: flex;
  290. flex-direction: column;
  291. align-items: center;
  292. font-size: 22rpx;
  293. background-color: #fff;
  294. margin: 0;
  295. .img {
  296. width: 32rpx;
  297. height: 32rpx;
  298. }
  299. }
  300. .share::after {
  301. border: none;
  302. }
  303. .content-wrapper {
  304. border-bottom-left-radius: 20rpx;
  305. border-bottom-right-radius: 20rpx;
  306. background: #fff;
  307. padding: 20rpx 28rpx 30rpx;
  308. .status {
  309. padding: 10rpx 30rpx;
  310. border-radius: 8rpx;
  311. color: #262626;
  312. &.off {
  313. background: #b4b4b4;
  314. }
  315. &.finish {
  316. background: #55fffe;
  317. }
  318. }
  319. }
  320. </style>