group.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="group-box iPhone-bottom box-border-box">
  3. <Nav title='团购专区'></Nav>
  4. <image class="head-img" src="@/static/img/buy/group-bg.png" mode="scaleToFill"></image>
  5. <view class="box-border-box p-24">
  6. <view class="box-card box-border-box p-24 mb-20" v-for="(item,i) in 10" :key="i" @click="todet(item)">
  7. <image class="goods-img mb-16" src="@/static/img/my/lqzx-bg.png" mode="scaleToFill"></image>
  8. <view class="text-overflow-ellipsis fs-36 fw-600 mb-20 w-100100">
  9. [畅销款]奥尔1良烤肉牛油拌饭11[畅销款11 ]奥尔1良烤肉牛油拌饭11[畅销款]奥尔1良烤肉牛油拌饭11[畅销款11 ]奥尔1良烤肉牛油拌饭11
  10. </view>
  11. <view class="mb-40 flex-justify-space align-items-center">
  12. <view class="jd-f">
  13. <view class="jd-1"></view>
  14. <view class="jd-2" :style="{width:setWidth(182,92)+'rpx'}"></view>
  15. </view>
  16. <view class="">
  17. <span class="fs-24 fc-9">已团</span>
  18. <span class="fs-24 ">92件</span>
  19. <span class="fs-24 fc-9">/剩</span>
  20. <span class="fs-24 ">90</span>
  21. </view>
  22. </view>
  23. <view class="info-box display-flex">
  24. <view class="flex-1">
  25. <span class="fs-28 fc-FB3D03 fw-400">团购价¥</span>
  26. <span class="fs-40 fc-FB3D03 fw-600">15.9</span>
  27. </view>
  28. <view class="info-box-qiang">
  29. <image class="qiang-img" src="@/static/img/buy/qiang.png" mode="scaleToFill"></image>
  30. <view class="jiang-box fc-65420c fs-24 fw-600">直降</view>
  31. <view class="jiang-box-1 fs-24 fc-65420c fw-600">¥399</view>
  32. <image class="jiang-img" src="@/static/img/buy/x-jt.png" mode="scaleToFill"></image>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {groupList} from '@/api/groupOrder.js';
  41. import tools from "@/service/tools";
  42. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  43. export default {
  44. components:{EnBlank},
  45. data(){
  46. return{
  47. page:1,
  48. total:0,
  49. list:[],
  50. }
  51. },
  52. onReachBottom() {
  53. console.log('触底刷新');
  54. },
  55. onShow() {
  56. this.getList();
  57. },
  58. methods:{
  59. getList(){
  60. let school_id = uni.getStorageSync('school_id');
  61. groupList({school_id:school_id,page:this.page}).then((res)=>{
  62. if(res.code === 1){
  63. this.list = [...this.list,...res.data.items];
  64. this.total = res.data.total;
  65. }
  66. })
  67. },
  68. setWidth(total,num){
  69. let w = 0
  70. let tH = 434;
  71. w = (tH/total * num).toFixed(0)
  72. console.log(w);
  73. return w
  74. },
  75. todet(item){
  76. uni.navigateTo({
  77. url:'/pages-buy/group-det'
  78. })
  79. },
  80. },
  81. }
  82. </script>
  83. <style scoped lang="scss">
  84. .jd-f{
  85. position: relative;
  86. width: 434rpx;
  87. height: 18rpx;
  88. .jd-1{
  89. position: absolute;
  90. top: 0;
  91. left: 0;
  92. width: 434rpx;
  93. height: 18rpx;
  94. background: #FEE0E0;
  95. border-radius: 200rpx 200rpx 200rpx 200rpx;
  96. z-index: 10;
  97. }
  98. .jd-2{
  99. position: absolute;
  100. top: 0;
  101. left: 0;
  102. height: 18rpx;
  103. // background: linear-gradient( 90deg, #3FF9F9 0%, #E0FEA4 100%);
  104. background-color: #FF2652;
  105. border-radius: 200rpx 200rpx 200rpx 200rpx;
  106. z-index: 12;
  107. }
  108. }
  109. .group-box{
  110. background-color: #EF2864;
  111. .head-img{
  112. width: 100%;
  113. height: 422rpx;
  114. }
  115. .box-card{
  116. width: 100%;
  117. min-height: 100rpx;
  118. background: #FFFFFF;
  119. box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(51,51,51,0.1);
  120. border-radius: 20rpx;
  121. .goods-img{
  122. width: 100%;
  123. height: 452rpx;
  124. border-radius: 20rpx;
  125. }
  126. .info-box{
  127. width: 100%;
  128. height: 72rpx;
  129. background: #FEE0E0;
  130. border-radius: 20rpx;
  131. line-height: 72rpx;
  132. padding-left: 14rpx;
  133. box-sizing: border-box;
  134. .info-box-qiang{
  135. width: 148rpx;
  136. height: 72rpx;
  137. background: #F63E36;
  138. border-radius: 0rpx 20rpx 20rpx 0rpx;
  139. position: relative;
  140. .qiang-img{
  141. width: 60rpx;
  142. height: 60rpx;
  143. margin: 6rpx 22rpx 0 auto;
  144. }
  145. .jiang-box{
  146. position: absolute;
  147. top: -30rpx;
  148. left: -22rpx;
  149. z-index: 20;
  150. }
  151. .jiang-box-1{
  152. position: absolute;
  153. top: 0rpx;
  154. left: -30rpx;
  155. z-index: 20;
  156. }
  157. .jiang-img{
  158. position: absolute;
  159. width: 120rpx;
  160. height: 90rpx;
  161. left: -60rpx;
  162. bottom: 0;
  163. z-index: 11;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. </style>