dt_goods_list_h.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="content" :style="{backgroundImage: 'url('+(dataItem.path1?dataItem.path1:'')+')'}" @tap="tapMore">
  3. <view class="banner">
  4. <!-- <view class="name">111</view>
  5. <view class="explain">111</view>
  6. <view class="gotosee">去看看</view> -->
  7. </view>
  8. <scroll-view v-if="dataList.length>0" class="scroll-view" scroll-x="true" >
  9. <view class="goods_list">
  10. <view class="goods_item" v-for="(item,index) in dataList" :key="index" @tap="jumpGoodsDes(item.id)">
  11. <view class="goods_img">
  12. <image :src="item.thumbnail|| 'http://139.9.103.171:1888/img/image/goods_def.png'"></image>
  13. <view class="goods_sell_out_tip" v-if="false">补货中</view>
  14. </view>
  15. <!-- <view class="goods_info">
  16. <view class="goods_name dt-text-row-two">
  17. <view class="type">自营</view>
  18. {{item.name}}
  19. </view>
  20. <view class="goods_bottom">
  21. <view class="goods_price">{{item.price}}</view>
  22. <image v-if="!share" src="../static/image/shopCar2.png" class="goods_buy_icon"></image>
  23. <image v-if="share" src="../static/image/share_team_goods.png" class="goods_buy_icon"></image>
  24. </view>
  25. </view> -->
  26. <!-- <view class="goods_info">
  27. <view class="goods_top">
  28. <view class="goods_time" v-if="false">10分钟</view>
  29. <view class="goods_title dt-text-row-two">{{item.name}}</view>
  30. </view>
  31. <view class="goods_des">{{item.caption}}</view>
  32. <view class="goods_active" >
  33. </view>
  34. <view class="goods_bottom">
  35. <view class="sell_info">
  36. <view class="sell_price">
  37. <text>¥{{item.price}}</text>
  38. <text>{{item.marketPrice?"¥"+item.marketPrice:''}}</text>
  39. </view>
  40. <view class="sell_count">销量{{item.sales?item.sales:0}}笔</view>
  41. </view>
  42. <view class="buy">购买</view>
  43. </view>
  44. </view> -->
  45. <view class="dt-text-row-one" style="font-size:30upx;font-weight:bold;color:rgba(51,51,51,1);text-align: center;">
  46. {{item.name}}
  47. </view>
  48. <view class="dt-text-row-two" style="font-size:24upx;color:rgba(51,51,51,1);text-align: center;margin-top: 16upx;">
  49. {{item.caption?item.caption:''}}
  50. </view>
  51. </view>
  52. <view class="goods_item" @tap="tapMore">
  53. <view style="width: 232upx;height:100%;display: flex;align-items: center;justify-content: center;">
  54. <view class="text">查看更多</view>
  55. </view>
  56. </view>
  57. </view>
  58. </scroll-view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. props: {
  64. dataList: {
  65. type: Array,
  66. default: []
  67. },
  68. share: {
  69. type:Boolean,
  70. default: false
  71. },
  72. dataItem: {
  73. type:Object,
  74. default:{}
  75. }
  76. },
  77. data() {
  78. return {};
  79. },
  80. methods: {
  81. tapMore() {
  82. this.$emit("more");
  83. },
  84. jumpGoodsDes(id) {
  85. console.log(id);
  86. uni.navigateTo({
  87. url: "/pagesM/pages/goods_des?id=" + id
  88. })
  89. }
  90. },
  91. created() { }
  92. };
  93. </script>
  94. <style lang="scss">
  95. .content{
  96. // border-radius: 20upx;
  97. background-repeat: no-repeat;
  98. background-size: 100% 100%;
  99. margin: 0 20upx;
  100. }
  101. .banner{
  102. height:229upx;
  103. background-color: transparent;
  104. // border-radius:10upx 10upx 0px 0px;
  105. // padding-left: 53upx;
  106. // padding-top: 29upx;
  107. .name{
  108. font-size:42upx;
  109. height: 42upx;
  110. font-family:PingFang SC;
  111. font-weight:800;
  112. color:rgba(255,255,255,1);
  113. }
  114. .explain{
  115. margin-top: 18upx;
  116. height:53upx;
  117. font-size:24upx;
  118. font-family:PingFang SC;
  119. font-weight:400;
  120. color:rgba(255,255,255,1);
  121. }
  122. .gotosee{
  123. margin-top: 21upx;
  124. border-radius: 25upx;
  125. height:50upx;
  126. width:100upx;
  127. font-size: 24upx;
  128. text-align: center;
  129. line-height: 50upx;
  130. background-color: $dt-color-primary;
  131. color:#fff
  132. }
  133. }
  134. .scroll-view{
  135. background-color: transparent;
  136. height: 468upx;
  137. }
  138. .goods_list {
  139. display: flex;
  140. .goods_item {
  141. // margin: 5.1upx;
  142. margin: 0 32upx;
  143. margin-bottom: 12upx;
  144. width: 176upx;
  145. display: flex;
  146. flex-direction: column;
  147. .goods_img {
  148. position: relative;
  149. width:176upx;
  150. height:225upx;
  151. margin-top: 25upx;
  152. image {
  153. width:176upx;
  154. height:176upx;
  155. position: absolute;
  156. top: 50%;
  157. transform: translateY(-50%);
  158. }
  159. .goods_sell_out_tip {
  160. position: absolute;
  161. left: 50%;
  162. top: 50%;
  163. transform: translate(-50%, -50%);
  164. width: 98upx;
  165. height: 98upx;
  166. background: rgba(0, 0, 0, 1);
  167. opacity: 0.6;
  168. border-radius: 50%;
  169. font-size: 22upx;
  170. color: #fff;
  171. display: flex;
  172. flex-direction: row;
  173. align-items: center;
  174. justify-content: center;
  175. }
  176. }
  177. .goods_info{
  178. margin: 17upx 0;
  179. .type{
  180. display: inline-block;
  181. background-color: red;
  182. color: #fff;
  183. font-size: 20upx;
  184. border-radius: 6upx;
  185. line-height: 20upx;
  186. padding: 5upx;
  187. }
  188. .goods_name{
  189. height:63upx;
  190. font-size:23upx;
  191. font-weight:400;
  192. color:rgba(51,51,51,1);
  193. line-height:31upx;
  194. }
  195. .goods_bottom{
  196. display: flex;
  197. justify-content: space-between;
  198. margin-top: 25upx;
  199. .goods_price_icon{
  200. display: inline-block;
  201. font-size:24upx;
  202. color:$dt-color-primary;
  203. line-height:31upx;
  204. }
  205. .goods_price{
  206. font-size:24upx;
  207. font-weight:bold;
  208. color:$dt-color-primary;
  209. line-height:31upx;
  210. }
  211. .goods_buy_icon{
  212. width:30upx;
  213. height:30upx;
  214. }
  215. }
  216. }
  217. }
  218. .text {
  219. font-size:24upx;
  220. font-weight:400;
  221. color:rgba(102,102,102,1);
  222. }
  223. }
  224. </style>