Parcourir la source

Merge branch 'master' of http://git.izouma.com/xiongzhu/9th

xuqiang il y a 4 ans
Parent
commit
91ec060c4d

+ 6 - 2
src/main/nine-space/src/components/product/ProductBanner.vue

@@ -103,12 +103,16 @@ export default {
             if (!this.info.liked) {
                 this.$http.get(`/collection/${this.info.id}/like`).then(() => {
                     this.$emit('getProduct');
-                    this.$toast.success('收藏成功');
+                    setTimeout(() => {
+                        this.$toast.success('收藏成功');
+                    }, 300);
                 });
             } else {
                 this.$http.get(`/collection/${this.info.id}/unlike`).then(() => {
                     this.$emit('getProduct');
-                    this.$toast.success('取消收藏');
+                    setTimeout(() => {
+                        this.$toast.success('取消收藏');
+                    }, 300);
                 });
             }
         }

+ 31 - 3
src/main/nine-space/src/views/product/Detail.vue

@@ -13,10 +13,14 @@
 
             <div class="price-line" v-if="info.salable">
                 <div class="text" v-if="info.number">编号 {{ info.number }}</div>
-                <div class="text" v-if="info.salable && info.total > 0">
+                <div class="text" v-if="info.salable && info.stock > 0">
                     <span>已售 {{ info.sale }}</span>
                     <span>剩余 {{ info.stock }}</span>
                 </div>
+                <div class="text total" v-if="info.total > 1">
+                    <span>限量</span>
+                    <span>{{ info.total }}份</span>
+                </div>
             </div>
             <!-- <div class="title">{{ info.name }}</div> -->
             <div class="info-bottom">
@@ -477,7 +481,8 @@ export default {
     .price-line {
         display: flex;
         justify-content: center;
-        margin-top: 4px;
+        align-items: center;
+        margin-top: 16px;
         .sub {
             flex-grow: 1;
             margin-left: 5px;
@@ -499,7 +504,8 @@ export default {
         .text {
             font-size: @font1;
             color: @text3;
-            line-height: 26px;
+            line-height: 20px;
+            height: 20px;
             background-color: #202122;
             border-radius: 4px;
             padding: 0 10px;
@@ -507,6 +513,28 @@ export default {
             span + span {
                 margin-left: 10px;
             }
+
+            &.total {
+                padding: 0 0;
+                border-radius: 4px;
+                overflow: hidden;
+                span {
+                    display: inline-block;
+                    padding: 0 12px;
+                    &:first-child {
+                        background-color: @prim;
+                        color: #181818;
+                    }
+                    &:last-child {
+                        color: @prim;
+                        background-color: #3d3d3a;
+                    }
+                }
+
+                span + span {
+                    margin-left: 0px;
+                }
+            }
         }
         .text + .text {
             margin-left: 10px;