dt_goods_list_hot.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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">
  15. <view
  16. v-if="item.caption"
  17. style="
  18. overflow: hidden;
  19. text-overflow:ellipsis;
  20. white-space: nowrap;
  21. margin-right: 26upx;
  22. max-width: 250upx;
  23. padding: 8upx 12upx;
  24. background-color: #f1921a;
  25. color: #fff;
  26. border-radius: 10upx;">{{item.caption?item.caption:''}}</view>
  27. <view v-if="item.promotion&&item.promotion.freeShipping" style="
  28. padding: 8upx 12upx;
  29. background-color: #fce9be;
  30. color: #f1921a;
  31. border-radius: 10upx;">
  32. {{item.promotion.freeShipping.name}}
  33. </view>
  34. </view>
  35. <view
  36. :style="{backgroundColor:theme==1?'#fce9be':'#fd3400',color:theme==1?'#f1921a':'#fff'}"
  37. style="
  38. display: inline-block;
  39. margin-top: 10upx;
  40. padding: 8upx 12upx;
  41. font-size: 24upx;
  42. border-radius: 10upx;">
  43. 热卖中
  44. </view>
  45. <!-- <view class="goods_active" > -->
  46. <!-- <view class="active_item">特价抢购</view>
  47. <view class="active_item">1元换购</view>
  48. <view class="active_item">包邮</view> -->
  49. <!-- </view> -->
  50. </view>
  51. <view class="goods_bottom margin-top-10">
  52. <view v-if="theme==1" style="position: relative;">
  53. <view style="display: flex;overflow: hidden;border-radius: 25px;">
  54. <view style="font-size: 28upx;color: #a17603;background-color: #fbc94c;padding: 0 16rpx;height: 50upx;line-height: 55upx;">特惠价</view>
  55. <view style="background-color: #ea2b33;display: flex;color: #fff;padding: 0 16rpx;width: 250upx;height: 50upx;line-height: 55upx;">
  56. <view class="sell_info">
  57. <view class="sell_price" style="color: #fff;">
  58. <text style="font-size: 20upx;margin-top: 6upx;font-weight: bold;">¥</text>
  59. <text>{{item.price}}</text>
  60. <text style="margin-top: 6upx;">{{item.marketPrice?"¥"+item.marketPrice:''}}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <image src="http://139.9.103.171:1888/img/image/ic_gift.png" mode="widthFix" style="position: absolute;width: 100upx;right: -25upx;bottom: -10upx;" />
  66. </view>
  67. <view v-if="theme==2" style="display: flex;color: #fff;height: 50upx;line-height: 50upx;">
  68. <view class="sell_info" >
  69. <view class="sell_price" style="color: #ff3307;">
  70. <text style="font-size: 20upx;margin-top: 6upx;font-weight: bold;">¥</text>
  71. <text>{{item.price}}</text>
  72. <text style="margin-top: 6upx;color: #ffa8ac;">{{item.marketPrice?"¥"+item.marketPrice:''}}</text>
  73. </view>
  74. </view>
  75. <image src="http://139.9.103.171:1888/img/image/ic_hot.png" mode="widthFix" style="width: 30upx;margin-left: 20upx;"></image>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. export default {
  84. props: {
  85. dataList: {
  86. type: Array,
  87. default: []
  88. },
  89. bgColor:{
  90. type: String,
  91. default:'#f2f2f2'
  92. },
  93. theme:{
  94. type:String,
  95. default:'1'
  96. }
  97. },
  98. data() {
  99. return {};
  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. padding: 20upx;
  115. .goods_item {
  116. border-radius: 20upx;
  117. background-color: #fff;
  118. margin-bottom: 20upx;
  119. display: flex;
  120. flex-direction: row;
  121. padding: 20upx;
  122. height: 216upx;
  123. .goods_img {
  124. position: relative;
  125. width: 222upx;
  126. height: 222upx;
  127. image {
  128. width: 222upx;
  129. height: 222upx;
  130. }
  131. .goods_sell_out_tip {
  132. position: absolute;
  133. left: 50%;
  134. top: 50%;
  135. transform: translate(-50%, -50%);
  136. width: 98upx;
  137. height: 98upx;
  138. background: rgba(0, 0, 0, 1);
  139. opacity: 0.6;
  140. border-radius: 50%;
  141. font-size: 22upx;
  142. color: #fff;
  143. display: flex;
  144. flex-direction: row;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. }
  149. .goods_info {
  150. display: flex;
  151. flex-direction: column;
  152. justify-content: space-between;
  153. padding-left: 26upx;
  154. flex: 1;
  155. // .mid-wrap{
  156. // height:150rpx;
  157. .goods_top {
  158. display: flex;
  159. flex-direction: row;
  160. align-items: center;
  161. .goods_time {
  162. font-size: 18upx;
  163. border-radius: 4upx;
  164. background: $dt-color-primary;
  165. padding: 5upx 10upx;
  166. color: #fff;
  167. }
  168. .goods_title {
  169. margin-top: 10upx;
  170. flex: 1;
  171. color: #3A3A3A;
  172. font-weight:bold;
  173. font-size: 28upx;
  174. letter-spacing: 1upx;
  175. // margin-left: 20upx;
  176. }
  177. }
  178. .goods_des {
  179. font-size: 24upx;
  180. font-weight: 500;
  181. margin-top: 10upx;
  182. display: flex;
  183. }
  184. // }
  185. .goods_active {
  186. display: flex;
  187. flex-direction: row;
  188. align-items: center;
  189. flex-wrap: wrap;
  190. .active_item {
  191. // border: 1upx solid #ee1515;
  192. // border-radius: 4upx;
  193. padding: 5upx 10upx;
  194. color: #ee1515;
  195. font-size: 18upx;
  196. margin-right: 20upx;
  197. position: relative;
  198. margin-bottom: 10upx;
  199. }
  200. .active_item::after {
  201. display: flex;
  202. box-sizing: border-box;
  203. align-items: center;
  204. content: "";
  205. position: absolute;
  206. top: 0;
  207. left: 0;
  208. width: 200%;
  209. height: 200%;
  210. transform: scale(0.5);
  211. transform-origin: 0 0;
  212. border: 1upx solid #ee1515;
  213. border-radius: 4upx;
  214. pointer-events: none;
  215. }
  216. }
  217. .goods_bottom {
  218. display: flex;
  219. flex-direction: row;
  220. align-items: center;
  221. .sell_info {
  222. display: flex;
  223. flex-direction: column;
  224. .sell_price {
  225. display: flex;
  226. flex-direction: row;
  227. text{
  228. font-size: 36upx;
  229. }
  230. text:last-child {
  231. color: #eba7a4;
  232. font-size: 22upx;
  233. text-decoration: line-through;
  234. margin-left: 10upx;
  235. }
  236. }
  237. .sell_count {
  238. margin-top: 10upx;
  239. font-size: 22upx;
  240. color: #eba7a4;
  241. }
  242. }
  243. .buy {
  244. width: 100upx;
  245. height: 50upx;
  246. line-height: 50upx;
  247. background: $dt-color-primary;
  248. border-radius: 25upx;
  249. font-size: 0.8rem;
  250. text-align: center;
  251. color: #fff;
  252. }
  253. }
  254. }
  255. }
  256. }
  257. </style>