<template>
	
	<!-- 支付宝开通参数，微信开通参数暂不需要 -->
	<!-- 	<view class="business-title">
			<text>支付宝开通参数</text>
			<view class="btn" @click="addZfb">添加支付场景</view>
		</view>
		<view class="business-content zfb" v-for="(item, index) in openService.aliConfList" :key="index">
			<view class="business-title">
				<text>支付场景{{ index + 1 }}</text>
				<view class="btn" @click="delZfb(index)">删除</view>
			</view>
			<JeePayForm text="支付场景" :start='false'>
				<jeeDataPicker :code="openService.aliConfList[index].pay_scene" :localdata="zfbArray" paramType="oneLevel" @change="publicSelect($event, 'pay_scene', 'aliConfList', index)"/>
			</JeePayForm>
			
			<JeePayForm text="手续费率" :start='false' v-model:value="openService.aliConfList[index].fee_rate" />
			
			<JeePayForm text="商户经营类目" :start='false'>
				<jeeDataPicker :code="openService.aliConfList[index].mcc" :localdata="zfbMccArray" paramType="oneLevel" @change="publicSelect($event, 'mcc', 'aliConfList', index)"/>
			</JeePayForm>
			
			<JeePayForm text="子渠道号" :start='false' v-model:value="openService.aliConfList[index].pay_channel_id" />
			
			<JeePayForm text="间联商户等级" :start='false'>
				<jeeDataPicker :code="openService.aliConfList[index].indirect_level" :localdata="zfbLevelArray" paramType="oneLevel" @change="publicSelect($event, 'indirect_level', 'aliConfList', index)"/>
			</JeePayForm>
		</view>
		
		
		<view class="business-title">
			<text>微信开通参数</text>
			<view class="btn" @click="addWx">添加支付场景</view>
		</view>
		<view class="business-content " v-for="(item, index) in openService.wxConfList" :key="index">
			<view class="business-title">
				<text>支付场景{{ index + 1 }}</text>
				<view class="btn" @click="delWx(index)">删除</view>
			</view>
			
			<JeePayForm text="支付场景" :start='false'>
				<jeeDataPicker :code="openService.wxConfList[index].pay_scene" :localdata="wxArray" paramType="oneLevel" @change="publicSelect($event, 'pay_scene', 'wxConfList', index)"/>
			</JeePayForm>
			
			<JeePayForm text="手续费率" :start='false' v-model:value="openService.wxConfList[index].fee_rate" />
			
			<JeePayForm text="费率规则" :start='false'>
				<jeeDataPicker :code="openService.wxConfList[index].fee_rule_id" :localdata="wxRateList[index]" paramType="oneLevel" @change="publicSelect($event, 'fee_rule_id', 'wxConfList', index)"/>
			</JeePayForm>
			
			<JeePayForm text="商户经营类目" :start='false'>
				<jeeDataPicker :code="openService.wxConfList[index].mcc" :localdata="wxMcc" paramType="oneLevel" @change="publicSelect($event, 'mcc', 'wxConfList', index)"/>
			</JeePayForm>
			
		</view>
		 -->
	
</template>

