Browse Source

Merge branch 'dev-ma' into dev

ccf 4 years ago
parent
commit
bb2943fa30

+ 1 - 1
pages/main/index/dynamic.vue

@@ -25,7 +25,7 @@
                 <div>名称:{{scope.row.type_text}}</div>
             </template>
         </el-table-column> -->
-        <el-table-column prop="name" label="圈子" width="190">
+        <el-table-column prop="type_text" label="圈子" width="190">
         </el-table-column>
         <el-table-column label="发布人" width="200">
             <template slot-scope="scope">

+ 2 - 2
pages/main/index/dynamic_comment.vue

@@ -22,7 +22,7 @@
         <el-table-column prop="type_text" label="动态id+名称" width="190">
             <template slot-scope="scope">
                 <div>动态id:{{scope.row.dynamicId}}</div>
-                <div>名称:{{scope.row.content}}</div>
+                <!-- <div>名称:{{scope.row.content}}</div> -->
             </template>
         </el-table-column>
         <el-table-column label="评论用户" width="200">
@@ -47,7 +47,7 @@
                     <el-button type="warning" size="mini" @click="callDynamicReject(scope.row.comId)">拒绝</el-button>
                 </template>
                 <template v-if="scope.row.status == 2">
-                    <el-button type="primary" size="mini" @click="setDynamicRecommend(scope.row.comId)">神评</el-button>
+                    <!-- <el-button type="primary" size="mini" @click="setDynamicRecommend(scope.row.comId)">神评</el-button> -->
                     <el-button type="warning" size="mini" @click="callDynamicReject(scope.row.comId,scope.row)">拒绝</el-button>
                 </template>
                 <template v-if="scope.row.status == 3">

+ 21 - 8
pages/main/index/dynamic_type.vue

@@ -123,14 +123,15 @@
           </el-input>
         </el-form-item>
         <el-form-item label="圈子icon" prop="icon" required>
+          <div>仅可上传一张圈子icon图片</div>
           <el-upload
             :limit="1"
             :file-list="iconfileList"
             :action="iconAction"
-            :before-upload="iconBeforeUpload"
             :on-success="afterIconUploadSuccess"
             :on-error="afterIconUploadFail"
             :on-exceed="fileLimite"
+            :on-remove="iconDel"
             list-type="picture-card"
           >
             <i class="el-icon-plus"></i>
@@ -162,6 +163,7 @@
           </el-input>
         </el-form-item>
         <el-form-item label="分享图片" prop="share_icon" required>
+          <div>仅可上传一张圈子分享图片</div>
           <el-upload
             :limit="1"
             ref="share_icon"
@@ -171,6 +173,7 @@
             :on-success="afterShareImgUploadSuccess"
             :on-error="afterIconUploadFail"
             :on-exceed="fileLimite"
+            :on-remove="shareImgDel"
             list-type="picture-card"
           >
             <i class="el-icon-plus"></i>
@@ -330,12 +333,12 @@ export default {
       this.$refs["modalForm"].validate(valid => {
         if (!valid) return;
 
-        if(this.modalFormData.typeId){
-          this.editDynamic()
-        }else{
+        if (this.modalFormData.typeId) {
+          this.editDynamic();
+        } else {
           this.createdDynamic();
         }
-        
+
         this.close();
       });
     },
@@ -463,7 +466,7 @@ export default {
           share_url,
           order
         } = this.modalFormData;
-        let res = await this.$post("/uapi/v1/m/dynamic/edit_user_dynamic_type", {
+        let res = await this.$post("/uapi/v1/m/dynamic/add_user_dynamic_type", {
           typeId,
           name,
           desc,
@@ -492,7 +495,7 @@ export default {
         name: file.name,
         url: res.filename
       };
-      this.share_iconfileList.push(info);
+      this.share_iconfileList = [info];
       this.modalFormData.share_icon = res.filename;
     },
     // icon 上传成功
@@ -501,9 +504,19 @@ export default {
         name: file.name,
         url: res.filename
       };
-      this.iconfileList.push(info);
+      this.iconfileList = [info];
       this.modalFormData.icon = res.filename;
     },
+
+    shareImgDel() {
+      this.share_iconfileList = [];
+      this.modalFormData.share_icon = "";
+    },
+
+    iconDel() {
+      this.iconfileList = [];
+      this.modalFormData.icon = "";
+    },
     // icon 上传失败
     afterIconUploadFail(err, file, fileList) {
       // console.log(file, fileList);