Jelajahi Sumber

fix: improvment and small fix

joe 4 tahun lalu
induk
melakukan
3befcd2196

+ 4 - 1
app/admin/view/store/store_product/create.php

@@ -1449,7 +1449,10 @@
             },
             generate: function (type = 0) {
                 var that = this;
-                var cate_id = $('input[name="cate_id"]').val()
+                var cate_id = $('input[name="cate_id"]').val();
+                if (cate_id === undefined) {
+                    cate_id = 0;
+                }
                 this.requestPost(that.U({c:"store.StoreProduct",a:'is_format_attr',p:{id:that.id, cate_id:cate_id, type:type}}), {attrs:this.formData.items}).then(function (res) {
                     that.$set(that.formData, 'attrs', res.data.value);
                     that.$set(that, 'formHeader', res.data.header);

+ 3 - 0
app/admin/view/widget/images.php

@@ -355,6 +355,9 @@
                 var that=this;
                 layList.baseGet(that.U({a:'get_image_cate',q:{name:this.searchTitle}}),function (res) {
                     that.$set(that,'categoryList',res.data);
+                    if (ppid <= 0 && pid <= 0) {
+                        return;
+                    }
                     for(var i=0; i<that.categoryList.length; i++) {
                         if(that.categoryList[i].id == this.pid || that.categoryList[i].id == ppid) {
                             that.OpenTree(that.categoryList[i], i);