dt_goods_list_home02.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. <view v-if="imgsIndex==0" v-for="(imgsItem,imgsIndex) in item.productImages" :key="imgsIndex">
  6. <image :src="imgsItem.large||'http://139.9.103.171:1888/img/image/goods_def.png'" mode="widthFix"></image>
  7. </view>
  8. <view class="goods_sell_out_tip" v-if="false">补货中</view>
  9. </view>
  10. <view class="goods_info">
  11. <view class="goods_top">
  12. <view class="goods_time" v-if="false">10分钟</view>
  13. <view class="goods_title dt-text-row-one">{{item.name}}</view>
  14. </view>
  15. <view class="goods_des dt-text-row-one">{{item.caption?item.caption:''}}</view>
  16. <view style="position: relative;margin: 0 auto;">
  17. <image src="http://139.9.103.171:1888/img/image/ic_boom.png" style="width: 230upx;height: 128rpx;"></image>
  18. <!-- <view style="position: absolute;top: 40upx;left:-12upx;text-decoration: line-through;font-size: 22upx;color: #999;">
  19. {{item.marketPrice?"¥"+item.marketPrice:''}}
  20. </view> -->
  21. </view>
  22. <view style="position: relative;width: 350upx;display: flex;flex-direction: column;align-items: center;">
  23. <image src="http://139.9.103.171:1888/img/image/price_bg.png" style="width: 350upx;height: 60rpx;"></image>
  24. <view style="position: absolute;left: 20upx;right:20upx;top:0;bottom:0;display: flex;justify-content: space-between;align-items: center;">
  25. <view style="display: flex;color: #fff;font-weight: bold;">
  26. <view style="margin-top: 10upx;font-size: 24upx;">¥</view>
  27. <view style="margin-top: 10upx;">{{item.price}}</view>
  28. <view style="text-decoration: line-through;font-size: 20upx;margin-top: 14upx;margin-left: 10upx;color: #f7f7f7;font-weight: 100;">{{item.marketPrice?"¥"+item.marketPrice:''}}</view>
  29. </view>
  30. <view style="color:#f92325;font-size: 26upx;font-weight: bold;">立即加购</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. };
  42. },
  43. props: {
  44. dataList: {
  45. type: Array,
  46. default: []
  47. },
  48. bgColor:{
  49. type: String,
  50. default:'#f2f2f2'
  51. },
  52. },
  53. methods: {
  54. jumpGoodsDes(id) {
  55. console.log(id);
  56. uni.navigateTo({
  57. url: "/pagesM/pages/goods_des?id=" + id
  58. })
  59. }
  60. },
  61. }
  62. </script>
  63. <style lang="scss">
  64. .goods_list {
  65. .goods_item {
  66. border-radius: 20upx;
  67. background-color: #fff;
  68. margin-bottom: 10upx;
  69. display: flex;
  70. flex-direction: row;
  71. padding: 20upx;
  72. .goods_img {
  73. position: relative;
  74. width: 290upx;
  75. height: 300upx;
  76. image {
  77. width: 290upx;
  78. height: 300upx;
  79. }
  80. .goods_sell_out_tip {
  81. position: absolute;
  82. left: 50%;
  83. top: 50%;
  84. transform: translate(-50%, -50%);
  85. width: 98upx;
  86. height: 98upx;
  87. background: rgba(0, 0, 0, 1);
  88. opacity: 0.6;
  89. border-radius: 50%;
  90. font-size: 22upx;
  91. color: #fff;
  92. display: flex;
  93. flex-direction: row;
  94. align-items: center;
  95. justify-content: center;
  96. }
  97. }
  98. .goods_info {
  99. display: flex;
  100. flex-direction: column;
  101. justify-content: space-between;
  102. padding-left: 26upx;
  103. flex: 1;
  104. // .mid-wrap{
  105. // height:150rpx;
  106. .goods_top {
  107. display: flex;
  108. flex-direction: row;
  109. align-items: center;
  110. .goods_time {
  111. font-size: 18upx;
  112. border-radius: 4upx;
  113. background: $dt-color-primary;
  114. padding: 5upx 10upx;
  115. color: #fff;
  116. }
  117. .goods_title {
  118. flex: 1;
  119. color: #3A3A3A;
  120. font-weight:bold;
  121. font-size: 28upx;
  122. letter-spacing: 1upx;
  123. }
  124. }
  125. .goods_des {
  126. font-size: 24upx;
  127. margin: 10upx 0;
  128. color: #999;
  129. font-weight: 500;
  130. }
  131. // }
  132. .goods_active {
  133. display: flex;
  134. flex-direction: row;
  135. align-items: center;
  136. flex-wrap: wrap;
  137. .active_item {
  138. // border: 1upx solid #ee1515;
  139. // border-radius: 4upx;
  140. padding: 5upx 10upx;
  141. color: #ee1515;
  142. font-size: 18upx;
  143. margin-right: 20upx;
  144. position: relative;
  145. margin-bottom: 10upx;
  146. }
  147. .active_item::after {
  148. display: flex;
  149. box-sizing: border-box;
  150. align-items: center;
  151. content: "";
  152. position: absolute;
  153. top: 0;
  154. left: 0;
  155. width: 200%;
  156. height: 200%;
  157. transform: scale(0.5);
  158. transform-origin: 0 0;
  159. border: 1upx solid #ee1515;
  160. border-radius: 4upx;
  161. pointer-events: none;
  162. }
  163. }
  164. .goods_bottom {
  165. display: flex;
  166. flex-direction: row;
  167. justify-content: space-between;
  168. align-items: center;
  169. .sell_info {
  170. display: flex;
  171. flex-direction: column;
  172. .sell_price {
  173. display: flex;
  174. flex-direction: row;
  175. align-items: center;
  176. text{
  177. font-size: 36upx;
  178. color: #DB4444;
  179. }
  180. text:last-child {
  181. color: #888888;
  182. font-size: 22upx;
  183. text-decoration: line-through;
  184. margin-left: 20upx;
  185. }
  186. }
  187. .sell_count {
  188. margin-top: 10upx;
  189. font-size: 22upx;
  190. color: #888888;
  191. }
  192. }
  193. .buy {
  194. width: 100upx;
  195. height: 50upx;
  196. line-height: 50upx;
  197. background: $dt-color-primary;
  198. border-radius: 25upx;
  199. font-size: 0.8rem;
  200. text-align: center;
  201. color: #fff;
  202. }
  203. }
  204. }
  205. }
  206. }
  207. </style>