Authored by 张文文

商品添加销售标签

1 <template> 1 <template>
2 - <div class="bg">  
3 - <div class="product-list-item" v-if="list.length" v-for="(product,index) in list" @click="goDetail(product, index)" 2 + <div class="bg" v-if="list.length">
  3 + <div class="product-list-item" v-for="(product,index) in list" @click="goDetail(product, index)"
4 :key="index" :class="(index) % 2 === 0 && 'magrin-right'"> 4 :key="index" :class="(index) % 2 === 0 && 'magrin-right'">
5 <div class="item-top"> 5 <div class="item-top">
6 <div class="item-price"> 6 <div class="item-price">
@@ -10,6 +10,14 @@ @@ -10,6 +10,14 @@
10 </div> 10 </div>
11 <ImgSize class="item-imge" :src="product.default_images" :width="274" :height="274"/> 11 <ImgSize class="item-imge" :src="product.default_images" :width="274" :height="274"/>
12 <div class="item-name">{{product.product_name}}</div> 12 <div class="item-name">{{product.product_name}}</div>
  13 +
  14 + <div
  15 + v-if="product.customize_tag && product.customize_tag.length"
  16 + class="tag-wrapper">
  17 +
  18 + <ImgSize class="item-tag" :src="product.customize_tag[0].url2" :width="200" :height="200"/>
  19 + </div>
  20 +
13 </div> 21 </div>
14 </div> 22 </div>
15 </template> 23 </template>
@@ -186,6 +194,18 @@ export default { @@ -186,6 +194,18 @@ export default {
186 margin: 0 10px; 194 margin: 0 10px;
187 } 195 }
188 196
  197 + .tag-wrapper {
  198 + width: 120px;
  199 + height: 40px;
  200 + position: absolute;
  201 + top: 72px;
  202 + }
  203 +
  204 + .item-tag {
  205 + width: 84px;
  206 + height: 26px;
  207 + }
  208 +
189 .item-name { 209 .item-name {
190 font-size: 24px; 210 font-size: 24px;
191 color: #000; 211 color: #000;
@@ -11,6 +11,8 @@ @@ -11,6 +11,8 @@
11 </div> 11 </div>
12 <div class="name"><span>{{product.product_name}}</span></div> 12 <div class="name"><span>{{product.product_name}}</span></div>
13 <div class="price"><i>¥</i>{{product.price}}</div> 13 <div class="price"><i>¥</i>{{product.price}}</div>
  14 +
  15 + <ImgSize v-if="product.customize_tag && product.customize_tag.length" class="item-tag" :src="product.customize_tag[0].url2" :width="200" :height="60"/>
14 </div> 16 </div>
15 </div> 17 </div>
16 </div> 18 </div>
@@ -18,11 +20,13 @@ @@ -18,11 +20,13 @@
18 20
19 <script> 21 <script>
20 import SquareImg from './square-img'; 22 import SquareImg from './square-img';
  23 +import ImgSize from '../../../components/img-size';
21 24
22 export default { 25 export default {
23 name: 'TopList', 26 name: 'TopList',
24 components: { 27 components: {
25 SquareImg, 28 SquareImg,
  29 + ImgSize
26 }, 30 },
27 props: { 31 props: {
28 list: { 32 list: {
@@ -76,6 +80,17 @@ export default { @@ -76,6 +80,17 @@ export default {
76 width: 222px; 80 width: 222px;
77 padding: 0 8px; 81 padding: 0 8px;
78 float: left; 82 float: left;
  83 + position: relative;
  84 +
  85 + &:before {
  86 + content: "";
  87 + position: absolute;
  88 + left: 0;
  89 + right: 0;
  90 + top: 0;
  91 + bottom: 0;
  92 + z-index: 1;
  93 + }
79 } 94 }
80 } 95 }
81 96
@@ -86,6 +101,14 @@ export default { @@ -86,6 +101,14 @@ export default {
86 overflow: hidden; 101 overflow: hidden;
87 } 102 }
88 103
  104 + .item-tag {
  105 + position: absolute;
  106 + top: 0;
  107 + left: 10px;
  108 + width: 84px;
  109 + height: 26px;
  110 + }
  111 +
89 .name { 112 .name {
90 width: 200px; 113 width: 200px;
91 margin: 0 auto 8px; 114 margin: 0 auto 8px;
1 { 1 {
2 "name": "xianyu-ufo-app-web", 2 "name": "xianyu-ufo-app-web",
3 - "version": "0.0.2-beta-2", 3 + "version": "0.0.2-beta-3",
4 "private": true, 4 "private": true,
5 "description": "Xianyu Project With Express", 5 "description": "Xianyu Project With Express",
6 "repository": { 6 "repository": {