channelSelectDialog.vue 2.24 KB
<!-- 分账测试渠道 -->
<template>
  <d2-dialog title="选择分账测试渠道" :is-visible="verificationCodeVisible" width="750px" @closeDialog="handleClose"
    @confirmDialog="handleConfirm">
    <!-- <div class="box" v-for="(item, index) in accountValidMerchants" :key="index"> -->
    <el-radio-group v-model="paymentChannelId">
      <el-radio :label="item.paymentChannelId" class="verificationCode" v-for="(item, index) in divisionRuleTests"
        :key="index">{{
          item.paymentChannelName }}</el-radio>
    </el-radio-group>
    <!-- </div> -->
  </d2-dialog>
</template>

<script>
// import { sendSms, getAdminInfo } from '@api/merchant'
import { mapActions } from 'vuex'
export default {
  name: 'ChannelSelectDialog',
  props: {
    visible: {
      // 弹窗是否展示
      type: Boolean,
      default: false
    },
    accountValidMerchants: {
      type: Array,
      default: () => []
    },
    divisionRuleTests: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    verificationCodeVisible: {
      // return this.
      get() {
        return this.visible
      },
      set(val) {
        this.$emit('update:visible', false)
      }
    },
    paymentChannelObj() {
      return this.divisionRuleTests.find(item => item.paymentChannelId === this.paymentChannelId)
    }
  },
  data() {
    return {
      paymentChannelId: ''
    }
  },
  methods: {
    ...mapActions({
      close: 'd2admin/page/close'
    }),
    handleClose() {
      // this.$emit('dialogClose')
      // this.$update
      this.verificationCodeVisible = false
    },
    // handleApply() {

    //   },
    // 选择并确认
    handleConfirm() {
      if (!this.paymentChannelId) {
        return this.$message.error('请选择渠道');
      }
      this.$emit('handleConfirm', this.paymentChannelObj)
      this.handleClose()
      // this.$router.push({ name: 'accountList_new' })
      // this.close({ tagName: '/merchantDetail' })
    }
  }
}
</script>

<style scoped lang="scss">
.verificationCode {
  &+.verificationCode {
    margin-top: 20px;
  }

  width: 100%;
}

.container {
  padding: 16px 44px;
  color: #333333;
  background: #f6f8fa;
}

.channel {
  color: #333333;
  font-size: 16px;
}

.info {
  color: #666666;
  font-size: 14px;
}
</style>