<!--
 * @Descripttion:
 * @version:
 * @Author: kBank
 * @Date: 2023-04-06 10:25:19
-->
<template>
  <div class="page">
    <div class="topbox">
      <div class="levelList_i"
           :class="tabActive == item.id ? 'act' : ''"
           v-for="(item, index) in topList"
           :key="index"
           @click.prevent="handleLink(item.id)">
        {{ item.name }}
      </div>
    </div>
    <div class="main">
      <div class="contain">
        <div class="tit">{{'支付配置'}}</div>
        <div class="xian"></div>
        <div class="pod">

          <el-checkbox v-model="formData.pay81"
                       border>新汇付PC微信扫码支付</el-checkbox>
          <el-checkbox v-model="formData.pay82"
                       border>新汇付PC支付宝扫码支付</el-checkbox>
          <el-checkbox v-model="formData.pay83"
                       border>新汇付H5微信支付</el-checkbox>
          <el-checkbox v-model="formData.pay84"
                       border>新汇付H5支付宝支付</el-checkbox>

        </div>
      </div>
      <div class="footer">
        <el-button size="small"
                   class="thebtn2"> {{ '取消' }}</el-button>
        <el-button size="small"
                   @click="submit()"
                   class="thebtn1" style="background-color: #c8161d"> {{ '确认' }}</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import * as api from '@/api/financialCase.js'

export default {
  name: 'jcsz',
  data() {
    return {
      tabActive: 0,
      formData: {
        pay81: false,
        pay82: false,
        pay83: false,
        pay84: false
      },
      topList: [
        {
          name: this.$t('MN_F_T_112'),
          id: 0,
        },
      ],
      checkboxGroup: [],
    }
  },
  mounted() {
    this.getConfig()
  },
  methods: {
    getConfig() {
      this.checkboxGroup = []
      api.onlineConfig().then((res) => {
        this.formData = {
          pay81: res.data.pay81,
          pay82: res.data.pay82,
          pay83: res.data.pay83,
          pay84: res.data.pay84
        }
      })
    },

    // 切换tab
    handleLink(id) {
      this.tabActive = id
    },
    submit() {
      api.onlineSaveConfig(this.formData).then((res) => {
        if (res.code == 200) {
          this.$message({
            message: res.msg,
            type: 'success',
          })
        }
      })
    },
  },
}
</script>
<style scoped lang="scss">
::v-deep .el-select {
  width: 100%;
}
.uploadIcon ::v-deep .el-upload--picture-card {
  display: none !important; /* 上传按钮隐藏 */
}
.el-col-20 {
  width: 20%;
}
.el-col-60 {
  width: 60%;
}
.el-col-40 {
  width: 40%;
}
.page {
  padding-top: 20px;
  background: #f8f8f8;
}
.topbox {
  align-items: center;
  padding: 0px 0 15px 0;
  display: flex;
  //   background: skyblue;
  .levelList_i {
    margin-left: 20px;
    position: relative;
    cursor: pointer;
    padding: 0 5px;
    width: 88px;
    height: 34px;
    border-radius: 17px;
    border: 1px solid #cccccc;
    font-size: 14px;
    font-family: MicrosoftYaHei;
    text-align: center;
    line-height: 34px;
  }
  .act {
    color: #ffffff;
    background: #c8161d;
  }
  .act1 {
    border-bottom: 3px solid #1890ff !important;
  }
  .cha {
    font-size: 16px;
    color: #606266;
    position: absolute;
    top: 10px;
  }
  .li {
    width: 40px;
    margin: 0 auto;
    border-bottom: 3px solid transparent;
  }
}
.main {
  display: flex;
  flex-direction: column;
}
.contain {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
  margin: 10px 20px 0 20px;
  flex: 1;
  padding-top: 15px;
}
.tit {
  font-size: 14px;
  font-family: PingFang SC-Semibold, PingFang SC;
  font-weight: 600;
  color: #333333;
  border-left: 5px solid #c8161d;
  padding-left: 20px;
}
.xian {
  margin-top: 10px;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}
.pod {
  padding: 20px;
}
.footer {
  height: 68px;
  background: #ffffff;
  box-shadow: 0px -3px 20px 0px rgba(204, 204, 204, 0.5);
  margin: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.thebtn1 {
  background: #3181e5;
  color: #ffffff;
  padding: 9px 45px;
  margin-left: 20px;
  border-radius: 5px;
  height: 38px;
}
.thebtn2 {
  height: 38px;
  background: #cccccc;
  color: #ffffff;
  padding: 9px 45px;
  border-radius: 5px;
}
.neibu {
  margin-right: 10px;
  color: #666666;
  font-style: normal;
}
.elTag {
  margin-right: 10px;
}
.check {
  display: flex;
  flex-wrap: wrap;
  text-align: center;
  // justify-content: center;
  .check_i {
    width: 50%;
    text-align: left;
    margin-right: 0 !important;
  }
}
.jy {
  font-size: 10px;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: #999999;
}
</style>
