goods_list_item_v.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <!-- 商品组件:竖直方向
  2. 点击进入商品详情页
  3. 应用于商品列表页面
  4. -->
  5. <template name="goodsListItemV">
  6. <view class="goods_v_item flex_column_start_start" @click="goGoodsDetail(goods_info)">
  7. <view class="goods-img" :style="{backgroundImage: 'url('+goods_info.goodsImage+')'}"></view>
  8. <view class="bottom_part flex_column_between_start">
  9. <view class="top flex_column_start_start">
  10. <view class="goods-name">
  11. <rich-text :nodes="goods_info.goodsName"></rich-text>
  12. </view>
  13. <text class="goods-brief">{{goods_info.goodsBrief}}</text>
  14. </view>
  15. <view class="goods-price flex_row_start_center">
  16. <view class="left flex_row_start_end">
  17. <text class="unit">¥</text>
  18. <text class="price_int">{{this.$getPartNumber(goods_info.goodsPrice,'int')}}</text>
  19. <text class="price_decimal">{{this.$getPartNumber(goods_info.goodsPrice,'decimal')}}</text>
  20. </view>
  21. </view>
  22. <view class="activity_con">
  23. <block v-for="(item,index) in goods_info.activityList">
  24. <view class="act_label ladder_group" v-if="item.promotionType==105">
  25. {{item.promotionName}}
  26. </view>
  27. <view class="act_label discounts" v-if="item.promotionType==201||item.promotionType==202||item.promotionType==203||item.promotionType==204">
  28. {{item.promotionName}}
  29. </view>
  30. <view class="act_label secKill" v-if="item.promotionType==104">
  31. {{item.promotionName}}
  32. </view>
  33. <view class="act_label preSale" v-if="item.promotionType==103">
  34. {{item.promotionName}}
  35. </view>
  36. </block>
  37. </view>
  38. <view class="goods-price flex_row_start_center">
  39. <text class="sales">{{$formatW(goods_info.saleNum)}}人付款</text>
  40. </view>
  41. <view class="store_enter" @click.stop="goStoreDetail(goods_info.storeId)">
  42. <text class="stroe_name">{{goods_info.storeName}}</text>
  43. <text class="store_enter_btn">进店</text>
  44. <image class="store_enter_image" :src="imgUrl+'/good_search/enter_store.png'" mode=""></image>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. name: "goodsItemV",
  52. data() {
  53. return {
  54. imgUrl: getApp().globalData.imgUrl
  55. }
  56. },
  57. props: {
  58. goods_info: {
  59. type: Object,
  60. value: {}
  61. }
  62. },
  63. methods: {
  64. //跳转店铺详情页面
  65. goStoreDetail(vid) {
  66. uni.navigateTo({
  67. url: '/pages/store/shopHomePage?vid=' + vid
  68. })
  69. },
  70. //进入商品详情页
  71. goGoodsDetail(goods_info) {
  72. uni.navigateTo({
  73. url: '/pages/product/detail?productId=' + goods_info.defaultProductId + '&goodsId=' + goods_info.goodsId
  74. })
  75. },
  76. }
  77. }
  78. </script>
  79. <style lang='scss'>
  80. .goods_v_item {
  81. width: 345rpx;
  82. height: 700rpx;
  83. background: #fff;
  84. /* margin-top: 20rpx; */
  85. border-radius: 14rpx;
  86. overflow: hidden;
  87. margin-left: 20rpx;
  88. &:nth-child(1),
  89. &:nth-child(2) {
  90. margin-top: 0;
  91. }
  92. margin-bottom: 20rpx;
  93. .goods-img {
  94. background-size: cover;
  95. background-position: center center;
  96. /* background-repeat: no-repeat; */
  97. width: 345rpx;
  98. height: 345rpx;
  99. overflow: hidden;
  100. background-color: #fff;
  101. }
  102. .bottom_part {
  103. flex: 1;
  104. padding-bottom: 20rpx;
  105. width: 100%;
  106. }
  107. .top {
  108. width: 100%;
  109. }
  110. .goods-name {
  111. margin-top: 20rpx;
  112. font-size: 30rpx;
  113. color: $com-main-font-color;
  114. line-height: 38rpx;
  115. overflow: hidden;
  116. text-overflow: ellipsis;
  117. /* white-space: nowrap; */
  118. padding: 0 20rpx;
  119. width: 100%;
  120. text-overflow: ellipsis;
  121. display: -webkit-box;
  122. -webkit-line-clamp: 2;
  123. -webkit-box-orient: vertical;
  124. word-break: break-word;
  125. height: 76rpx;
  126. }
  127. .goods-brief {
  128. padding: 5rpx 20rpx 0;
  129. font-size: 24rpx;
  130. color: $main-third-color;
  131. white-space: nowrap;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. width: 100%;
  135. height: 40rpx;
  136. }
  137. .goods-price {
  138. padding: 0 20rpx;
  139. width: 100%;
  140. margin-top: 15rpx;
  141. .left {
  142. color: $main-color;
  143. align-items: baseline;
  144. .unit,
  145. .price_decimal {
  146. font-size: 24rpx;
  147. }
  148. .price_int {
  149. font-size: 34rpx;
  150. line-height: 34rpx;
  151. }
  152. }
  153. .sales {
  154. color: $main-third-color;
  155. font-size: 22rpx;
  156. /* margin-left: 29rpx; */
  157. }
  158. }
  159. }
  160. .activity_con {
  161. display: flex;
  162. font-size: 22rpx;
  163. color: #ffffff;
  164. padding-left: 20rpx;
  165. height: 30rpx;
  166. margin-top: 19rpx;
  167. .ladder_group,
  168. .discounts {
  169. height: 30rpx;
  170. background: linear-gradient(45deg, #FC1C1C 0%, #FF5539 100%);
  171. border-radius: 15rpx;
  172. line-height: 30rpx;
  173. padding: 0 9rpx;
  174. margin-left: 10rpx;
  175. }
  176. .discounts {
  177. background: linear-gradient(45deg, #FF6C00 0%, #FFC053 100%);
  178. }
  179. .ladder_group:nth-child(1) {
  180. margin-left: 0rpx;
  181. }
  182. }
  183. .store_enter {
  184. display: flex;
  185. font-size: 24rpx;
  186. align-items: center;
  187. padding-left: 20rpx;
  188. margin-top: 19rpx;
  189. }
  190. .stroe_name {
  191. max-width: 200rpx;
  192. white-space: nowrap;
  193. overflow: hidden;
  194. text-overflow: ellipsis;
  195. color: #666666;
  196. }
  197. .store_enter_btn {
  198. color: #333333;
  199. font-weight: bold;
  200. margin-left: 10rpx;
  201. }
  202. .store_enter_image {
  203. width: 11rpx;
  204. height: 19rpx;
  205. margin-left: 10rpx;
  206. }
  207. </style>