{template 'common/header'}
<div class="we7-page-title">
	支付参数设置
</div>
{if $do == 'display'}
<ul class="we7-page-tab">
	<li {if $action == 'payment'} class="active"{/if}>
	<a href="{php echo url('profile/payment/display')}">支付配置</a>
	</li>
	<li {if $action == 'refund'} class="active"{/if}>
	<a href="{php echo url('profile/refund/display')}">退款配置</a>
	</li>
</ul>
<div class="js-profile-payment" ng-controller="paymentCtrl" ng-cloak>
	<table class="table we7-table table-hover table-form">
		<col width="140px " />
		<col width="400px"/>
		<col />
		<col width="140px" />
		<tr>
			<th colspan="2" >支付参数</th>
			<th colspan="1" >参数配置状态</th>
			<th colspan="1" >支持状态</th>
			<th colspan="1" >操作</th>
		</tr>
		<tr>
			<td colspan="2">
				货到支付
			</td>
			<td>无需配置</td>
			<td>
				{{  paysetting.delivery.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="{php echo url('profile/payment/switch', array('type' => 'delivery'))}">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				余额支付
			</td>
			<td>无需配置</td>
			<td>
				{{  paysetting.credit.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="{php echo url('profile/payment/switch', array('type' => 'credit'))}">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="1">
				混合支付
			</td>
			<td>
				<span class="related-info">
					余额不足时，可用剩余余额付部分，用其它支付付剩余部分
				</span>
			</td>
			<td>无需配置</td>
			<td>
				{{  paysetting.mix.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="{php echo url('profile/payment/switch', array('type' => 'mix'))}">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				支付宝支付
			</td>
			<td>
				<div class="related-info">
					开启支付宝支付
				</div>
			</td>
			<td>
				{{  paysetting.alipay.has_config === true ? '已配置' : '未配置'  }}
			</td>
			<td>
				{{  paysetting.alipay.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="javascript:;" data-toggle="modal" data-target="#zhifubao">
						{{  paysetting.alipay.has_config === true ? '修改配置' : '去配置'  }}
					</a>
					<a href="{php echo url('profile/payment/switch', array('type' => 'alipay'))}" ng-if="paysetting.alipay.has_config === true">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				微信支付
			</td>
			<td>
				<div class="related-info">
					<div>接口类型:新版(2014年9月之后申请的)</div>
					<div>支付账号:{$_W['uniaccount']['name']}</div>
				</div>
			</td>
			<td >
				{{  paysetting.wechat.has_config  === true  ? '已配置' : '未配置'  }}
			</td>
			<td>
				{{  paysetting.wechat.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="javascript:;" ng-click="check_wechat()">
						{{  paysetting.wechat.has_config === true ? '修改配置' : '去配置'  }}
					</a>
					<a href="{php echo url('profile/payment/switch', array('type' => 'wechat'))}" ng-if="paysetting.wechat.has_config === true">支付支持</a>
				</div>
			</td>
		</tr>
		
		<tr>
			<td>
				一码支付
			</td>
			<td>
				<div class="related-info">
				</div>
			</td>
			<td >
				{{  paysetting.jueqiymf.has_config === true ? '已配置' : '未配置'  }}
			</td>
			<td>
				{{  paysetting.jueqiymf.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="javascript:;" data-toggle="modal" data-target="#jueqiymf">
						{{  paysetting.jueqiymf.has_config === true ? '修改配置' : '去配置'  }}
					</a>
					<a href="{php echo url('profile/payment/switch', array('type' => 'jueqiymf'))}" ng-if="paysetting.jueqiymf.has_config === true">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				银联支付
			</td>
			<td>
				<div class="related-info">
				</div>
			</td>
			<td >
				{{  paysetting.unionpay.has_config === true ? '已配置' : '未配置'  }}
			</td>
			<td>
				{{  paysetting.unionpay.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="javascript:;" data-toggle="modal" data-target="#yinlian">
						{{  paysetting.unionpay.has_config === true ? '修改配置' : '去配置'  }}
					</a>
					<a href="{php echo url('profile/payment/switch', array('type' => 'unionpay'))}" ng-if="paysetting.unionpay.has_config === true">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td >
				百度钱包支付
			</td>
			<td>
				<div class="related-info"></div>
			</td>
			<td >
				{{  paysetting.baifubao.has_config === true ? '已配置' : '未配置'  }}
			</td>
			<td>
				{{  paysetting.baifubao.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="javascript:;" data-toggle="modal" data-target="#baidu">
						{{  paysetting.baifubao.has_config === true ? '修改配置' : '去配置'  }}
					</a>
					<a href="{php echo url('profile/payment/switch', array('type' => 'baifubao'))}" ng-if="paysetting.baifubao.has_config === true">支付支持</a>
				</div>
			</td>
		</tr>
		<tr>
			<td >
				汇款支付
			</td>
			<td>
				<div class="related-info"></div>
			</td>
			<td>
				{{  paysetting.line.has_config === true ? '已配置' : '未配置'  }}
			</td>
			<td>
				{{  paysetting.line.support_set === true ? '未设置' : '已设置'  }}
			</td>
			<td class="text-center">
				<div class="link-group">
					<a href="javascript:;" data-toggle="modal" data-target="#huikuan">
						{{  paysetting.line.has_config === true ? '修改配置' : '去配置'  }}
					</a>
					<a href="{php echo url('profile/payment/switch', array('type' => 'line'))}" ng-if="paysetting.line.has_config === true">支付支持</a>
				</div>
			</td>
		</tr>
	</table>

	<!--支付宝修改-->
	<div class="modal fade" id="zhifubao" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="we7-modal-dialog modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<div class="modal-title">支付宝支付</div>
				</div>
				<div class="modal-body">
					<div class="we7-form">
						<div class="form-group">
							<label for="" class="control-label col-sm-2">支付宝无线支付</label>
							<div class="form-controls col-sm-10">
								<div class="alert alert-warning">
									您的支付宝账号必须支持手机网页即时到账接口, 才能使用手机支付功能,
									<a href="https://b.alipay.com/order/productDetail.htm?productId=2013080604609688" target="_blank" class="color-default">申请及详情请查看这里</a>.
								</div>
							</div>
						</div>
						<div class="form-group">
							<label for="" class="control-label col-sm-2">收款支付宝账号</label>
							<div class="form-controls col-sm-10">
								<div class="input-group">
									<input type="text" name="" class="form-control" placeholder="" ng-model="paysetting.alipay.account">
									<a herf="#" ng-click="aliaccounthelp = !aliaccounthelp" class="input-group-addon"><i class="fa fa-exclamation-circle"></i></a>
								</div>
								<span class="help-block" ng-show="aliaccounthelp">
									如果开启兑换或交易功能，请填写真实有效的支付宝账号，用于收取用户以现金兑换交易积分的相关款项。如账号无效或安全码有误，将导致用户支付后无法正确对其积分账户自动充值，或进行正常的交易对其积分账户自动充值，或进行正常的交易。 如您没有支付宝帐号，
									<a href="https://memberprod.alipay.com/account/reg/enterpriseIndex.htm" target="_blank">请点击这里注册</a>
								</span>
							</div>
						</div>
						<div class="form-group">
							<label for="" class="control-label col-sm-2">合作者身份</label>
							<div class="form-controls col-sm-10">
								<div class="input-group">
									<input type="text" name="" class="form-control" placeholder="" ng-model="paysetting.alipay.partner">
									<a herf="#" ng-click="alipartnerhelp = !alipartnerhelp" class="input-group-addon"><i class="fa fa-exclamation-circle"></i></a>
								</div>
								<span class="help-block" ng-show="alipartnerhelp">
									支付宝签约用户请在此处填写支付宝分配给您的合作者身份，签约用户的手续费按照您与支付宝官方的签约协议为准。
									<br>如果您还未签约，
										<a href="https://memberprod.alipay.com/account/reg/enterpriseIndex.htm" target="_blank">
											请点击这里签约
										</a>；
										如果已签约,
										<a href="https://b.alipay.com/order/pidKey.htm?pid=2088501719138773&amp;product=fastpay" target="_blank">
											请点击这里获取PID、Key
										</a>;
										如果在签约时出现合同模板冲突，请咨询0571-88158090
								</span>
							</div>
						</div>
						<div class="form-group">
							<label for="" class="control-label col-sm-2">校验密钥</label>
							<div class="form-controls col-sm-10">
								<div class="input-group">
									<input type="text" name="" class="form-control" placeholder="" ng-model="paysetting.alipay.secret">
									<a herf="#" ng-click="alisecrethelp = !alisecrethelp" class="input-group-addon"><i class="fa fa-exclamation-circle"></i></a>
								</div>
								<span class="help-block" ng-show="alisecrethelp">支付宝签约用户可以在此处填写支付宝分配给您的交易安全校验码，此校验码您可以到支付宝官方的商家服务功能处查看 </span>
							</div>
						</div>
						<div class="form-group">
							<label for="" class="control-label col-sm-2">模拟测试</label>
							<div class="form-controls col-sm-10">
								<a href="javascript:;" class="form-control-static color-default" ng-click="test_alipay()">模拟测试</a>
								<span class="help-block">本测试将模拟提交 0.01 元人民币的订单进行测试，如果提交后成功出现付款界面，说明您站点的支付宝功能可以正常使用</span>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click="saveEdit('alipay')">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>

	<!-- 微信修改 -->
	<div class="modal fade" id="weixin" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="we7-modal-dialog modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<div class="modal-title">微信支付</div>
				</div>
				<div class="modal-body">
					<div class="we7-form">
						<div class="form-group">
							<label for="" class="control-label col-sm-2">微信支付</label>
							<div class="form-controls col-sm-10">
								<div class="alert alert-warning">
									你必须向微信公众平台提交企业信息以及银行账户资料，审核通过并签约后才能使用微信支付功能,
									<a href="https://pay.weixin.qq.com/guide/webbased_payment.shtml" class="color-default" target="_blank">申请及详情请查看这里</a>
								</div>
								<div class="alert alert-warning">
									<p>微信支付的接口说明如下：</p>
									<br>
									<h4>JS API网页支付参数</h4>
									<p>支付授权目录: {$_W['siteroot']}payment/wechat/ 和 {$_W['siteroot']}app/</p>
									<p>支付请求实例: {$_W['siteroot']}payment/wechat/pay.php</p>
									<p>共享收货地址: 选择"是"</p>
									<br>
									<h4>Native原生支付</h4>
									<p>支付回调URL: {$_W['siteroot']}payment/wechat/native.php</p>
									<p>维权通知URL: {$_W['siteroot']}payment/wechat/rights.php</p>
									<p>警告通知URL: {$_W['siteroot']}payment/wechat/warning.php</p>
								</div>
								{if $accounts[$_W['acid']]['level'] > ACCOUNT_SERVICE}
								{if $accounts[$_W['acid']]['level'] == ACCOUNT_SERVICE_VERIFY}
								<input id='radio-11' type="radio" name='wechat[switch]' ng-checked='paysetting.wechat.switch == 1' ng-click="changeSwitch('wechat', 1)" value="1"/>
								<label for="radio-11">微信支付  </label>
								{/if}
								{if !empty($proxy_wechatpay_account['borrow'])}
								<input id='radio-12' type="radio" name='wechat[switch]' ng-checked='paysetting.wechat.switch == 2' ng-click="changeSwitch('wechat', 2)" value="2"/>
								<label for="radio-12">借用支付  </label>
								{/if}
								
								{/if}
							<!-- 	<input id='radio-24' type="radio" name='wechat[switch]' ng-checked='paysetting.wechat.switch == 4 || paysetting.wechat.switch === false' ng-click="changeSwitch('wechat', 4)" value="4" checked=""/>
								<label for="radio-24">关闭 </label> -->
							</div>
						</div>
						{if $accounts[$_W['acid']]['level'] > ACCOUNT_SERVICE}
						{if $accounts[$_W['acid']]['level'] == ACCOUNT_SERVICE_VERIFY}
						<div ng-show="paysetting.wechat.switch == 1">
							<div class="form-group">
								<label for="" class="control-label col-sm-2">接口类型</label>
								<div class="form-controls col-sm-10">
									<input id='radio-15' type="radio" name='paysetting[wechat][version]' ng-checked='paysetting.wechat.version == 1'  value="1" ng-click="changeVersion(1)"/>
									<label for="radio-15">旧版  </label>
									<input id='radio-25' type="radio" name='paysetting[wechat][version]' ng-checked='paysetting.wechat.version == 2' value="2" ng-click="changeVersion(2)"/>
									<label for="radio-25">新版(2014年9月之后申请的)  </label>
									<span class="help-block">由于微信支付接口调整，需要根据申请时间来区分支付接口</span>
								</div>
							</div>
							<div class="form-group">
								<label for="" class="control-label col-sm-2">支付账号</label>
								<div class="form-controls col-sm-10">
									<a href="" class="form-control-static color-default">{$_W['account']['name']}</a>
								</div>
							</div>
							<div class="form-group">
								<label for="" class="control-label col-sm-2">身份标识<br>(appId)</label>
								<div class="form-controls col-sm-10">
									<input type="text" name="" disabled class="form-control" value="{$_W['account']['key']}" placeholder="">
									<span class="help-block">
										公众号身份标识
										<a href="./index.php?c=account&amp;a=post&amp;uniacid=2">
											请通过修改公众号信息来保存
										</a>
									</span>
								</div>
							</div>
							<div class="form-group">
								<label for="" class="control-label col-sm-2">身份密钥<br>(appSecret)</label>
								<div class="form-controls col-sm-10">
									<input type="text" disabled  value="{$_W['account']['secret']}" name="" class="form-control" placeholder="">
									<span class="help-block">公众平台API(参考文档API 接口部分)的权限获取所需密钥Key
										<a href="./index.php?c=account&amp;a=post&amp;uniacid=2">
											请通过修改公众号信息来保存
										</a>
									</span>
								</div>
							</div>
							<div ng-show="paysetting.wechat.version == 1">
								<div class="form-group">
									<label for="" class="control-label col-sm-2">商户身份</label>
									<div class="form-controls col-sm-10">
										<input type="text" class="form-control" ng-model="paysetting.wechat.partner" placeholder="">
										<span class="help-block">
											财付通商户身份标识
											<br>
											 公众号支付请求中用于加密的密钥Key
										</span>
									</div>
								</div>
								<div class="form-group">
									<label for="" class="control-label col-sm-2">商户密钥</label>
									<div class="form-controls col-sm-10">
										<input type="text" name="" ng-model="paysetting.wechat.key" class="form-control" placeholder="">
										<span class="help-block">
											财付通商户权限密钥
										</span>
									</div>
								</div>
								<div class="form-group">
									<label for="" class="control-label col-sm-2">通信秘钥</label>
									<div class="form-controls col-sm-10">
										<input type="text" name="" ng-model="paysetting.wechat.signkey" class="form-control" placeholder="">
										<span class="help-block">
											财付通商户权限密钥
										</span>
									</div>
								</div>
							</div>
							<div ng-show="paysetting.wechat.version == 2">
								<div class="form-group">
									<label for="" class="control-label col-sm-2">微信支付商户号</label>
									<div class="form-controls col-sm-10">
										<input type="text" name="" ng-model="paysetting.wechat.mchid" class="form-control" placeholder="">
										<span class="help-block">
											财付通商户权限密钥
										</span>
									</div>
								</div>
								<div class="form-group">
									<label for="" class="control-label col-sm-2">微信支付秘钥</label>
									<div class="form-controls col-sm-10">
										<div class="input-group">
											<input type="text" name="" ng-model="paysetting.wechat.apikey" class="form-control" placeholder="">
											<a href="javascript:;" class="input-group-addon" ng-click="tokenGen('wechat.apikey')">生成新的秘钥</a>
										</div>
										<span class="help-block">
											财付通商户权限密钥
										</span>
									</div>
								</div>
							</div>
						</div>
						{/if}
						{if !empty($proxy_wechatpay_account['borrow'])}
						<div ng-show="paysetting.wechat.switch == 2">
							<div class="form-group">
								<label for="" class="control-label col-sm-2">借用公众号</label>
								<div class="form-controls col-sm-10">
									<select name="borrow" class="we7-select" ng-model="paysetting.wechat.borrow">
										<option value="" ng-selected="paysetting.wechat.borrow == 0 || paysetting.wechat.borrow == '' || paysetting.wechat.borrow == undefined">请选择要借用的公众号</option>
										<option value="{{key}}" ng-selected="paysetting.wechat.borrow == key" ng-repeat="(key, account) in config.borrows track by key">{{ account }}</option>
									</select>
									<span class="help-block">借用认证服务号支付权限完成支付。</span>
								</div>
							</div>
						</div>
						{/if}
						
						{/if}
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click='saveEdit("wechat")'>确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	

	<!--银联支付-->
	<div class="modal fade" id="yinlian" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="we7-modal-dialog modal-dialog">
			<form action="{php echo url('profile/payment/save_setting', array('type' => 'unionpay'))}" enctype="multipart/form-data" method="post" id="form1" >
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<div class="modal-title">银联支付</div>
					</div>
					<div class="modal-body">
						<div class="we7-form">
							<div class="form-group">
								<label for="" class="control-label col-sm-2">商户私钥证书（签名）</label>
								<div class="form-controls col-sm-10">
									<input type="file" name="unionpay[signcertpath]" id="amend" {if $pay_setting['unionpay']['signcertexists'] !== false}style="display:none;"{/if} class="form-control" placeholder="">
									<span {if $pay_setting['unionpay']['signcertexists'] === false}style="display:none;"{/if}>证书已上传<input type="button" class="btn btn-success" onclick="amend.click()" value="修改"></span>
								</div>
							</div>
							<div class="form-group">
								<label for="" class="control-label col-sm-2">商户号</label>
								<div class="form-controls col-sm-10">
									<input type="text" name="unionpay[merid]" value="{$pay_setting['unionpay']['merid']}" class="form-control" placeholder="">
								</div>
							</div>
							<div class="form-group">
								<label for="" class="control-label col-sm-2">商户私钥证书密码</label>
								<div class="form-controls col-sm-10">
									<input type="text" name="unionpay[signcertpwd]" value="{$pay_setting['unionpay']['signcertpwd']}" class="form-control" placeholder="">
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="submit" class="btn btn-primary">确定</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
			</form>
		</div>
	</div>


	<div class="modal fade" id="jueqiymf" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="we7-modal-dialog modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<div class="modal-title">一码付</div>
				</div>
				<div class="modal-body">
					<div class="we7-form">
						<div class="form-group">
							<label for="" class="control-label col-sm-2">一码付后台地址</label>
							<div class="form-controls col-sm-10">
								<input type="text"ng-model="paysetting.jueqiymf.url" name="" class="form-control" placeholder="">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="control-label col-sm-2">商户号</label>
							<div class="form-controls col-sm-10">
								<input type="text"ng-model="paysetting.jueqiymf.mchid" name="" class="form-control" placeholder="">
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click="saveEdit('jueqiymf')">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<!--百度钱包-->
	<div class="modal fade" id="baidu" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="we7-modal-dialog modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<div class="modal-title">百度钱包</div>
				</div>
				<div class="modal-body">
					<div class="we7-form">
						<div class="form-group">
							<label for="" class="control-label col-sm-2">商户号</label>
							<div class="form-controls col-sm-10">
								<input type="text"ng-model="paysetting.baifubao.mchid" name="" class="form-control" placeholder="">
							</div>
						</div>
						<div class="form-group">
							<label for="" class="control-label col-sm-2">商户支付密钥</label>
							<div class="form-controls col-sm-10">
								<input type="text" name="" ng-model="paysetting.baifubao.signkey" class="form-control" placeholder="">
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click="saveEdit('baifubao')">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>

	<!--汇款-->
	<div class="modal fade" id="huikuan" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="we7-modal-dialog modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
					<div class="modal-title">汇款支付</div>
				</div>
				<div class="modal-body">
					<div class="we7-form">
						<div class="form-group">
							<label for="" class="control-label col-sm-2">账户信息</label>
							<div class="form-controls col-sm-10">
								<input type="text" id="" name="" ng-model="paysetting.line.message" class="form-control" placeholder="">
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click="saveEdit('line')">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
</div>
{/if}

{if $do == 'switch'}
<ol class="breadcrumb we7-breadcrumb">
	<a href="{url 'profile/payment'}"><i class="wi wi-back-circle"></i> </a>
	<li>
		<a href="{url 'profile/payment'}">支付配置</a>
	</li>
	<li>
		<a href="javascript:;">支付支持</a></li>
	</li>
</ol>

<div class="js-profile-payment" ng-controller="paymentCtrl" ng-cloak>
	<table class="table we7-table table-hover table-form">
		<col width="140px " />
		<col width="400px"/>
		<col />
		<col width="140px" />
		<tr>
			<th colspan="5" >支付方式设置({$payment_types[$_GPC['type']]})</th>
			<th colspan="1" >操作</th>
		</tr>
		<tr>
			<td colspan="2">
				充值
			</td>
			<td colspan="2">
				<label>
					<input name="" class="form-control" type="checkbox" style="display: none;" ng-click="switchStatus(config.paytype, 'recharge_switch')" ng-if="paysetting[config.paytype].recharge_set === true">
					<input name="" class="form-control" type="checkbox" style="display: none;" ng-else>
					<div ng-class="paysetting[config.paytype].recharge_switch === true || paysetting[config.paytype].recharge_switch === 'true' ? 'switch switchOn' : 'switch'"></div>
				</label>
			</td>
			<td colspan="2" ng-if="paysetting[config.paytype].recharge_set !== true">不可启用</td>
			<td colspan="2" ng-if="paysetting[config.paytype].recharge_set === true"></td>
		</tr>
		<tr>
			<td colspan="2">
				支付
			</td>
			<td colspan="2">
				<label>
					<input name="" class="form-control" type="checkbox"  style="display: none;" ng-click="switchStatus(config.paytype, 'pay_switch')">
					<div ng-class="paysetting[config.paytype].pay_switch === true || paysetting[config.paytype].pay_switch === 'true' ? 'switch switchOn' : 'switch'"></div>
				</label>
			</td>
			<td colspan="2"></td>
		</tr>
	</table>
</div>
{/if}
<script>
	angular.module('profileApp').value('config', {
		'paysetting' : {php echo json_encode($pay_setting)},
		'paytype' : "{$_GPC['type']}",
		'saveurl' : "{php echo url('profile/payment/save_setting')}",
		'text_alipay_url' : "{php echo url('profile/payment/test_alipay')}",
		'borrows' : {php echo json_encode($proxy_wechatpay_account['borrow'])},
		'change_status': "{php echo url('profile/payment/change_status')}",
		'services' : {php echo json_encode($proxy_wechatpay_account['service'])},
		'get_setting_url' : "{php echo url('profile/payment/get_setting')}",
		'account_level' : "{$accounts[$_W['acid']]['level']}"
	});
	angular.bootstrap($('.js-profile-payment'), ['profileApp']);
</script>
{template 'common/footer'}