dt_goods_list.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="goods_list" :style="{backgroundColor:bgColor}">
  3. <view class="goods_item" v-for="(item,index) in dataList" :key="index" @tap="jumpGoodsDes(item.id||item.productId)">
  4. <view class="goods_img">
  5. <image :src="item.thumbnail||item.img|| 'http://139.9.103.171:1888/img/image/goods_def.png'"></image>
  6. <view class="goods_sell_out_tip" v-if="false">补货中</view>
  7. </view>
  8. <view class="goods_info">
  9. <view>
  10. <view class="goods_top">
  11. <view class="goods_time" v-if="false">10分钟</view>
  12. <view class="goods_title dt-text-row-one">{{item.name}}</view>
  13. </view>
  14. <view class="goods_des">{{item.caption?item.caption:''}}</view>
  15. <scroll-view scroll-x="true" style="width: 100%;margin-top: 10upx;height: 30upx;">
  16. <view v-if="item.promotion" style="display: flex;white-space: nowrap;">
  17. <view v-if="item.promotion.coupon" style="
  18. padding: 0 8rpx;
  19. height: 30upx;
  20. line-height: 30upx;
  21. font-size: 20rpx;
  22. color: #DB4444;
  23. margin-right: 5upx;
  24. background:rgba(219,68,68,0.1);
  25. border-radius: 25px;">
  26. {{item.promotion.coupon.name}}
  27. </view>
  28. <view v-if="item.promotion.freeShipping" style="
  29. padding: 0 8rpx;
  30. height: 30upx;
  31. line-height: 30upx;
  32. font-size: 20rpx;
  33. color: #DB4444;
  34. margin-right: 5upx;
  35. background:rgba(219,68,68,0.1);
  36. border-radius: 25px;">
  37. {{item.promotion.freeShipping.name}}
  38. </view>
  39. <view
  40. v-if="item.promotion.gifts.length>0"
  41. v-for="(giftsItem,giftsIndex) in item.promotion.gifts"
  42. :key="giftsIndex"
  43. style="
  44. padding: 0 8rpx;
  45. height: 30upx;
  46. line-height: 30upx;
  47. font-size: 20rpx;
  48. color: #DB4444;
  49. margin-right: 5upx;
  50. background:rgba(219,68,68,0.1);
  51. border-radius: 25px;">
  52. {{giftsItem.name}}
  53. </view>
  54. <view v-if="item.promotion.moneyOffs.length>0"
  55. v-for="(moneyOffsItem,moneyOffsIndex) in item.promotion.moneyOffs"
  56. :key="moneyOffsIndex"
  57. style="
  58. padding: 0 8rpx;
  59. height: 30upx;
  60. line-height: 30upx;
  61. font-size: 20rpx;
  62. color: #444FDB;
  63. margin-right: 5upx;
  64. background:rgba(68,79,219,0.1);
  65. border-radius: 25px;">
  66. {{moneyOffsItem.name}}
  67. </view>
  68. </view>
  69. </scroll-view>
  70. <!-- <view class="goods_active" > -->
  71. <!-- <view class="active_item">特价抢购</view>
  72. <view class="active_item">1元换购</view>
  73. <view class="active_item">包邮</view> -->
  74. <!-- </view> -->
  75. </view>
  76. <view class="goods_bottom">
  77. <view class="sell_info">
  78. <view class="sell_price">
  79. <text style="font-size: 20upx;margin-top: 10upx;">¥</text>
  80. <text>{{item.price}}</text>
  81. <text style="margin-top: 10upx;">{{item.marketPrice?"¥"+item.marketPrice:''}}</text>
  82. </view>
  83. <!-- <view class="sell_count">销量{{item.sales?item.sales:0}}笔</view> -->
  84. </view>
  85. <view class="buy">购买</view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. export default {
  93. props: {
  94. dataList: {
  95. type: Array,
  96. default: []
  97. },
  98. bgColor:{
  99. type: String,
  100. default:'#f2f2f2'
  101. }
  102. },
  103. data() {
  104. return {};
  105. },
  106. methods: {
  107. jumpGoodsDes(id) {
  108. console.log(id);
  109. uni.navigateTo({
  110. url: "/pagesM/pages/goods_des?id=" + id
  111. })
  112. }
  113. },
  114. created() { }
  115. };
  116. </script>
  117. <style lang="scss">
  118. .goods_list {
  119. padding: 20upx;
  120. .goods_item {
  121. border-radius: 20upx;
  122. background-color: #fff;
  123. margin-bottom: 20upx;
  124. display: flex;
  125. flex-direction: row;
  126. padding: 20upx;
  127. height: 216upx;
  128. .goods_img {
  129. position: relative;
  130. width: 222upx;
  131. height: 222upx;
  132. image {
  133. width: 222upx;
  134. height: 222upx;
  135. }
  136. .goods_sell_out_tip {
  137. position: absolute;
  138. left: 50%;
  139. top: 50%;
  140. transform: translate(-50%, -50%);
  141. width: 98upx;
  142. height: 98upx;
  143. background: rgba(0, 0, 0, 1);
  144. opacity: 0.6;
  145. border-radius: 50%;
  146. font-size: 22upx;
  147. color: #fff;
  148. display: flex;
  149. flex-direction: row;
  150. align-items: center;
  151. justify-content: center;
  152. }
  153. }
  154. .goods_info {
  155. display: flex;
  156. flex-direction: column;
  157. justify-content: space-between;
  158. padding-left: 26upx;
  159. flex: 1;
  160. // .mid-wrap{
  161. // height:150rpx;
  162. .goods_top {
  163. display: flex;
  164. flex-direction: row;
  165. align-items: center;
  166. .goods_time {
  167. font-size: 18upx;
  168. border-radius: 4upx;
  169. background: $dt-color-primary;
  170. padding: 5upx 10upx;
  171. color: #fff;
  172. }
  173. .goods_title {
  174. margin-top: 10upx;
  175. flex: 1;
  176. color: #3A3A3A;
  177. font-weight:bold;
  178. font-size: 28upx;
  179. letter-spacing: 1upx;
  180. // margin-left: 20upx;
  181. }
  182. }
  183. .goods_des {
  184. font-size: 24upx;
  185. color: #999;
  186. font-weight: 500;
  187. margin-top: 10upx;
  188. height: 60upx;
  189. line-height: 30upx;
  190. }
  191. // }
  192. .goods_active {
  193. display: flex;
  194. flex-direction: row;
  195. align-items: center;
  196. flex-wrap: wrap;
  197. .active_item {
  198. // border: 1upx solid #ee1515;
  199. // border-radius: 4upx;
  200. padding: 5upx 10upx;
  201. color: #ee1515;
  202. font-size: 18upx;
  203. margin-right: 20upx;
  204. position: relative;
  205. margin-bottom: 10upx;
  206. }
  207. .active_item::after {
  208. display: flex;
  209. box-sizing: border-box;
  210. align-items: center;
  211. content: "";
  212. position: absolute;
  213. top: 0;
  214. left: 0;
  215. width: 200%;
  216. height: 200%;
  217. transform: scale(0.5);
  218. transform-origin: 0 0;
  219. border: 1upx solid #ee1515;
  220. border-radius: 4upx;
  221. pointer-events: none;
  222. }
  223. }
  224. .goods_bottom {
  225. display: flex;
  226. flex-direction: row;
  227. justify-content: space-between;
  228. align-items: center;
  229. .sell_info {
  230. display: flex;
  231. flex-direction: column;
  232. .sell_price {
  233. display: flex;
  234. flex-direction: row;
  235. align-items: center;
  236. text{
  237. font-size: 36upx;
  238. color: #DB4444;
  239. }
  240. text:last-child {
  241. color: #888888;
  242. font-size: 22upx;
  243. text-decoration: line-through;
  244. margin-left: 20upx;
  245. }
  246. }
  247. .sell_count {
  248. margin-top: 10upx;
  249. font-size: 22upx;
  250. color: #888888;
  251. }
  252. }
  253. .buy {
  254. width: 100upx;
  255. height: 50upx;
  256. line-height: 50upx;
  257. background: $dt-color-primary;
  258. border-radius: 25upx;
  259. font-size: 0.8rem;
  260. text-align: center;
  261. color: #fff;
  262. }
  263. }
  264. }
  265. }
  266. }
  267. </style>