wq 5 jaren geleden
bovenliggende
commit
84450a4ca5
2 gewijzigde bestanden met toevoegingen van 26 en 29 verwijderingen
  1. 11 4
      src/layout/businessneed/claimForm.vue
  2. 15 25
      src/views/businessneed/claimDetail.vue

+ 11 - 4
src/layout/businessneed/claimForm.vue

@@ -24,9 +24,12 @@
                     <el-form-item label="辅助资料(点击查看):" >
                         <el-link :href="ruleForm[0].cdata" :underline="false">{{ruleForm[0].cdata}}</el-link>
                     </el-form-item>
-                <el-form-item>
-                    <el-button  type="primary" size="small" @click="fallow('ruleForm[0]')">关注</el-button>
-                </el-form-item>
+                    <el-form-item v-if=' saw=="1" '>
+                        <el-button  type="primary" size="small" @click="fallow('ruleForm[0]')">关注</el-button>
+                    </el-form-item>
+                    <el-form-item v-else>
+                        <el-button  type="info" size="small">已关注</el-button>
+                    </el-form-item>
             </el-form>
                 <!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
                 <el-form :model="ruleForm" :rules="rules"  v-else  ref="ruleForm" label-width="200px" class="demo-ruleForm">
@@ -60,9 +63,12 @@
                      <el-form-item label="定向产品融资期限(月):" >
                          <span>{{ruleForm[0].jgpronew.claims_min_term}}~{{ruleForm[0].jgpronew.claims_max_term}}</span>
                      </el-form-item>
-                            <el-form-item>
+                    <el-form-item v-if="saw==1 ">
                         <el-button  type="primary" size="small" @click="fallow('ruleForm[0]')">关注</el-button>
                     </el-form-item>
+                    <el-form-item v-else>
+                        <el-button  type="info" size="small">已关注</el-button>
+                    </el-form-item>
                 </el-form>
             </el-col>
         </el-row>
@@ -75,6 +81,7 @@
     props: {
       ruleForm: null,
       charList: null,
+      saw:null,
     },
     components: {},
     data: () => ({

+ 15 - 25
src/views/businessneed/claimDetail.vue

@@ -11,7 +11,7 @@
                     </el-col>
                     <el-col :span="24" class="info">
                         <!--<claimForm :ruleForm="ruleForm"  @submitForm="submitForm" @resetForm="resetForm"></claimForm>-->
-                        <claimForm :ruleForm="claimForm" @fallow = "fallow"></claimForm>
+                        <claimForm :ruleForm="claimForm" :saw="saw" @fallow = "fallow"></claimForm>
                     </el-col>
                 </el-col>
             </el-col>
@@ -40,9 +40,11 @@
       charList: {
         name: '10',
       },
+      saw:'1'                              //1是显示 0是显示已关注
     }),
     created() {
       this.searchInfo();
+      this.safollow();
     },
     computed: {
       ...mapState(['user']),
@@ -58,30 +60,17 @@
           this.$set(this, `claimForm`, res.data);
         }
       },
-      // 提交
-      // async submitForm({ data }) {
-      //   let res;
-      //   if (this.id) {
-      //     res = await this.update(data);
-      //     if (res.errcode === 0) {
-      //       this.$message({
-      //         message: '信息修改成功',
-      //         type: 'success',
-      //       });
-      //     }
-      //   } else {
-      //     res = await this.create(data);
-      //     if (res.errcode === 0) {
-      //       this.$message({
-      //         message: '信息创建成功',
-      //         type: 'success',
-      //       });
-      //     }
-      //   }
-      //   if (this.$checkRes(res)) this.resetForm();
-      //
-      //   console.log(res.data);
-      // },
+      async safollow() {
+        if (this.id) {
+          var userid = this.user.userid;
+          const ress = await this.beforFollow({ finceId: this.id, userid: userid });
+          if (ress.data.finstatus == 'SUCCESS') {
+            this.$set(this, `saw`, '0');
+          }else{
+            this.$set(this, `saw`, '1');
+          }
+        }
+      },
       // 关注
       async fallow({ data }) {
         var finceId=data._id;
@@ -106,6 +95,7 @@
            });
          }
        }
+       this.goBack();
       },
       // 返回
       goBack() {