xuqiang há 4 anos atrás
pai
commit
bc5280fff2
1 ficheiros alterados com 8 adições e 4 exclusões
  1. 8 4
      src/pages/store/productEdit.vue

+ 8 - 4
src/pages/store/productEdit.vue

@@ -467,6 +467,14 @@ export default {
                 });
                 return;
             }
+            if (this.forms.image.length <= 0) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请上传图片'
+                });
+                return;
+            }
+            console.log(111);
             let data = { name: this.forms.name, amount: this.forms.amount };
             let image = this.forms.image[0].url;
             data.image = image;
@@ -618,10 +626,6 @@ export default {
             this.$http
                 .uploadFile(file.path)
                 .then(res => {
-                    if (this.images.length > 0) {
-                        this.toast('最多上传一张图片');
-                        return;
-                    }
                     this.imgBox = false;
                     this.hideLoading();
                     this.images = [