group-goods.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="flex-common-css iPhone-bottom box-border-box seckill-box">
  3. <Nav title="优质团购" bgckgroundBox='transparent' leftColor='#fff' titleColor='#fff'></Nav>
  4. <scroll-view :scroll-y="true" class="scroll-view-css p-24 box-border-box" @scrolltolower="scrolltolower">
  5. <view class="b-rad-20 bgc-f mb-10 p-24 box-border-box align-items-flex-start"
  6. v-for="(item,index) in goodsData" :key="index" @click="goToUrl(item)">
  7. <image class="goods-img flex-shrink0 mr-20 b-rad-12" :src="item.cover_img" mode="aspectFill"></image>
  8. <view class="flex-1 right-h flex-direction flex-justify-space">
  9. <view class="">
  10. <view class="fs-30 fw-600 fc-0 mb-10 text-overflow-ellipsis">
  11. {{item.title}}
  12. </view>
  13. <view class="align-items-center">
  14. <uni-icons type="shop" size="15" color="#666" class="mr-4"></uni-icons>
  15. <view class="fs-26 fc-6">
  16. {{item.shop_name}}
  17. </view>
  18. </view>
  19. </view>
  20. <view class="item-but align-items-center flex-justify-space bgc-FDF3EC box-border-box b-rad-20">
  21. <view class="align-items-center">
  22. <view class="fs-28 fw-600 fc-F43D04 mr-14">
  23. ¥ <text class="fs-30 fw-600 fc-F43D04">{{Number(item.seckill_money).toFixed(2)}}</text>
  24. </view>
  25. <view class="fs-22 fc-F43D04">
  26. 已省{{(Number(item.line_price).toFixed(2) - Number(item.seckill_money).toFixed(2)).toFixed(2)}}
  27. </view>
  28. </view>
  29. <view class="fs-28 fc-f msq-but plr-24 box-border-box bgc-F5811E b-rad-20">
  30. 马上抢
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </scroll-view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. seckillAllGroup
  41. } from "@/api/seckill.js"
  42. export default {
  43. components: {},
  44. data() {
  45. return {
  46. goodsData: [],
  47. page: 1,
  48. total: 0
  49. };
  50. },
  51. onLoad(data) {},
  52. mounted() {
  53. this.seckillAllGroup()
  54. },
  55. methods: {
  56. goToUrl(item) {
  57. uni.navigateTo({
  58. url: '/pages-buy/group-goods-info?shop_id=' + item.shop_id + '&goods_id=' +
  59. item.goods_id +
  60. '&shop_name=' + item.shop_name
  61. })
  62. },
  63. scrolltolower() {
  64. if (this.total > this.goodsData.length) {
  65. ++this.page
  66. this.scrolltolower()
  67. }
  68. },
  69. seckillAllGroup() {
  70. seckillAllGroup({
  71. page: this.page
  72. }).then((res) => {
  73. if (res.code === 1) {
  74. this.goodsData.push(...res.data.items)
  75. this.total = res.data.total
  76. }
  77. })
  78. }
  79. },
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .seckill-box {
  84. background: linear-gradient(to bottom, #FF3D19, #F5F5F5, #F5F5F5);
  85. }
  86. .goods-img {
  87. width: 200rpx;
  88. height: 200rpx;
  89. }
  90. .right-h {
  91. height: 200rpx;
  92. }
  93. .item-but {
  94. width: 100%;
  95. height: 70rpx;
  96. line-height: 70rpx;
  97. padding: 0 0 0 24rpx;
  98. }
  99. </style>