Sfoglia il codice sorgente

多次购买异常

y595705120 2 anni fa
parent
commit
6f2094bf82

+ 1 - 0
src/containers/center/components/pay/IBuyCourse.vue

@@ -174,6 +174,7 @@
               this.buyForm.temp.courseName = this.buyForm.courseName;
               this.buyForm.temp.rzCode = this.buyForm.rzCode
               this.$emit('finish');
+              this.$refs["elForm"].resetFields();
             }
           });
         })

+ 10 - 3
src/containers/center/market/index.vue

@@ -79,7 +79,7 @@
     </el-dialog>
 
 
-    <el-dialog title="申请开通课程"  :visible.sync="buyCourseDialog" :append-to-body="true"
+    <el-dialog title="申请开通课程"  :visible.sync="buyCourseDialog"
     width="800px" top="20px" align="center">
       <el-form label-width="80px" label-position="right" :inline="true" :model="buyForm" status-icon :rules="rules" ref="elForm">
         <el-row align="left">
@@ -144,7 +144,7 @@
 
          <el-row class="tc fc">
           <el-form-item >
-            <el-button @click="buyCourseDialog=false">取 消</el-button>
+            <el-button @click="cancelBuyCourse">取 消</el-button>
             <el-button @click="buyCourse" type="primary">确 定</el-button>
           </el-form-item>
         </el-row>
@@ -260,6 +260,7 @@
           email:'',
           company:'',
           buyImg:'',
+          name:'',
           courseName: ''
         },
         promise,
@@ -382,6 +383,10 @@
           }
         });
       },
+      cancelBuyCourse(){
+        this.$refs["elForm"].resetFields();
+        this.buyCourseDialog=false
+      },
       buyCourse() {
         this.$refs["elForm"].validate((valid) => {
           if (!valid) return;
@@ -396,6 +401,7 @@
               this.$message.successMsg("申请购买成功", 1);
               this.buyForm.temp.marks = this.buyForm.marks
               Object.assign( this.buyForm.temp, param);
+              this.$refs["elForm"].resetFields();
               this.buyForm.temp.is_pay = 0
               this.buyCourseDialog = false
             }
@@ -410,9 +416,10 @@
       },
       goPay(index) {
         let item = this.list[index];
-        this.buyForm = Object.assign({}, item)
+        this.buyForm = Object.assign(this.buyForm, item)
         this.buyForm.company = this.userInfo.company;
         this.buyForm.temp = item;
+        this.buyForm.courseName = item.name;
         let isEdu = this.type == '施工现场专业人员';
 
         // 绕开检查

+ 2 - 1
src/containers/center/setting/index.vue

@@ -350,6 +350,7 @@
               this.userInfo.phone = phone;
               this.$message.success("修改手机成功");
               this.saveBaseInfo(this.userInfo);
+              this.$refs["elFormPhone"].resetFields()
             }
           })
         })
@@ -382,7 +383,6 @@
       },
       doSavePassword(){
         let {oldPass, newPass}  = this.passForm;
-        console.log( {oldPass, newPass})
         this.$refs["elForm"].validate((valid) => {
           console.log(" valid")
           if (!valid) return;
@@ -394,6 +394,7 @@
             if( res.code == 200){
               this.passForm = {oldPass:'', newPass:'', rePass:''};
               this.$message.success("密码修改成功")
+              this.$refs["elForm"].resetField();
             }
           })
         })