Browse Source

统一前端规范

hangb 7 years ago
parent
commit
50d999cda9

+ 1 - 1
components/product/ComponentGoods.vue

@@ -49,7 +49,7 @@
           </div>
           </div>
           <div v-if="!compGoods.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
           <div v-if="!compGoods.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
           <div class="from" v-if="compGoods.reserve && compGoods.reserve > 0">
           <div class="from" v-if="compGoods.reserve && compGoods.reserve > 0">
-            起拍:<span v-if="compGoods.minBuyQty">{{compGoods.minBuyQty}}</span>
+            最小起订量:<span v-if="compGoods.minBuyQty">{{compGoods.minBuyQty}}</span>
           </div>
           </div>
           <!--<div class="multiple" v-if="compGoods.reserve > 0">
           <!--<div class="multiple" v-if="compGoods.reserve > 0">
             倍数:<span>{{compGoods.minPackQty}}</span>
             倍数:<span>{{compGoods.minPackQty}}</span>

+ 5 - 2
components/product/brand/BrandComponent.vue

@@ -12,14 +12,16 @@
     <table class="table" v-if="activeTab == 0">
     <table class="table" v-if="activeTab == 0">
       <thead>
       <thead>
         <tr class="bgf7">
         <tr class="bgf7">
-          <th width="500">型号</th>
-          <th width="300">数据手册</th>
+          <th width="300">型号</th>
+          <th width="300">类目(产品名称)</th>
+          <th width="200">数据手册</th>
           <th width="200">操作</th>
           <th width="200">操作</th>
         </tr>
         </tr>
       </thead>
       </thead>
       <tbody>
       <tbody>
         <tr class="text-center" v-for="item in list.content">
         <tr class="text-center" v-for="item in list.content">
           <td><nuxt-link :to="'/product/component/' + item.uuid"><span>{{item.code}}</span></nuxt-link></td>
           <td><nuxt-link :to="'/product/component/' + item.uuid"><span>{{item.code}}</span></nuxt-link></td>
+          <td><nuxt-link :to="'/product/kind/' + item.kindid"><span>{{item.kind.nameCn || '-'}}</span></nuxt-link></td>
           <td><a @click="toAttach(item.attach)"><button class="btn btn-default"  :disabled="!item.attach" :class="{'disabledbtn':!item.attach}">Datasheet手册</button></a></td>
           <td><a @click="toAttach(item.attach)"><button class="btn btn-default"  :disabled="!item.attach" :class="{'disabledbtn':!item.attach}">Datasheet手册</button></a></td>
           <td>
           <td>
             <button class="btn btn-default disabledbtn" :disabled="true">申请样片</button>
             <button class="btn btn-default disabledbtn" :disabled="true">申请样片</button>
