<template>
	<view>
		<defaultRate ref="defaultRateRef" title="新增支付类型" isCheck="all" :isUtmpay="true"  />
		
		<!-- 银联前置平台专属 -->
		<view class="submit" @click="submitHandle">保存新增支付类型</view>
	</view>
</template>

<script setup>

import { ref, reactive, inject, toRaw } from 'vue'
import { $payConfAdd } from '@/http/apiManager.js'	
import defaultRate from '../../components/defaultRate.vue' // 默认费率

let vdata = reactive({
	paywayFeeList: []
})

const defaultRateRef = ref()

const channelInfo = inject('channelInfo')

const submitHandle = () => {
	// 拿费率组件的值
	applyDetailInfo.paywayFeeList = defaultRateRef.value.getList(false)
	payConfAdd() 
}

const payConfAdd = () => {
	$payConfAdd(channelInfo.applyId, { paywayFeeList: toRaw(vdata.paywayFeeList) }).then((res) => {
		console.log(vdata.paywayFeeList)
		uni.showToast({title: '保存成功', icon: 'none'})
	})
}

</script>

<style scoped lang="scss">

.submit{
	display: flex;
	justify-content: center;
	margin: 30rpx auto;
	width: 380rpx;
	height: 90rpx;
	line-height: 90rpx;
	border-radius: 10rpx;
	background: #3981FF;
	font-weight: 500;
	font-size: 30rpx;
	color: #fff;
}

</style>