preInfo.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view>
  3. <view class="presale2" :style="'background-image:url('+imgUrl+'preSale/pre_sale_bg.png);background-size:100% 100%;background-repeat:no-repeat;margin-top:-26rpx;position:relative'">
  4. <view class="presale1_left">
  5. <!-- 进行中 -->
  6. <view class="presale1_price">
  7. <view class="presale1_title">{{$L("预售价")}}: </view>
  8. <view class="presale1_title_b"><text>¥</text><text>{{preSellInfo.presellPrice}}</text></view>
  9. <view class="presale1_price1 presale1_price2">
  10. <image :src="imgUrl + 'site/yushouhuore.png'"></image>
  11. <view>
  12. <!-- <view class="presale1_prices" v-if="preSellInfo.presellPrice">¥{{preSellInfo.presellPrice}}</view> -->
  13. <view class="presale_oragin_price">{{$L("原价")}}:{{preSellInfo.productPrice}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="presale1_right">
  19. <view class="collect_deposit" v-if="preSellInfo.type==1">
  20. <text>{{$L("预售定金")}}</text>
  21. <text>¥{{preSellInfo.firstMoney}}</text>
  22. <text v-if="preSellInfo.firstExpand!=0">{{$L("可抵")}}</text>
  23. <text v-if="preSellInfo.firstExpand!=0">¥{{preSellInfo.firstExpand}}</text>
  24. </view>
  25. <view class="collect_deposit" v-if="preSellInfo.type==2&&preSellInfo.pre_run!=1">
  26. <text>{{$L("已售")}}</text>
  27. <text>{{' '}}{{preSellInfo.saleNum}}{{$L("件")}}</text>
  28. </view>
  29. <view class="collect_deposit" v-if="preSellInfo.type==2&&preSellInfo.pre_run==1">
  30. <text></text>
  31. <text>即将开始</text>
  32. </view>
  33. <view class="presale1_start_time" v-if="preSellInfo.pre_run == 1">{{$L("活动开始时间")}}:{{preSellInfo.startTime}}</view>
  34. <view class="presale1_start_time1" v-else>{{$L("活动结束时间")}}:{{preSellInfo.endTime}}</view>
  35. </view>
  36. </view>
  37. <view class="presale3" v-if="preSellInfo.pre_run!=1">
  38. <view class="presale_desc" v-if="preSellInfo.type==1">{{$L("付尾款时间")}}:{{preSellInfo.remainStartTime}} ~ {{preSellInfo.remainEndTime}}</view>
  39. <view class="presale_desc">{{$L("发货时间")}}:{{preSellInfo.deliverTime.split(' ')[0]}}</view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default{
  45. props:['preSellInfo'],
  46. data(){
  47. return{
  48. imgUrl:getApp().globalData.imgUrl
  49. }
  50. },
  51. created() {
  52. let countTime = 0;
  53. let now = new Date()
  54. let startTime = new Date(this.preSellInfo.startTime)
  55. if (now < startTime) {
  56. countTime = (startTime.getTime() - now.getTime()) / 1000
  57. } else {
  58. countTime = this.preSellInfo.distanceEndTime
  59. }
  60. this.secInterval = setInterval(() => {
  61. if (countTime == 0) {
  62. //倒计时结束,清除倒计时
  63. clearInterval(this.secInterval);
  64. this.$emit('getGoodsDetail')
  65. } else {
  66. countTime--;
  67. }
  68. }, 1000)
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .presale3{
  74. background-color: #fff;
  75. padding: 20rpx;
  76. .presale_desc{
  77. font-size: 26rpx;
  78. color: #999999;
  79. &:nth-child(2){
  80. margin-top: 14rpx;
  81. }
  82. }
  83. }
  84. .presale1 {
  85. width: 100%;
  86. height: 163rpx;
  87. display: flex;
  88. justify-content: space-between;
  89. align-items: center;
  90. padding: 0 20rpx 0 53rpx;
  91. box-sizing: border-box;
  92. }
  93. .presale1_left {
  94. display: flex;
  95. flex-direction: column;
  96. padding-top: 15rpx;
  97. height: 100%;
  98. }
  99. .presale1_price {
  100. display: flex;
  101. flex-direction: column;
  102. }
  103. .presale1_title {
  104. font-size: 28rpx;
  105. font-family: PingFang SC;
  106. font-weight: nornal;
  107. color: rgba(254, 254, 254, 1);
  108. line-height: 40rpx;
  109. }
  110. .presale1_title_b {
  111. font-size: 28rpx;
  112. font-family: PingFang SC;
  113. font-weight: nornal;
  114. color: rgba(254, 254, 254, 1);
  115. line-height: 46rpx;
  116. margin-left: 40rpx;
  117. text:nth-child(2){
  118. font-size: 45rpx;
  119. }
  120. }
  121. .presale1_price1 {
  122. display: flex;
  123. align-items: center;
  124. }
  125. .presale1_price2 {
  126. display: flex;
  127. align-items: flex-start;
  128. margin-top: 10rpx;
  129. }
  130. .presale1_price1 image {
  131. width: 24rpx;
  132. height: 28rpx;
  133. }
  134. .presale1_prices {
  135. display: flex;
  136. font-size: 30rpx;
  137. font-family: PingFang SC;
  138. font-weight: 500;
  139. color: rgba(255, 255, 255, 1);
  140. }
  141. .presale_oragin_price {
  142. font-size: 22rpx;
  143. font-family: PingFang SC;
  144. font-weight: 400;
  145. text-decoration: line-through;
  146. color: rgba(254, 254, 254, 1);
  147. opacity: 0.7;
  148. margin-left: 36rpx;
  149. }
  150. .presale1_right {
  151. display: flex;
  152. flex-direction: column;
  153. align-items: center;
  154. }
  155. .presale2 {
  156. width: 100%;
  157. height: 163rpx;
  158. display: flex;
  159. justify-content: space-between;
  160. align-items: center;
  161. padding: 0 20rpx 0 39rpx;
  162. box-sizing: border-box;
  163. }
  164. .collect_deposit {
  165. display: flex;
  166. font-size: 24rpx;
  167. font-family: PingFang SC;
  168. font-weight: 500;
  169. color: rgba(255, 255, 255, 1);
  170. align-items: center;
  171. white-space: pre-wrap;
  172. }
  173. .collect_deposit text:nth-child(2){
  174. font-size: 40rpx;
  175. margin-right: 10rpx;
  176. font-weight: bold;
  177. white-space: pre-wrap;
  178. }
  179. .collect_deposit text:nth-child(4) {
  180. font-size: 26rpx;
  181. margin-right: 10rpx;
  182. font-weight: bold;
  183. white-space: pre-wrap;
  184. }
  185. .presale1_start_time {
  186. width: 380rpx;
  187. height: 30rpx;
  188. background: rgba(255, 255, 255, 1);
  189. border-radius: 15rpx;
  190. font-size: 20rpx;
  191. font-family: PingFang SC;
  192. font-weight: 500;
  193. color: #F91573;
  194. text-align: center;
  195. line-height: 30rpx;
  196. margin-top: 10rpx;
  197. }
  198. .presale1_start_time1 {
  199. width: 380rpx;
  200. height: 30rpx;
  201. background:rgba(255, 255, 255, 1);
  202. border-radius: 15rpx;
  203. font-size: 20rpx;
  204. font-family: PingFang SC;
  205. font-weight: 500;
  206. color: #F91573;
  207. text-align: center;
  208. line-height: 30rpx;
  209. margin-top: 10rpx;
  210. }
  211. </style>