@@ -127,6 +129,7 @@
         return this.$store.state.brandComponent.component
         return this.$store.state.brandComponent.component
       },
       },
       list () {
       list () {
+        console.log('1111', this.lists.data)
         return this.lists.data
         return this.lists.data
       },
       },
       brand () {
       brand () {

+ 14 - 1
components/product/brand/CategoriesList.vue

@@ -13,11 +13,24 @@
 </template>
 </template>
 
 
 <script>
 <script>
+  // 实现深拷贝
+  function deepCopy(target) {
+    if (typeof target !== 'object') return
+    // 判断目标类型,来创建返回值
+    var newObj = target instanceof Array ? [] : {}
+    for (var item in target) {
+      // 只复制元素自身的属性,不复制原型链上的
+      if (target.hasOwnProperty(item)) {
+        newObj[item] = typeof target[item] === 'object' ? deepCopy(target[item]) : target[item]
+        }
+      }
+      return newObj
+  }
   export default {
   export default {
     name: 'CategoriesList',
     name: 'CategoriesList',
     computed: {
     computed: {
       list () {
       list () {
-        let brands = this.$store.state.brandCategories.categories.data
+        let brands = deepCopy(this.$store.state.brandCategories.categories.data)
         if (!brands || brands.length === 0) {
         if (!brands || brands.length === 0) {
           return []
           return []
         }
         }

+ 20 - 12
components/product/component/ComponentDetail.vue

@@ -20,10 +20,10 @@
               <div :title="list.brand.nameCn"><a class="message-body blue" target="_blank" :href="`/product/brand/${list.brand.uuid}`">{{list.brand.nameCn}}</a></div>
               <div :title="list.brand.nameCn"><a class="message-body blue" target="_blank" :href="`/product/brand/${list.brand.uuid}`">{{list.brand.nameCn}}</a></div>
             </div>
             </div>
             <div class="message-detail">
             <div class="message-detail">
-              <div class="message-item">产品生命周期</div>
+              <div class="message-item">类目(产品名称)</div>
               <div class="colon">:</div>
               <div class="colon">:</div>
               <div class="message-body">
               <div class="message-body">
-                {{list.lifecycle | lifecycleFilter}}
+                {{list.kind.nameCn || ''}}
               </div>
               </div>
             </div>
             </div>
             <div class="message-detail">
             <div class="message-detail">
@@ -31,6 +31,21 @@
               <div class="colon">:</div>
               <div class="colon">:</div>
               <div class="message-body">{{list.reserve || '暂无库存'}}</div>
               <div class="message-body">{{list.reserve || '暂无库存'}}</div>
             </div>
             </div>
+            <div class="message-detail">
+              <div class="message-item">产品生命周期</div>
+              <div class="colon">:</div>
+              <div class="message-body">
+                {{list.lifecycle | lifecycleFilter}}
+              </div>
+            </div>
+            <div class="message-detail">
+              <div class="message-item">规格书</div>
+              <div class="colon">:</div>
+              <div class="message-body">
+                <img src="/images/all/pdf.png" alt="" @click="toAttach(list.attach)" v-if="list.attach">
+                <span v-if="!list.attach">暂无</span>
+              </div>
+            </div>
             <div class="message-detail">
             <div class="message-detail">
               <div class="message-item">产品描述</div>
               <div class="message-item">产品描述</div>
               <div class="colon" style="margin-right: 17px">:</div>
               <div class="colon" style="margin-right: 17px">:</div>
@@ -46,15 +61,7 @@
               </div>
               </div>
               <div class="description" v-if="!list.description">-</div>
               <div class="description" v-if="!list.description">-</div>
             </div>
             </div>
-            <div class="message-detail">
-              <div class="message-item">规格书</div>
-              <div class="colon">:</div>
-              <div class="message-body">
-                <img src="/images/all/pdf.png" alt="" @click="toAttach(list.attach)" v-if="list.attach">
-                <span v-if="!list.attach">暂无</span>
-              </div>
-            </div>
-            <div class="message-detail"></div>
+            <!--<div class="message-detail"></div>-->
             <!--<div class="form-group">-->
             <!--<div class="form-group">-->
                <!--<button type="text" v-if="!collectList" @click="collect(list.id)" class="btn btn-default btn-store">加入收藏</button>-->
                <!--<button type="text" v-if="!collectList" @click="collect(list.id)" class="btn btn-default btn-store">加入收藏</button>-->
                <!--<button class="btn btn-default btn-store" v-if="collectList" disabled="disabled">已收藏</button>-->
                <!--<button class="btn btn-default btn-store" v-if="collectList" disabled="disabled">已收藏</button>-->
@@ -112,6 +119,7 @@
         return this.$store.state.componentDetail.detail
         return this.$store.state.componentDetail.detail
       },
       },
       list () {
       list () {
+        console.log('3333', this.lists.data)
         return this.lists.data
         return this.lists.data
       },
       },
       properties () {
       properties () {
@@ -306,7 +314,7 @@
     overflow: hidden;
     overflow: hidden;
     text-overflow: ellipsis;
     text-overflow: ellipsis;
     white-space: nowrap;
     white-space: nowrap;
-    width: 93px;
+    width: 450px;
   }
   }
   .componentDetail .container .component-message .message-body >img {
   .componentDetail .container .component-message .message-body >img {
     cursor: pointer;
     cursor: pointer;

+ 2 - 1
components/store/CommodityInfo.vue

@@ -46,7 +46,7 @@
               <span class="name">包&nbsp;装</span>:<span v-text="commodity.packaging || '无包装信息'"></span>
               <span class="name">包&nbsp;装</span>:<span v-text="commodity.packaging || '无包装信息'"></span>
             </div>
             </div>
             <div class="com-info">
             <div class="com-info">
-              <span class="name">封&nbsp;装</span>:<span v-text="commodity.encapsulation || '无封装信息'"></span>
+              <span class="name">规&nbsp;格</span>:<span v-text="commodity.spec || '无规格信息'"></span>
             </div>
             </div>
             <div class="com-info">
             <div class="com-info">
               <span class="name">库&nbsp;存</span>:<span v-text="commodity.reserve || 0"></span><em style="margin-left: 3px;">PCS</em>
               <span class="name">库&nbsp;存</span>:<span v-text="commodity.reserve || 0"></span><em style="margin-left: 3px;">PCS</em>
@@ -215,6 +215,7 @@
         return this.$store.state.shop.storeInfo.store.data
         return this.$store.state.shop.storeInfo.store.data
       },
       },
       commodity () {
       commodity () {
+        console.log('commodity', this.$store.state.shop.storeInfo.commodity.data)
         let commodity = this.$store.state.shop.storeInfo.commodity.data
         let commodity = this.$store.state.shop.storeInfo.commodity.data
         this.fragment = initFragment(commodity)
         this.fragment = initFragment(commodity)
         return commodity
         return commodity

+ 2 - 1
components/store/CommodityList.vue

@@ -74,7 +74,7 @@
               </div>
               </div>
               <div v-if="!commodity.reserve && commodity.status !== 602" style="text-align: center;margin-left: 0;"><span>—</span></div>
               <div v-if="!commodity.reserve && commodity.status !== 602" style="text-align: center;margin-left: 0;"><span>—</span></div>
               <div class="from" v-if="commodity.reserve && commodity.reserve>0 || commodity.status === 602">
               <div class="from" v-if="commodity.reserve && commodity.reserve>0 || commodity.status === 602">
-                起订:<span v-if="commodity.minBuyQty" v-text="commodity.minBuyQty">300</span>
+                最小起订:<span v-if="commodity.minBuyQty" v-text="commodity.minBuyQty">300</span>
               </div>
               </div>
               <!--<div class="multiple">
               <!--<div class="multiple">
                 倍数:<span>1</span>
                 倍数:<span>1</span>
@@ -227,6 +227,7 @@ export default {
   },
   },
   computed: {
   computed: {
     commodities () {
     commodities () {
+      console.log('commodities', this.$store.state.shop.storeInfo.storeCommodity.data)
       return this.$store.state.shop.storeInfo.storeCommodity.data
       return this.$store.state.shop.storeInfo.storeCommodity.data
     },
     },
     storeInfo () {
     storeInfo () {

+ 6 - 5
components/supplier/details.vue

@@ -21,7 +21,7 @@
           <h4 v-text="detail.cmpCode">3</h4>
           <h4 v-text="detail.cmpCode">3</h4>
           <ul class="list-unstyled">
           <ul class="list-unstyled">
             <li class="item">
             <li class="item">
-              <span>类目(名称)</span>
+              <span>类目(产品名称)</span>
               <p v-if="detail.standard === 1" v-text="detail.kind ? spliceString(detail.kind, 135) : '暂无信息'">1</p>
               <p v-if="detail.standard === 1" v-text="detail.kind ? spliceString(detail.kind, 135) : '暂无信息'">1</p>
               <p v-if="detail.standard !== 1" v-text="detail.prodName ? spliceString(detail.prodName, 135) : '暂无信息'">1</p>
               <p v-if="detail.standard !== 1" v-text="detail.prodName ? spliceString(detail.prodName, 135) : '暂无信息'">1</p>
             </li>
             </li>
@@ -472,12 +472,13 @@
         li{
         li{
           margin-bottom:25px;
           margin-bottom:25px;
           span{
           span{
-            display:inline-block;
-            width:70px;
-            float:left;
-            color:#3c7cf5;
+            display: inline-block;
+            width: 100px;
+            float: left;
+            color: #3c7cf5;
             vertical-align: top;
             vertical-align: top;
             text-align: right;
             text-align: right;
+            margin-right: 15px;
           }
           }
           p{
           p{
             width:365px;
             width:365px;

+ 5 - 4
components/supplier/resource.vue

@@ -67,7 +67,7 @@
                   <p v-text="item.cmpCode ? spliceString(item.cmpCode, 95) : '暂无信息'">2</p>
                   <p v-text="item.cmpCode ? spliceString(item.cmpCode, 95) : '暂无信息'">2</p>
                 </li>
                 </li>
                 <li class="item">
                 <li class="item">
-                  <span class="fl">类目(名称)</span>
+                  <span class="fl">类目(产品名称)</span>
                   <p v-if="item.standard === 1" v-text="item.kind ? spliceString(item.kind, 95) : '暂无信息'">1</p>
                   <p v-if="item.standard === 1" v-text="item.kind ? spliceString(item.kind, 95) : '暂无信息'">1</p>
                   <p v-if="item.standard !== 1" v-text="item.prodName ? spliceString(item.prodName, 95) : '暂无信息'">1</p>
                   <p v-if="item.standard !== 1" v-text="item.prodName ? spliceString(item.prodName, 95) : '暂无信息'">1</p>
                 </li>
                 </li>
@@ -712,10 +712,11 @@
               vertical-align: top;
               vertical-align: top;
               width:33%;
               width:33%;
               span{
               span{
-                display:inline-block;
-                width:85px;
+                display: inline-block;
+                width: 96px;
                 text-align: right;
                 text-align: right;
-                color:#3c7cf5;
+                margin-right: 10px;
+                color: #3c7cf5;
               }
               }
               p{
               p{
                 display:block;
                 display:block;

+ 1 - 0
pages/product/brand/_code.vue

@@ -39,6 +39,7 @@
       }
       }
     },
     },
     fetch ({ store, params }) {
     fetch ({ store, params }) {
+      console.log('code', params)
       return Promise.all([
       return Promise.all([
         store.dispatch('loadBrandDetail', { id: params.code }),
         store.dispatch('loadBrandDetail', { id: params.code }),
         store.dispatch('product/loadSupplierInformation', { uuid: params.code, count: 5, page: 1 })
         store.dispatch('product/loadSupplierInformation', { uuid: params.code, count: 5, page: 1 })