Browse Source

优化上传图片 修改商品分类文案

zhengjinyi 5 years ago
parent
commit
6bd9c5281d

+ 6 - 2
src/views/club/editForm.vue

@@ -195,10 +195,14 @@ export default {
     },
     // 上传图标事件
     handleAvatarSuccess(response, file) {
-      this.form.businessLicenseImage = response.data
+      setTimeout(() => {
+        this.form.businessLicenseImage = response.data
+      }, 1000)
     },
     handleDoorwaySuccess(response, file) {
-      this.form.headpic = response.data
+      setTimeout(() => {
+        this.form.headpic = response.data
+      }, 1000)
     },
     // 对上传图片的大小、格式进行限制
     beforeUpload(file) {

+ 6 - 2
src/views/club/form.vue

@@ -140,10 +140,14 @@ export default {
     },
     // 上传图标事件
     handleAvatarSuccess(response, file) {
-      this.form.businessLicenseImage = response.data
+      setTimeout(() => {
+        this.form.businessLicenseImage = response.data
+      }, 1000)
     },
     handleDoorwaySuccess(response, file) {
-      this.form.headpic = response.data
+      setTimeout(() => {
+        this.form.headpic = response.data
+      }, 1000)
     },
     // 对上传图片的大小、格式进行限制
     beforeUpload(file) {

+ 1 - 1
src/views/club/operateList.vue

@@ -131,7 +131,7 @@
     </el-dialog>
     <template>
       <el-backtop style="right: 40px; bottom: 40px;">
-        <i class="el-icon-caret-top" />
+        <i class="el-icon-upload2" />
       </el-backtop>
     </template>
   </div>

+ 4 - 7
src/views/goods/category-create.vue

@@ -102,12 +102,7 @@ export default {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           saveClassify(this.temp).then(response => {
-            this.$notify({
-              title: response.code * 1 === 1 ? 'Success' : 'Error',
-              message: response.code * 1 === 1 ? '添加分类成功' : response.msg,
-              type: response.code * 1 === 1 ? 'success' : 'error',
-              duration: 2000
-            })
+            this.$message({ message: response.msg, type: 'success', center: true, duration: 2000 })
             this.backToList()
           })
         }
@@ -115,7 +110,9 @@ export default {
     },
     // 上传图标事件
     handleSuccess(response, file) {
-      this.temp.classifyImage = response.data
+      setTimeout(() => {
+        this.temp.classifyImage = response.data
+      }, 1000)
     },
     // 对上传图片的大小、格式进行限制
     beforeUpload(file) {

+ 4 - 7
src/views/goods/category-edit.vue

@@ -113,12 +113,7 @@ export default {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           saveClassify(this.temp).then(response => {
-            this.$notify({
-              title: response.code * 1 === 1 ? 'Success' : 'Error',
-              message: response.code * 1 === 1 ? '修改分类成功' : response.msg,
-              type: response.code * 1 === 1 ? 'success' : 'error',
-              duration: 2000
-            })
+            this.$message({ message: response.msg, type: 'success', center: true, duration: 2000 })
             this.backToList()
           })
         }
@@ -126,7 +121,9 @@ export default {
     },
     // 上传图标事件
     handleSuccess(response, file) {
-      this.temp.classifyImage = response.data
+      setTimeout(() => {
+        this.temp.classifyImage = response.data
+      }, 1000)
     },
     // 对上传图片的大小、格式进行限制
     beforeUpload(file) {

+ 3 - 3
src/views/goods/category.vue

@@ -5,7 +5,7 @@
       <el-button class="filter-item" type="primary" icon="el-icon-sort" @click="batchSaveSort">批量更新排序</el-button>
     </div>
     <div class="filter-title">
-      <p>商品分类的排序值是指本页面和星范商城小程序首页分类的排列顺序,数值越小排序越靠前,排序值允许重复。</p>
+      <p>商品分类的排序值是指本页面和小程序首页分类的排列顺序,数值越小排序越靠前,排序值允许重复。</p>
     </div>
     <el-table
       v-loading="listLoading"
@@ -127,8 +127,8 @@ export default {
           sorts.push(item.id + '-' + Math.abs(item.sort))
         }
       })
-      console.log(sorts)
-      saveCategorySort({ newProducSorttList: sorts.join(',') }).then(() => {
+      saveCategorySort({ newProducSorttList: sorts.join(',') }).then(response => {
+        this.$message({ message: response.msg, type: 'success', center: true })
         this.getList()
       }).catch(() => {
         this.getList()

+ 1 - 6
src/views/goods/list-commonly.vue

@@ -167,12 +167,7 @@ export default {
       this.listQuery.shopName = ''
       this.listQuery.classifyID = ''
       saveGoodsSort({ newProducSorttList: sorts.join(','), modules: this.modulesId }).then(response => {
-        this.$notify({
-          title: response.code * 1 === 1 ? 'Success' : 'Error',
-          message: response.msg,
-          type: response.code * 1 === 1 ? 'success' : 'error',
-          duration: 2000
-        })
+        this.$message({ message: response.msg, type: 'success', center: true })
         this.fetchData()
       }).catch(() => {
         this.fetchData()

+ 1 - 6
src/views/goods/list-preferential.vue

@@ -167,12 +167,7 @@ export default {
       this.listQuery.shopName = ''
       this.listQuery.classifyID = ''
       saveGoodsSort({ newProducSorttList: sorts.join(','), modules: this.modulesId }).then(response => {
-        this.$notify({
-          title: response.code * 1 === 1 ? 'Success' : 'Error',
-          message: response.msg,
-          type: response.code * 1 === 1 ? 'success' : 'error',
-          duration: 2000
-        })
+        this.$message({ message: response.msg, type: 'success', center: true })
         this.fetchData()
       }).catch(() => {
         this.fetchData()

+ 1 - 6
src/views/goods/list-preferred.vue

@@ -167,12 +167,7 @@ export default {
       this.listQuery.shopName = ''
       this.listQuery.classifyID = ''
       saveGoodsSort({ newProducSorttList: sorts.join(','), modules: this.modulesId }).then(response => {
-        this.$notify({
-          title: response.code * 1 === 1 ? 'Success' : 'Error',
-          message: response.msg,
-          type: response.code * 1 === 1 ? 'success' : 'error',
-          duration: 2000
-        })
+        this.$message({ message: response.msg, type: 'success', center: true })
         this.fetchData()
       }).catch(() => {
         this.fetchData()

+ 1 - 6
src/views/goods/list-select.vue

@@ -175,12 +175,7 @@ export default {
         itemsList.push(item.id)
       })
       saveAddList({ itemsList: JSON.stringify(itemsList), organizeID: this.$store.getters.organizeID, modules: this.moduleId }).then(response => {
-        this.$notify({
-          title: response.code * 1 === 1 ? 'Success' : 'Error',
-          message: response.code * 1 === 1 ? '添加成功' : response.msg,
-          type: response.code * 1 === 1 ? 'success' : 'error',
-          duration: 2000
-        })
+        this.$message({ message: response.msg, type: 'success', center: true })
         this.backToParentPath()
       }).catch(() => {
         this.fetchData()

+ 1 - 6
src/views/goods/list.vue

@@ -292,12 +292,7 @@ export default {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           saveGoods(this.dialog).then(response => {
-            this.$notify({
-              title: response.code * 1 === 1 ? 'Success' : 'Error',
-              message: response.code * 1 === 1 ? '编辑成功' : response.msg,
-              type: response.code * 1 === 1 ? 'success' : 'error',
-              duration: 2000
-            })
+            this.$message({ message: response.msg, type: 'success', center: true })
             this.fetchData()
             this.dialogFormVisible = false
           })

+ 1 - 6
src/views/order/components/remarks.vue

@@ -70,12 +70,7 @@ export default {
     submitRemark() {
       if (this.remark) {
         saveRemarks({ remarks: this.remark, orderID: this.orderId }).then(response => {
-          this.$notify({
-            title: response.code * 1 === 1 ? 'Success' : 'Error',
-            message: response.msg,
-            type: response.code * 1 === 1 ? 'success' : 'error',
-            duration: 2000
-          })
+          this.$message({ message: response.msg, type: 'success', center: true, duration: 2000 })
           this.dialogFormVisible = false
         })
       } else {