y595705120 6 dias atrás
pai
commit
ee5ccbe24c

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

@@ -137,16 +137,23 @@
 
     </div>
 
-    <el-dialog title="申请开通课程" :visible.sync="buyCourseDialog" width="550px" top="100px" align="center">
+    <el-dialog title="申请开通课程" :visible.sync="buyCourseDialog" width="550px" top="100px" align="left">
       <template v-if="!showPay">
         <el-form label-width="100px" :inline="false" :model="buyForm" :rules="rules"
           ref="elForm">
+          <el-form-item label="账户余额" prop="balance" >
+            <p style="margin-left: 20px;font-size: 16px;">
+              <span v-if="userInfo.balance>=buyForm.fee" style="color: green;"> ¥{{userInfo.balance/100}}元</span>
+              <span v-else style="color: red;"> ¥{{userInfo.balance/100}}元</span>
+            </p>
+          </el-form-item>
 
           <el-form-item label="报考岗位" prop="courseName">
             <el-input type="text" placeholder="报考岗位" v-model="buyForm.courseName+'-'+buyForm.nd"
             style="width: 360px;" />
           </el-form-item>
 
+
           <el-form-item label="证书编号" prop="rzCode">
             <el-input v-model="buyForm.rzCode" type="text" style="width: 360px;">
               <template #suffix>
@@ -184,9 +191,10 @@
           <el-divider></el-divider>
           <h2 class="tc"> 本课程费用: <strong style="color: red;"> {{buyForm.fee/100}} 元 </strong> </h2>
 
-          <el-form-item label-width="0" style="margin-top: 30px;">
+          <el-form-item label-width="0" style="margin: 30px auto;text-align: center;">
             <el-button @click="cancelBuyCourse">取 消</el-button>
             <el-button @click="generatePayQrcode" type="primary">提交订单</el-button>
+            <el-button v-if="userInfo.balance >= buyForm.fee" @click="doAccountPay" type="success">余额付款</el-button>
           </el-form-item>
 
         </el-form>
@@ -416,12 +424,21 @@
         httpServer("weixin.isPayOk", { outTradeNo }).then((res) => {
           if (res.code == 200 && !!res.data) {
             if (this.timer) window.clearInterval(this.timer);
-            this.$message.success("支付成功");
+            this.$message.successMsg("支付成功", 2);
             this.buyCourseDialog = false;
             this.getData();
           }
         });
       },
+      doAccountPay(){
+        let param = Object.assign({}, this.buyForm);
+        httpServer("weixin.doAccountPay", {courseId}).then((res) => {
+          if (res.code != 200) return;
+          this.$message.successMsg("支付成功", 2);
+          this.buyCourseDialog = false;
+          this.getData();
+        });
+      },
       generatePayQrcode() {
         console.log('generatePayQrcode')
         let payType = this.buyForm.payType;

+ 2 - 2
src/containers/center/myOrder/index.vue

@@ -35,7 +35,7 @@
               <el-button v-if="row.refundStatus==0" @click="payRefund(row)" type="primary"  size="small" >退款</el-button>
               <el-button v-else-if="row.refundStatus==1" @click="getPayInfo(row )"  type="text" size="small">退款中</el-button>
               <el-button v-else-if="row.refundStatus==2" @click="getPayInfo(row )" type="text" size="small">退款通过</el-button>
-              <el-button v-else-if="row.refundStatus==3" @click="getPayInfo(row )" type="text" size="small">到账</el-button>
+              <el-button v-else-if="row.refundStatus==3" @click="getPayInfo(row )" type="text" style="color: green;" size="small" >到账</el-button>
               <el-button v-else type="text" size="small" @click="getPayInfo(row )" style="color: red;">拒绝</el-button>
             </template>
           </el-table-column>
@@ -62,7 +62,7 @@
                 <span> {{form.title}} </span>
           		</el-form-item>
               <el-form-item label="退款金额" prop="type">
-                <span> ¥{{form.payFee/10}} 元 </span>
+                <span> ¥{{form.payFee/100}} 元 </span>
               </el-form-item>
           		<el-form-item label="退款原因" prop="footer">
           			<el-input v-model="form.reason" type="textarea" style="width: 300px;" />

+ 3 - 0
src/containers/center/setting/index.vue

@@ -38,6 +38,9 @@
               </li>
               <li class="ng-binding">
                 <span class="l-t">证件号:</span>{{userInfo.cardId||'未知'}}</li>
+
+              <li class="ng-binding">
+                <span class="l-t"> 账户余额:</span>¥{{userInfo.balance/100}}元</li>
               <li>
                 <span class="l-t"><i></i>性别:</span>