ladderInfo.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="ladder_bg" :style="'background-image:url('+imgUrl+'ladder/ladder_regiment_end1.png);background-size:100% 100%;background-repeat:no-repeat;'">
  3. <view class="ladder_left">
  4. <view class="ladder_deposit">
  5. <view class="deposit_text">{{$L('定金')}}</view>
  6. <view class="deposit"><text>¥</text><text>{{filters.toFix(ladderInfo.advanceDeposit)}}</text></view>
  7. </view>
  8. <view class="deposit_price">
  9. <text>{{$L('现价')}}:{{filters.toFix(ladderInfo.currentPrice)}}</text>
  10. <text>{{$L('原价')}}:{{filters.toFix(ladderInfo.productPrice)}}</text>
  11. </view>
  12. </view>
  13. <view class="jtt_right">
  14. <view class="activity_not_started" v-if="ladderInfo.ladder_run>1">{{ladderInfo.distanceEndTime!=0?$L("活动进行中"):$L("活动已结束")}}</view>
  15. <!-- <view class="activity_not_started">已参团{{ladderInfo.sld_already_num}}人</view> -->
  16. <view class="pro_wrap" v-if="ladderInfo.distanceEndTime!=0&&ladderInfo.ladder_run>1">
  17. <view class="pro" :style="'width: ' + ladderProcess + '%;'"></view>
  18. </view>
  19. <view class="djs" v-if="ladderInfo.distanceEndTime!=0">
  20. <text class="count_down_title">{{ladderInfo.ladder_run==1?'距开始':'距结束'}}</text>
  21. <text class="count_down_day ">{{ladderDay*1>0?ladderDay:'00'}}{{$L('天')}}</text>
  22. <text class="count_down_hours limited_discount_hours ladder_text">{{ladderHour*1>0?ladderHour:'00'}}</text>
  23. <text class="count_down_flag">:</text>
  24. <text class="count_down_minutes limited_discount_minutes ladder_text">{{ladderMinute*1>0?ladderMinute:'00'}}</text>
  25. <text class="countdown-break-flag">:</text>
  26. <text class="count_down_seconds limited_discount_seconds ladder_text">{{ladderSecond*1>0?ladderSecond:'00'}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script module="filters" lang="wxs" src="@/utils/filter.wxs"></script>
  32. <script>
  33. export default{
  34. props:['ladderInfo','ladderProcess'],
  35. data(){
  36. return{
  37. imgUrl:getApp().globalData.imgUrl,
  38. ladderDay:'00',
  39. ladderHour:'00',
  40. ladderMinute:'00',
  41. ladderSecond:'00'
  42. }
  43. },
  44. created() {
  45. let countTime = 0; //剩余时间 秒
  46. let now = new Date()
  47. let start = new Date(this.ladderInfo.startTime)
  48. if(this.ladderInfo.ladder_run==1){
  49. countTime = (start.getTime() - now.getTime())/1000
  50. }else{
  51. countTime = this.ladderInfo.distanceEndTime
  52. }
  53. this.secInterval = setInterval(()=>{
  54. if(countTime == 0){
  55. //倒计时结束,清除倒计时
  56. clearInterval(this.secInterval);
  57. this.$emit('getGoodsDetail')
  58. }else{
  59. countTime--;
  60. let day = parseInt(countTime / 60 / 60 / 24);
  61. let hours = parseInt(countTime / 60 / 60 % 24);
  62. let minutes = parseInt(countTime / 60 % 60);
  63. let seconds = parseInt(countTime % 60);
  64. this.ladderDay = day;
  65. this.ladderHour = hours > 9 ? hours : '0' + hours;
  66. this.ladderMinute = minutes > 9 ? minutes : '0' + minutes;
  67. this.ladderSecond = seconds > 9 ? seconds : '0' + seconds;
  68. }
  69. },1000)
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .jtt_left {
  75. position: relative;
  76. flex: 0 0 501rpx;
  77. display: flex;
  78. align-items: center;
  79. height: 110rpx;
  80. background-color: #ed6307;
  81. color: #fff;
  82. font-size: 22rpx;
  83. .dj {
  84. flex: 0 0 280rpx;
  85. font-size: 30rpx;
  86. text-align: center;
  87. text {
  88. font-size: 36rpx;
  89. }
  90. }
  91. }
  92. .jtt_right {
  93. display: flex;
  94. flex-direction: column;
  95. justify-content: center;
  96. align-items: center;
  97. height: 140rpx;
  98. font-size: 24rpx;
  99. color: #5f4a08;
  100. .activity_not_started {
  101. font-size: 30rpx;
  102. font-family: PingFang SC;
  103. font-weight: 500;
  104. color: rgba(255, 255, 255, 1);
  105. }
  106. .djs {
  107. font-size: 20rpx;
  108. font-family: PingFang SC;
  109. font-weight: 500;
  110. color: rgba(255, 255, 255, 1);
  111. display: flex;
  112. .count_down_title {
  113. font-size: 24rpx;
  114. font-family: PingFang SC;
  115. font-weight: 500;
  116. color: rgba(255, 255, 255, 1);
  117. flex-shrink: 0;
  118. }
  119. .count_down_day {
  120. font-size: 20rpx;
  121. font-family: PingFang SC;
  122. font-weight: 500;
  123. color: rgba(255, 255, 255, 1);
  124. margin: 0 9rpx;
  125. flex-shrink: 0;
  126. }
  127. .count_down_hours,
  128. .count_down_minutes,
  129. .count_down_seconds {
  130. width: 34rpx;
  131. height: 34rpx;
  132. background: rgba(255, 255, 255, 1);
  133. border-radius: 50%;
  134. text-align: center;
  135. color: #FF284D;
  136. font-size: 20rpx;
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. line-height: 34rpx;
  141. }
  142. .count_down_flag,.countdown-break-flag {
  143. font-size: 20rpx;
  144. color: #fff;
  145. margin: 0 9rpx;
  146. }
  147. .limited_discount_hours,
  148. .limited_discount_minutes,
  149. .limited_discount_seconds {
  150. color: #B329FA;
  151. }
  152. }
  153. }
  154. .jtt_price {
  155. display: flex;
  156. flex-direction: column;
  157. justify-content: space-around;
  158. height: 90rpx;
  159. }
  160. .pro_wrap {
  161. width: 210rpx;
  162. height: 9rpx;
  163. border: 1rpx solid #FFFFFF;
  164. border-radius: 5rpx;
  165. overflow: hidden;
  166. margin: 11rpx 0 19rpx;
  167. .pro {
  168. width: 0;
  169. height: 14rpx;
  170. background: linear-gradient(-90deg, #FEEAD6 0%, #FFFFFF 100%);
  171. border-radius: 5rpx;
  172. }
  173. }
  174. .ladder_bg {
  175. width: 750rpx;
  176. height: 140rpx;
  177. display: flex;
  178. justify-content: space-between;
  179. align-items: center;
  180. padding: 0 20rpx 0 23rpx;
  181. box-sizing: border-box;
  182. .ladder_left {
  183. height: 140rpx;
  184. display: flex;
  185. flex-direction: column;
  186. justify-content: center;
  187. .ladder_deposit {
  188. display: flex;
  189. align-items: flex-end;
  190. margin-bottom: 18rpx;
  191. .deposit_text {
  192. font-size: 30rpx;
  193. font-family: PingFang SC;
  194. font-weight: 500;
  195. color: rgba(255, 255, 255, 1);
  196. }
  197. .deposit {
  198. font-size: 30rpx;
  199. font-family: PingFang SC;
  200. font-weight: 500;
  201. color: rgba(255, 255, 255, 1);
  202. line-height: 30rpx;
  203. text:nth-child(2) {
  204. font-size: 50rpx;
  205. font-weight: bold;
  206. }
  207. }
  208. }
  209. .deposit_price {
  210. display: flex;
  211. align-items: center;
  212. text:nth-child(1) {
  213. font-size: 24rpx;
  214. font-family: PingFang SC;
  215. font-weight: 500;
  216. color: rgba(255, 255, 255, 1);
  217. }
  218. text:nth-child(2) {
  219. font-size: 20rpx;
  220. font-family: PingFang SC;
  221. font-weight: 400;
  222. text-decoration: line-through;
  223. color: rgba(254, 254, 254, 1);
  224. opacity: 0.7;
  225. margin-left: 19rpx;
  226. text-decoration: line-through;
  227. }
  228. }
  229. }
  230. }
  231. .ladder_text {
  232. color: #FD8E01 !important;
  233. }
  234. </style>