wholesale.vue 3.6 KB

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