dt_recommend_goods_list.vue 6.4 KB

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