floor-style-3.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="floor-style-3">
  3. <div class="item-wrap">
  4. <div class="head-wrap">
  5. <div class="title-name" v-if="data.value.title.value.text">
  6. <span :style="{ backgroundColor: data.value.title.value.color }"></span>
  7. <h2 @click="$util.pushToTab(data.value.title.value.link.url)" :style="{ color: data.value.title.value.color }">{{ data.value.title.value.text }}</h2>
  8. </div>
  9. <div class="category-wrap">
  10. <li v-for="(item, index) in data.value.categoryList.value.list" :key="index">
  11. <router-link target="_blank" :to="{ path: '/goods/list', query: { category_id: item.category_id, level: item.level } }">{{ item.category_name }}</router-link>
  12. </li>
  13. </div>
  14. </div>
  15. <div class="body-wrap">
  16. <div class="left-img-wrap">
  17. <img v-if="data.value.leftImg.value.url" :src="$img(data.value.leftImg.value.url)" @click="$util.pushToTab(data.value.leftImg.value.link.url)" />
  18. </div>
  19. <ul class="right-goods-wrap">
  20. <li v-for="(item, index) in data.value.rightGoodsList.value.list" :key="index" @click="goSku(item.sku_id)">
  21. <h4>{{ item.goods_name }}</h4>
  22. <p class="ns-text-color">{{ item.introduction }}</p>
  23. <div class="img-wrap"><img alt="商品图片" :src="$img(item.goods_image.split(',')[0], {size: 'mid'})" @error="imageErrorRight(index)" /></div>
  24. </li>
  25. </ul>
  26. <ul class="bottom-goods-wrap">
  27. <li v-for="(item, index) in data.value.bottomGoodsList.value.list" :key="index" @click="goSku(item.sku_id)">
  28. <div class="info-wrap">
  29. <h4>{{ item.goods_name }}</h4>
  30. <p class="ns-text-color">{{ item.introduction }}</p>
  31. </div>
  32. <div class="img-wrap"><img alt="商品图片" :src="$img(item.goods_image.split(',')[0], {size: 'mid'})" @error="imageErrorBottom(index)" /></div>
  33. </li>
  34. </ul>
  35. <!-- <ul class="brand-wrap">
  36. <li v-for="(item, index) in data.value.brandList.value.list" :key="index" @click="$util.pushToTab({ path: '/list', query: { brand_id: item.brand_id } })">
  37. <img alt="品牌图片" :src="$img(item.image_url)" />
  38. </li>
  39. </ul> -->
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import { mapGetters } from 'vuex';
  46. export default {
  47. name: 'floor-style-3',
  48. props: {
  49. data: {
  50. type: Object
  51. }
  52. },
  53. data() {
  54. return {};
  55. },
  56. created() {},
  57. computed: {
  58. ...mapGetters(['defaultGoodsImage'])
  59. },
  60. methods: {
  61. goSku(skuId) {
  62. this.$util.pushToTab('/sku/' + skuId);
  63. },
  64. imageErrorRight(index) {
  65. this.data.value.rightGoodsList.value.list[index].goods_image = this.defaultGoodsImage;
  66. },
  67. imageErrorBottom(index) {
  68. this.data.value.bottomGoodsList.value.list[index].goods_image = this.defaultGoodsImage;
  69. }
  70. }
  71. };
  72. </script>
  73. <style lang="scss">
  74. .floor-style-3 {
  75. overflow: hidden;
  76. .item-wrap .head-wrap {
  77. height: 50px;
  78. line-height: 50px;
  79. .title-name {
  80. display: inline-block;
  81. span {
  82. float: left;
  83. width: 5px;
  84. height: 21px;
  85. margin-top: 15px;
  86. }
  87. h2 {
  88. float: left;
  89. margin-left: 10px;
  90. font-weight: bold;
  91. font-size: 20px;
  92. }
  93. }
  94. .category-wrap {
  95. float: right;
  96. display: flex;
  97. li {
  98. margin-right: 10px;
  99. }
  100. }
  101. }
  102. .body-wrap {
  103. .left-img-wrap {
  104. width: 190px;
  105. height: 360px;
  106. float: left;
  107. cursor: pointer;
  108. img {
  109. max-width: 100%;
  110. max-height: 100%;
  111. }
  112. }
  113. .right-goods-wrap {
  114. margin-left: 190px;
  115. text-align: center;
  116. overflow: hidden;
  117. li {
  118. float: left;
  119. width: 19.9%;
  120. background: #ffff;
  121. border-width: 0 0 1px 1px;
  122. border-color: #f9f9f9;
  123. border-style: solid;
  124. cursor: pointer;
  125. h4 {
  126. font-size: 14px;
  127. margin: 10px 20px 5px;
  128. overflow: hidden;
  129. white-space: nowrap;
  130. text-overflow: ellipsis;
  131. font-weight: normal;
  132. }
  133. p {
  134. font-size: 12px;
  135. overflow: hidden;
  136. white-space: nowrap;
  137. text-overflow: ellipsis;
  138. margin: 4px 30px;
  139. height: 20px;
  140. }
  141. }
  142. .img-wrap {
  143. width: 105px;
  144. height: 105px;
  145. line-height: 105px;
  146. display: inline-block;
  147. margin-bottom: 10px;
  148. img {
  149. max-width: 100%;
  150. max-height: 100%;
  151. }
  152. }
  153. }
  154. }
  155. .bottom-goods-wrap {
  156. overflow: hidden;
  157. display: flex;
  158. li {
  159. flex: 1;
  160. background: #fff;
  161. border-width: 0 0 1px 1px;
  162. border-color: #f9f9f9;
  163. border-style: solid;
  164. cursor: pointer;
  165. &:first-child {
  166. border-left: 0;
  167. }
  168. .info-wrap {
  169. display: inline-block;
  170. vertical-align: middle;
  171. text-align: center;
  172. h4 {
  173. font-size: 14px;
  174. margin: 0 10px 5px;
  175. overflow: hidden;
  176. white-space: nowrap;
  177. text-overflow: ellipsis;
  178. width: 90px;
  179. font-weight: normal;
  180. }
  181. p {
  182. font-size: 12px;
  183. overflow: hidden;
  184. white-space: nowrap;
  185. text-overflow: ellipsis;
  186. margin: 0 20px;
  187. width: 70px;
  188. }
  189. }
  190. .img-wrap {
  191. width: 70px;
  192. height: 70px;
  193. line-height: 70px;
  194. display: inline-block;
  195. vertical-align: middle;
  196. text-align: center;
  197. padding: 10px;
  198. img {
  199. max-width: 100%;
  200. max-height: 100%;
  201. }
  202. }
  203. }
  204. }
  205. .brand-wrap {
  206. display: flex;
  207. background: #fff;
  208. li {
  209. flex: 1;
  210. height: 50px;
  211. cursor: pointer;
  212. line-height: 50px;
  213. text-align: center;
  214. background: #fff;
  215. img {
  216. max-width: 100%;
  217. max-height: 100%;
  218. }
  219. }
  220. }
  221. }
  222. </style>