<script>
	
	// // 新增支付宝支付场景
	// const addZfb = () => openService.aliConfList.push({
	// 	pay_scene: '',
	// 	fee_rate: '',
	// 	mcc: '',
	// 	pay_channel_id: '',
	// 	indirect_level: ''
	// })
	
	// // 删除支付宝支付场景
	// const delZfb = index => openService.aliConfList.splice(index, 1)
	
	// // 微信费率规则 大数组 集合, 内容不确定根据选择的支付场景来
	// const wxRateList = reactive([])
	
	// // 新增微信支付场景
	// const addWx = () => {
	// 	openService.wxConfList.push({
	// 		pay_scene: '',
	// 		fee_rate: '',
	// 		fee_rule_id: '',
	// 		mcc: '',
	// 	})
	// 	wxRateList.push([])
	// }
	
	// // 删除微信支付场景
	// const delWx = index => {
	// 	openService.wxConfList.splice(index, 1)
	// 	wxRateList.splice(index, 1)
	// }
	
	
	// 开通业务通用选择函数
	/* const publicSelect = (e, key, list, index) => {
		openService[list][index][key] = e.detail.value
		// 微信费率规则,根据支付场景进行切换
		if ((key == 'pay_scene') && (list == 'wxConfList')) {
			wxRateList[index] = wxRateArray(e.detail.value)
			console.log(e.detail.value, wxRateArray(e.detail.value))
		}
	} */
	
	// // 支付宝支付场景种类
	// const zfbArray = [
	//   { value: "1", text: "线下扫码" },
	// ];
	
	// // 支付宝mcc种类
	// const zfbMccArray = [
	//   { value: "2015050700000000", text: "美食" },
	//   { value: "2015091000052157", text: "超市便利店" },
	//   { value: "2015062600004525", text: "休闲娱乐" },
	//   { value: "2015062600002758", text: "购物" },
	//   { value: "2016062900190124", text: "爱车" },
	//   { value: "2015063000020189", text: "生活服务" },
	//   { value: "2016042200000148", text: "教育培训" },
	//   { value: "2016062900190296", text: "医疗健康" },
	//   { value: "2015080600000001", text: "航旅" },
	//   { value: "2016062900190337", text: "专业销售/批发" },
	//   { value: "2016062900190371", text: "政府/社会组织" },
	// ];
	
	// // 支付宝连商户等级种类
	// const zfbLevelArray = [
	//   { value: "INDIRECT_LEVEL_M1", text: "M1" },
	//   { value: "INDIRECT_LEVEL_M2", text: "M2" },
	//   { value: "INDIRECT_LEVEL_M3", text: "M3" },
	//   { value: "INDIRECT_LEVEL_M4", text: "M4" },
	// ];
	
	// // 微信支付场景
	// const wxArray = [
	//   { value: "1", text: "线下反扫" },
	//   { value: "2", text: "线下公众号" },
	//   { value: "3", text: "线下小程序" },
	//   { value: "4", text: "线上公众号" },
	//   { value: "5", text: "线上小程序" },
	//   { value: "6", text: "缴费行业" },
	//   { value: "7", text: "校园餐饮" },
	//   { value: "8", text: "教育K12" },
	//   { value: "9", text: "非在线教培" },
	//   { value: "10", text: "非盈利费率" },
	//   { value: "11", text: "保险费率" },
	// ];
	
	// 文字回显函数
	// let arrFindBack = (arr, e) => arr.find((item) => item.value == e.detail.value[0].value).text
	
	/* // 微信费率规则（函数）
	const wxRateArray = val => {
		val = Number(val)
		let arr = null
		if ([4, 5].includes(val)) {
			arr = [
				{ value: "756", text: "企业" },
				{ value: "761", text: "个体户" },
			]
		} else if ([1, 2, 3].includes(val)) {
			arr = [
				{ value: "758", text: "企业" },
				{ value: "762", text: "个体户" },
				{ value: "763", text: "政府事业单位" },
				{ value: "766", text: "其他组织" },
				{ value: "770", text: "小微商户" },
			]
		} else if ([6].includes(val)) {
			arr = [
				{ value: "760", text: "企业" },
				{ value: "764", text: "政府事业单位" },
				{ value: "768", text: "其他组织" },
			]
		} else if ([7].includes(val)) {
			arr = [
				{ value: "758", text: "企业" },
				{ value: "762", text: "个体户" },
				{ value: "766", text: "其他组织" },
				{ value: "770", text: "小微商户" },
			]
		} else if ([8].includes(val)) {
			arr = [
				{ value: "759", text: "企业" },
				{ value: "767", text: "其他组织" },
			]
		} else if ([9].includes(val)) {
			arr = [
				{ value: "756", text: "企业" },
			]
		}
		return arr
	} */
	
</script>

<style>
</style>