GroupBuy.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="group-work u-skeleton-fillet">
  3. <view
  4. class="head-item"
  5. @click="goDetail('/pages/groupBuying/list')"
  6. :style="{ backgroundImage: `url(${bgImage || ''})` }"
  7. >
  8. <view class="top-left">
  9. <view class="top-left-title">拼团购</view>
  10. <view class="top-left-tip">精选好物推荐</view>
  11. </view>
  12. <view class="top-right" style="color: #75c27a">
  13. <text>查看更多</text>
  14. <!-- <text class="iconfont u-font24">&#xe6c7;</text> -->
  15. <uv-icon name="arrow-right" size="24rpx" color="#75c27a"></uv-icon>
  16. </view>
  17. </view>
  18. <view
  19. class="group-work-main"
  20. v-if="(groupList && groupList.length > 0) || skeletonShow"
  21. >
  22. <view
  23. class="middle_item"
  24. v-for="item in skeletonShow ? 1 : groupList"
  25. :key="item.id"
  26. >
  27. <view
  28. class="middle"
  29. @click="
  30. goProductDetails('/pages/groupBuying/details?id=' + item.id)
  31. "
  32. >
  33. <view class="middle-left">
  34. <image
  35. v-if="item && item.cover"
  36. :src="`${item.cover}?x-oss-process=style/w_350`"
  37. mode="aspectFill"
  38. >
  39. </image>
  40. </view>
  41. <view class="middle-right">
  42. <view class="middle-title u-text2">{{ item.title }}</view>
  43. <view class="division">
  44. <view class="middle-num">
  45. <view class="contain">
  46. <view class="large">
  47. <rich-text
  48. :nodes="$mUtil.priceBigSmall(item.min_price)"
  49. ></rich-text>
  50. </view>
  51. <view class="small">¥ {{ item.min_sale_price }}</view>
  52. </view>
  53. <view class="three"
  54. >{{ item.group_people_num }}人团,已拼
  55. <text style="color: red"> {{ item.result_sale_num }}</text>
  56. 件</view
  57. >
  58. </view>
  59. <view class="button">去拼团</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <noData v-else :config="{ top: 1, content: '暂无商品~' }"></noData>
  66. </view>
  67. </template>
  68. <script setup>
  69. import { getCurrentInstance } from "vue";
  70. const { proxy } = getCurrentInstance();
  71. const $mUtil = proxy.$mUtil;
  72. const props = defineProps({
  73. groupList: {
  74. type: Array,
  75. default: () => [],
  76. },
  77. skeletonShow: {
  78. type: Boolean,
  79. default: false,
  80. },
  81. bgImage: {
  82. type: String,
  83. default: "",
  84. },
  85. });
  86. const emit = defineEmits(["goDetail", "goProductDetails"]);
  87. const goDetail = (url) => {
  88. emit("goDetail", url);
  89. };
  90. const goProductDetails = (url) => {
  91. emit("goProductDetails", url);
  92. };
  93. </script>
  94. <style scoped lang="scss">
  95. .group-work {
  96. margin: 30rpx 0;
  97. background: #d4f2e8;
  98. padding-bottom: 30rpx;
  99. border-radius: 10rpx;
  100. box-sizing: border-box;
  101. overflow: hidden;
  102. .group-work-main {
  103. padding: 30rpx;
  104. margin: 20rpx 30rpx 0 30rpx;
  105. box-sizing: border-box;
  106. background-color: #ffffff;
  107. border-radius: 10rpx;
  108. }
  109. }
  110. .head-item {
  111. display: flex;
  112. align-items: center;
  113. justify-content: space-between;
  114. padding: 27rpx 30rpx;
  115. box-sizing: border-box;
  116. overflow: hidden;
  117. background-size: 100% 100%;
  118. background-repeat: no-repeat;
  119. .top-left {
  120. .top-left-title {
  121. font-size: 36rpx;
  122. font-family: PingFang SC, PingFang SC-Bold;
  123. font-weight: 700;
  124. }
  125. .top-left-tip {
  126. font-size: 24rpx;
  127. font-family: PingFang SC, PingFang SC-Regular;
  128. font-weight: 400;
  129. margin-top: 5rpx;
  130. }
  131. }
  132. .top-right {
  133. width: 165rpx;
  134. height: 67rpx;
  135. line-height: 67rpx;
  136. background: #ffffff;
  137. border-radius: 34rpx;
  138. box-sizing: border-box;
  139. font-size: 24rpx;
  140. font-family: PingFang SC, PingFang SC-Regular;
  141. font-weight: 400;
  142. text-align: center;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. }
  147. }
  148. .middle_item {
  149. padding: 0 30rpx;
  150. }
  151. .middle_item:last-child {
  152. border: none;
  153. }
  154. .middle {
  155. display: flex;
  156. border-bottom: 1rpx solid #f7f7f7;
  157. padding-bottom: 40rpx;
  158. padding-top: 42rpx;
  159. .middle-left {
  160. margin-right: 20rpx;
  161. image {
  162. width: 226rpx;
  163. height: 226rpx;
  164. border-radius: 10rpx;
  165. }
  166. }
  167. .middle-right {
  168. width: 100%;
  169. display: flex;
  170. flex-direction: column;
  171. justify-content: space-between;
  172. margin-top: 10rpx;
  173. padding-bottom: 10rpx;
  174. .middle-title {
  175. font-size: 28rpx;
  176. margin-top: 10rpx;
  177. color: #181818;
  178. font-weight: 400;
  179. line-height: 36rpx;
  180. }
  181. .division {
  182. display: flex;
  183. width: 100%;
  184. padding-bottom: 10rpx;
  185. justify-content: space-between;
  186. }
  187. .middle-num {
  188. flex: 1;
  189. .contain {
  190. display: flex;
  191. align-items: flex-end;
  192. }
  193. .three {
  194. font-size: 24rpx;
  195. font-weight: Regular;
  196. color: #333333;
  197. line-height: 24rpx;
  198. margin-top: 8rpx;
  199. }
  200. .large {
  201. color: #00bf5a;
  202. font-size: 36rpx;
  203. font-weight: Bold;
  204. line-height: 24rpx;
  205. }
  206. .small {
  207. margin-left: 16rpx;
  208. font-size: 22rpx;
  209. font-weight: 500;
  210. color: #cccccc;
  211. line-height: 24rpx;
  212. text-decoration: line-through;
  213. }
  214. }
  215. .button {
  216. width: 130rpx;
  217. height: 60rpx;
  218. text-align: center;
  219. line-height: 60rpx;
  220. color: #ffffff;
  221. font-size: 28rpx;
  222. background: #069d4d;
  223. border-radius: 32rpx;
  224. }
  225. }
  226. }
  227. </style>