马宇豪
2025-02-19 102f2220365de7cd04d7cd07d8ff8ef03ca2c460
src/views/specialOperationsPay/singlePage/index.vue
@@ -102,6 +102,12 @@
      :modal-append-to-body="false"
      fullscreen
      class="myCustomDialog"
      v-loading="payLoading"
      element-loading-spinner="el-icon-loading"
      element-loading-background="rgba(255, 255, 255, 0.8)"
      element-loading-text="等待财政接口加解密返回结果,正在生成支付订单"
      element-loading-customClass="payLoading"
      @close="closePay"
    >
      <div class="topInfo">
        <el-row style="margin-bottom: 0">
@@ -164,8 +170,8 @@
<script >
import {verifyIdCard, verifySimplePhone} from "@/utils/validate";
import {nonCoalSelectH5} from "@/api/specialOperationsPay/notCoalPay";
import {findStudent} from "@/api/specialOperationsPay/coalPay";
import {nonCoalPersonPay, nonCoalSelectH5} from "@/api/specialOperationsPay/notCoalPay";
import {coalPersonPay, findStudent} from "@/api/specialOperationsPay/coalPay";
import noData from '@/assets/images/noData.png'
export default {
@@ -197,8 +203,8 @@
    }
    return {
      dataForm: {
        idCard: '320322199509262810',
        phone: '15261806176',
        idCard: '',
        phone: '',
        type: 1
      },
      rules: {
@@ -211,7 +217,8 @@
      hasInfo: true,
      detailVisible: false,
      detailInfo: {},
      noData
      noData,
      payLoading: false
    }
  },
  created() {
@@ -268,10 +275,57 @@
    },
    goPay(item){
      this.detailInfo = item
      this.detailVisible = true
      if((this.dataForm.type == 1 && this.detailInfo.payPersonType == 2) || (this.dataForm.type == 2 &&this.detailInfo.payType == 2)){
        this.$message({
          type:'warning',
          message: '团体缴费类型无法生成缴费订单'
        })
      }else{
        this.detailVisible = true
      }
    },
    payBill(){
      console.log('立即付款')
    async payBill(){
      this.payLoading = true
      let device = 1
      const userAgent = window.navigator.userAgent
      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
        device = 2
      } else {
        device = 1
      }
      if(this.dataForm.type == 1){
        const query = {
          id: this.detailInfo.nonCoalStudentId,
          payType: 1
        }
        const res = await nonCoalPersonPay(query)
        if(res.code == 200) {
          this.payLoading = false
          window.open(`http://finpt.xjcz.gov.cn/fs-public/billQuery/findByOrderId.do?orderId=${res.msg}&deviceType=${device}`)
        }else{
          this.payLoading = false
          this.$message({
            type:'warning',
            message: res.msg
          })
        }
      }else{
        const query = {
          coalPayId: this.detailInfo.coalPays.id,
          studentId: this.detailInfo.id
        }
        const res = await coalPersonPay(query)
        if(res.code == 200) {
          this.payLoading = false
          window.open(`http://finpt.xjcz.gov.cn/fs-public/billQuery/findByOrderId.do?orderId=${res.msg}&deviceType=${device}`)
        }else{
          this.payLoading = false
          this.$message({
            type:'warning',
            message: res.msg
          })
        }
      }
    },
    resetDataForm() {
      this.dataForm = {
@@ -280,6 +334,10 @@
    handleClose(){
      this.info = {}
      this.listVisible = false
    },
    closePay(){
      this.detailVisible = false
      this.payLoading = false
    }
  }
}
@@ -289,6 +347,8 @@
  .container{
    width: 100%;
    height: 100%;
    max-width: 960px;
    margin: 0 auto;
  }
  .loginTop{
@@ -355,6 +415,26 @@
</style>
<style lang="scss">
  .myCustomDialog{
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    .el-loading-mask{
      width: 60%;
      height: 20%;
      margin: 30vh auto;
      border-radius: 20px;
      padding: 10px;
      .el-loading-spinner{
        width: calc(100% - 20px);
        top: 40%;
        .el-icon-loading,.el-loading-text{
          color: #000;
        }
        .el-icon-loading{
          font-size: 24px;
        }
      }
    }
    .el-dialog .el-dialog__header{
      height: 60px;
      padding: 0;