Procházet zdrojové kódy

修改分类类目数量

gaoxm před 7 roky
rodič
revize
00334c9dd8

+ 31 - 27
components/store/home/CommodityList.vue

@@ -54,11 +54,13 @@
               <div class="brand" v-if="commodity.brandNameEn || commodity.brandEn">
                 <a v-if="commodity.brandNameEn && commodity.branduuid" @click="goBrandDetail('/product/brand/' + commodity.branduuid, $event)" v-text="commodity.brandNameEn"></a>
                 <span v-if="commodity.brandNameEn && !commodity.branduuid" v-text="commodity.brandNameEn"></span>
-                <span v-if="commodity.brandEn">{{commodity.brandEn}}</span>
+                <span v-if="commodity.brandEn && !commodity.branduuid">{{commodity.brandEn}}</span>
               </div>
-              <div class="brand" v-if="!commodity.brandNameEn && !commodity.brandEn">—</div>
-              <a v-if="commodity.kindNameCn" @click="goBrandDetail('/product/kind/' + commodity.kindUuid, $event)" v-text="commodity.kindNameCn"></a>
-              <div class="brand" v-if="!commodity.kindNameCn">—</div>
+              <div class="brand" v-if="!commodity.brandNameEn && !commodity.brandEn && commodity.kindNameCn">—</div>
+              <a v-if="commodity.kindNameCn && commodity.kindUuid" @click="goBrandDetail('/product/kind/' + commodity.kindUuid, $event)" v-text="commodity.kindNameCn"></a>
+              <span v-if="commodity.kindNameCn && !commodity.kindUuid" v-text="commodity.kindNameCn"></span>
+              <div class="brand" v-if="!commodity.kindNameCn && (commodity.brandNameEn || commodity.brandEn)">—</div>
+              <div class="brand" v-if="!commodity.brandNameEn && !commodity.brandEn && !commodity.kindNameCn">—</div>
             </td>
             <td class="brand-code">
               <div class="code" v-if="commodity.code" v-text="commodity.code"></div>
@@ -266,26 +268,29 @@
         }
       }
     },
-//    watch: {
-//       kinds: {
-//         handler: function (val) {
-//           this.kinds.forEach((item) => {
-//             this.KindsNameChange(item)
-//           })
-//         },
-//         immediate: false
-//       }
-//  },
+    watch: {
+       kinds: {
+         handler: function (val) {
+           val.forEach((item) => {
+             this.KindsNameChange(item)
+           })
+         },
+         immediate: true
+       }
+  },
 //    mounted () {
 //      this.$nextTick(() => {
+//         this.kinds.forEach((item) => {
+//         this.KindsNameChange(item)
+//       })
 //      })
 //    },
-  mounted () {
-      this.kinds.forEach((item) => {
-        this.KindsNameChange(item)
-      })
- //    alert(JSON.stringify(this.kinds))
-    },
+//  mounted () {
+//      this.kinds.forEach((item) => {
+//        this.KindsNameChange(item)
+//      })
+// //    alert(JSON.stringify(this.kinds))
+//    },
     methods: {
       sendprove: function () {
         if (this.user.logged) {
@@ -302,13 +307,12 @@
         this.baseUtils.goLinkUser(this, this.storeInfo.enUU)
       },
       KindsNameChange: function (obj) {
-        obj.nameCn += `  (${obj.count})`
-        document.getElementsByClassName('el-tree-node__label').innerHTML = "<span style='color:#666;'>11</span>"
-        if (obj.children && obj.children.length) {
-          obj.children.forEach((item) => {
-            this.KindsNameChange(item)
-          })
-        }
+          obj.nameCn += `  (${obj.count})`
+          if (obj.children && obj.children.length) {
+            obj.children.forEach((item) => {
+              this.KindsNameChange(item)
+            })
+          }
       },
       goAttach: function (url, event) {
         event.stopPropagation()

+ 1 - 0
components/store/home/QualificationCertificate.vue

@@ -62,6 +62,7 @@
         if (this.user.logged && this.user.data.enterprise.uu) {
           if (this.storeStatus.uuid === this.storeInfo.uuid) {
             loggedStatus = true
+            this.storeInfo = this.storeStatus
           } else {
             loggedStatus = false
           }