You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.7 KiB

3 months ago
  1. <template>
  2. <view class="goodsList">
  3. <view class="item" v-for="(item,index) in tempArr" :key='index' @click="goDetail(item)">
  4. <view class="pictrue">
  5. <image :src="item.recommend_image" mode="aspectFill" v-if="item.recommend_image"></image>
  6. <image :src="item.image" mode="aspectFill" v-else></image>
  7. </view>
  8. <view class="text line2">{{item.storeName}}</view>
  9. <view class="bottom acea-row row-between-wrapper">
  10. <view class="sales acea-row row-middle">
  11. <view class="money" :class="item.price.length>8?'lengthStr':''"><text></text>{{item.price}} <text class="item_sales">已售 {{item.sales}}</text> </view>
  12. <!-- <view></view> -->
  13. </view>
  14. <view v-if="item.stock>0">
  15. <view class="bnt" v-if="item.activity && (item.activity.type === '1' || item.activity.type === '2' || item.activity.type === '3')">立即购买</view>
  16. <view v-else>
  17. <view class="bnt" @click.stop="goCartDuo(item)">
  18. 加入购物车
  19. <view class="num" v-if="item.cartNum">{{item.cartNum}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="end" v-else>已售罄</view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'd_goodList',
  31. props: {
  32. dataConfig: {
  33. type: Object,
  34. default: () => {}
  35. },
  36. tempArr:{
  37. type: Array,
  38. default:[]
  39. },
  40. isLogin:{
  41. type: Boolean,
  42. default:false
  43. }
  44. },
  45. data() {
  46. return {
  47. };
  48. },
  49. created() {},
  50. mounted() {},
  51. methods: {
  52. goDetail(item){
  53. this.$emit('detail',item);
  54. },
  55. goCartDuo(item){
  56. this.$emit('gocartduo',item);
  57. }
  58. }
  59. };
  60. </script>
  61. <style lang="scss">
  62. .goodsList{
  63. padding: 0 30rpx;
  64. .item{
  65. width: 100%;
  66. box-sizing: border-box;
  67. margin-bottom: 63rpx;
  68. .pictrue{
  69. width: 100%;
  70. height: 216rpx;
  71. border-radius: 16rpx;
  72. position: relative;
  73. image{
  74. width: 100%;
  75. height: 100%;
  76. border-radius: 16rpx;
  77. }
  78. }
  79. .text{
  80. font-size:30rpx;
  81. font-family:PingFang SC;
  82. font-weight:bold;
  83. color: #282828;
  84. margin: 20rpx 0;
  85. }
  86. .bottom{
  87. .sales{
  88. font-size: 22rpx;
  89. color: #8E8E8E;
  90. .money{
  91. font-size: 42rpx;
  92. font-weight: bold;
  93. margin-right: 18rpx;
  94. @include price_color(theme);
  95. .item_sales{
  96. font-size: 24rpx;
  97. font-family: PingFang SC;
  98. font-weight: 400;
  99. padding-left: 17rpx;
  100. color: #8e8e8e;
  101. }
  102. text{
  103. font-size: 28rpx;
  104. }
  105. }
  106. }
  107. .cart{
  108. height: 56rpx;
  109. .pictrue{
  110. color: #E93323;
  111. font-size:46rpx;
  112. width: 50rpx;
  113. height: 50rpx;
  114. text-align: center;
  115. line-height: 50rpx;
  116. &.icon-jiahao{
  117. background:linear-gradient(140deg, #FA6514 0%, #E93323 100%);
  118. -webkit-background-clip:text;
  119. -webkit-text-fill-color:transparent;
  120. }
  121. }
  122. .num{
  123. font-size: 30rpx;
  124. color: #282828;
  125. font-weight: bold;
  126. width: 80rpx;
  127. text-align: center;
  128. }
  129. }
  130. .bnt{
  131. padding: 0 30rpx;
  132. height: 56rpx;
  133. line-height: 56rpx;
  134. @include main_bg_color(theme);
  135. border-radius:42rpx;
  136. font-size: 26rpx;
  137. color: #fff;
  138. position: relative;
  139. .num{
  140. @include main_color(theme);
  141. @include coupons_border_color(theme);
  142. background: #fff;
  143. min-width: 12rpx;
  144. border-radius: 15px;
  145. position: absolute;
  146. right: -14rpx;
  147. top: -15rpx;
  148. font-size: 22rpx;
  149. padding: 0 10rpx;
  150. height: 34rpx;
  151. line-height: 34rpx;
  152. }
  153. }
  154. .end{
  155. padding: 0 30rpx;
  156. height: 56rpx;
  157. line-height: 56rpx;
  158. border-radius:42rpx;
  159. font-size: 26rpx;
  160. color: #fff;
  161. position: relative;
  162. background:rgba(203,203,203,1);
  163. }
  164. }
  165. }
  166. }
  167. .lengthStr{
  168. font-size: 36rpx !important;
  169. }
  170. </style>