wholesale.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="wholesale">
  3. <view class="title">
  4. <view class="img">
  5. <image src="../../../static/img/list1.png" mode=""></image>
  6. </view>
  7. <view class="title-t"> 批发专区 </view>
  8. <view class="about"> 限时抢购 </view>
  9. </view>
  10. <view class="date">
  11. <view class="date-item" @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[0].time) + '&stp=' + list[0].stop + '&status=' + list[0].status + '&state=' + list[0].state)">
  12. <image src="../../../static/img/mom.png"></image>
  13. <view class="item-name">
  14. 上午场
  15. </view>
  16. <view class="item-time">
  17. {{list[0].time}}~{{list[0].stop | time}}
  18. </view>
  19. </view>
  20. <view class="date-item" @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[1].time) + '&stp=' + list[1].stop + '&status=' + list[1].status + '&state=' + list[1].state)">
  21. <image src="../../../static/img/aft.png"></image>
  22. <view class="item-name">
  23. 下午场
  24. </view>
  25. <view class="item-time">
  26. {{list[1].time}}~{{list[1].stop | time}}
  27. </view>
  28. </view>
  29. <view class="date-item" @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[2].time) + '&stp=' + list[2].stop + '&status=' + list[2].status + '&state=' + list[2].state)">
  30. <image src="../../../static/img/eve.png"></image>
  31. <view class="item-name">
  32. 晚上场
  33. </view>
  34. <view class="item-time">
  35. {{list[2].time}}~{{list[2].stop | time}}
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. getWholeTimeArea
  44. } from '@/api/whole.js'
  45. export default {
  46. data() {
  47. return {
  48. list: []
  49. }
  50. },
  51. filters: {
  52. time(val) {
  53. let str = ''
  54. if (val) {
  55. let time = new Date(val * 1000);
  56. let h = time.getHours() >= 10 ? time.getHours() : ('0' + time.getHours())
  57. let m = time.getMinutes() >= 10 ? time.getMinutes() : ('0' + time.getMinutes())
  58. str = h + ':' + m
  59. }
  60. return str
  61. }
  62. },
  63. mounted() {
  64. this.getTimeArea()
  65. },
  66. methods: {
  67. navto(url) {
  68. uni.navigateTo({
  69. url: url
  70. })
  71. },
  72. getTimeArea() {
  73. getWholeTimeArea().then(({
  74. data
  75. }) => {
  76. this.list = data.seckillTime
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. $grey: #95A0B1;
  84. $text: #333333;
  85. $red: #FF4C4C;
  86. .wholesale {
  87. padding: 20rpx;
  88. background-color: #fff;
  89. margin: 20rpx 0;
  90. .title {
  91. display: flex;
  92. line-height: 40rpx;
  93. .title-t {
  94. color: $text;
  95. font-weight: bold;
  96. margin: 0 20rpx;
  97. font-size: 34rpx;
  98. }
  99. .about {
  100. font-size: 24rpx;
  101. color: $grey;
  102. }
  103. image {
  104. width: 40rpx;
  105. height: 40rpx;
  106. }
  107. }
  108. .date {
  109. padding: 30rpx 0;
  110. display: flex;
  111. justify-content: space-between;
  112. .date-item {
  113. width: 220rpx;
  114. height: 300rpx;
  115. position: relative;
  116. image {
  117. border-radius: 20rpx;
  118. // max-width: 32%;
  119. width: 220rpx;
  120. height: 300rpx;
  121. }
  122. .item-name {
  123. font-size: 32rpx;
  124. font-family: PingFang SC;
  125. font-weight: 500;
  126. color: #FFFFFF;
  127. position: absolute;
  128. top: 36rpx;
  129. padding-left: 30rpx;
  130. }
  131. .item-time {
  132. font-size: 22rpx;
  133. font-family: PingFang SC;
  134. font-weight: 500;
  135. color: #FFFFFF;
  136. position: absolute;
  137. top: 80rpx;
  138. padding-left: 30rpx;
  139. }
  140. }
  141. // image {
  142. // border-radius: 20rpx;
  143. // // max-width: 32%;
  144. // width: 220rpx;
  145. // height: 300rpx;
  146. // }
  147. }
  148. }
  149. </style>