Просмотр исходного кода

Merge branch 'master' of http://git.izouma.com/xiongzhu/9th

xuqiang 4 лет назад
Родитель
Сommit
e6ce8a013e
1 измененных файлов с 27 добавлено и 12 удалено
  1. 27 12
      src/main/pc-space/src/views/AssetDetail.vue

+ 27 - 12
src/main/pc-space/src/views/AssetDetail.vue

@@ -86,7 +86,7 @@
                         <div class="btn-list">
                         <div class="btn-list">
                             <div class="btn-item" @click="changeShow">
                             <div class="btn-item" @click="changeShow">
                                 <i class="font_family icon-icon-gongkaizhanshi"></i>
                                 <i class="font_family icon-icon-gongkaizhanshi"></i>
-                                <span>公开展示</span>
+                                <span>{{ info.publicShow ? '取消展示' : '公开展示' }}</span>
                             </div>
                             </div>
                             <div class="btn-item">
                             <div class="btn-item">
                                 <i class="font_family icon-icon-zengsong"></i>
                                 <i class="font_family icon-icon-zengsong"></i>
@@ -286,18 +286,33 @@ export default {
                 });
                 });
         },
         },
         changeShow() {
         changeShow() {
-            this.$confirm('藏品将公开展示,无报价', '公开展示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                center: true
-            })
-                .then(() => {
-                    return this.$http.post(`/asset/publicShow?id=${this.info.id}`);
+            if (!this.info.publicShow) {
+                this.$confirm('藏品将公开展示,无报价', '公开展示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    center: true
                 })
                 })
-                .then(res => {
-                    this.getDetail();
-                    this.$message.success('展示成功');
-                });
+                    .then(() => {
+                        return this.$http.post(`/asset/publicShow?id=${this.info.id}`);
+                    })
+                    .then(res => {
+                        this.getDetail();
+                        this.$message.success('展示成功');
+                    });
+            } else {
+                this.$confirm('藏品将取消展示', '取消展示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    center: true
+                })
+                    .then(() => {
+                        return this.$http.post(`/asset/cancelPublic?id=${this.info.id}`);
+                    })
+                    .then(res => {
+                        this.getDetail();
+                        this.$message.success('取消展示');
+                    });
+            }
         }
         }
     }
     }
 };
 };