init
This commit is contained in:
235
src/application/admin/template/pay_api/alipay_template.htm
Normal file
235
src/application/admin/template/pay_api/alipay_template.htm
Normal file
@@ -0,0 +1,235 @@
|
||||
{include file="public/layout" /}
|
||||
<style type="text/css">
|
||||
.ncap-form-default dt.tit em.none{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit; min-width:400px;">
|
||||
<div id="append_parent"></div>
|
||||
<div id="ajaxwaitid"></div>
|
||||
<div class="page" style="min-width: 400px;">
|
||||
<div class="flexigrid">
|
||||
<form class="form-horizontal" id="postAlipayForm">
|
||||
<input type="hidden" name="pay_id" value="{$Config.pay_id}">
|
||||
<div class="ncap-form-default"/>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label>支付功能</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<div class="onoff">
|
||||
<label for="is_open_alipay0" class="cb-enable {if condition='!isset($pay_info.is_open_alipay) || empty($pay_info.is_open_alipay)'}selected{/if}">开启</label>
|
||||
<label for="is_open_alipay1" class="cb-disable {if condition='isset($pay_info.is_open_alipay) && $pay_info.is_open_alipay == 1'}selected{/if}">关闭</label>
|
||||
<input id="is_open_alipay0" name="pay_info[is_open_alipay]" value="0" type="radio" {if condition="!isset($pay_info.is_open_alipay) || empty($pay_info.is_open_alipay)"} checked="checked"{/if}>
|
||||
<input id="is_open_alipay1" name="pay_info[is_open_alipay]" value="1" type="radio" {if condition="isset($pay_info.is_open_alipay) && $pay_info.is_open_alipay == 1"} checked="checked"{/if}>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- <dl class="row">
|
||||
<dt class="tit">
|
||||
<label>支付终端</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<ul class="nc-row ncap-waybill-list">
|
||||
<li style="width: 100%;">
|
||||
<label class="label">
|
||||
<input class="check" type="checkbox" name="pay_terminal[]" value="1" {if condition="in_array(1, $Config.pay_terminal)"} checked="checked" {/if}>电脑端
|
||||
</label>
|
||||
|
||||
<label class="label">
|
||||
<input class="check" type="checkbox" name="pay_terminal[]" value="2" {if condition="in_array(2, $Config.pay_terminal)"} checked="checked" {/if}>手机浏览器
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl> -->
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="uname"><em></em>使用支付宝版本</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<label>
|
||||
<input type="radio" name="pay_info[version]" onclick="switch_set(this);" value="0" {if condition="empty($php_version) && empty($pay_info.version)"}checked="checked"{/if} />新版接口
|
||||
<span style="padding-left: 10px; color: #C0C0C0;">支持<font color="red">php5.5.0</font>或更高版本!(阿里云空间必须php7.0或以上)</span>
|
||||
</label>
|
||||
<br/>
|
||||
<label>
|
||||
<input type="radio" name="pay_info[version]" onclick="switch_set(this);" value="1" {if condition="$pay_info.version == 1 || $php_version == 1"}checked="checked"{/if} />旧版接口
|
||||
<span style="padding-left: 10px; color: #C0C0C0;">可支持<font color="red">php5.4</font>或更高版本!</span>
|
||||
</label>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<div id="new_version" {if condition="$pay_info.version == 1 || $php_version == 1"}class="none"{/if}>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_alipay'} none {/notempty}">*</em>支付宝APPID</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[app_id]" id="app_id" value="{$pay_info.app_id|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的支付宝APPID,用于支付宝支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_alipay'} none {/notempty}">*</em>商户私钥</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<textarea rows="5" cols="80" id="merchant_private_key" name="pay_info[merchant_private_key]" style="height:120px;">{$pay_info.merchant_private_key|default=''}</textarea>
|
||||
<p class="notic">请输入您的商户私钥,用于支付宝支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_alipay'} none {/notempty}">*</em>支付宝公钥</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<textarea rows="5" cols="80" id="alipay_public_key" name="pay_info[alipay_public_key]" style="height:106px;">{$pay_info.alipay_public_key|default=''}</textarea>
|
||||
<p class="notic">请输入您的支付宝公钥,用于支付宝支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div id="old_version" {if condition="empty($php_version) && empty($pay_info.version)"}class="none"{/if}>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_alipay'} none {/notempty}">*</em>支付宝账号</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[account]" id="account" value="{$pay_info.account|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的支付宝账号,用于支付宝支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_alipay'} none {/notempty}">*</em>交易安全校验码</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[code]" id="code" value="{$pay_info.code|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的交易安全校验码,用于支付宝支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_alipay'} none {/notempty}">*</em>合作者身份ID</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[id]" id="id" value="{$pay_info.id|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的合作者身份ID,用于支付宝支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<dl class="row">
|
||||
<div class="bot" style="padding-bottom: 0px;">
|
||||
<a href="JavaScript:void(0);" onclick="alipayset();" class="ncap-btn-big ncap-btn-green" id="submitAlipayBtn">确认提交</a>
|
||||
<a href="JavaScript:void(0);" onclick="click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid=11284','支付宝支付配置教程')" style="font-size: 12px;padding-left: 10px;position:absolute;top: 30px">不会配置?</a>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
|
||||
$(function(){
|
||||
$("input[name='pay_info[is_open_alipay]']").click(function(){
|
||||
if(1 == $(this).val()){
|
||||
$('.em_empty').hide();
|
||||
} else {
|
||||
$('.em_empty').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function php_version(is){
|
||||
var php_version = {$php_version};
|
||||
// php_version=1,表示php本版低于5.5.0,不可用新版支付方式
|
||||
if (php_version == 1) {
|
||||
if (is == true) {
|
||||
layer.alert('PHP版本低于5.5.0,不可用新版支付方式,请使用旧版!', {icon: 2, title:false});
|
||||
}
|
||||
$("#postAlipayForm input[name='pay_info[version]'][value=1]").attr("checked","checked");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function switch_set(obj){
|
||||
var switch_set = $(obj).val();
|
||||
if (switch_set == 0) {
|
||||
if (php_version(true)) {
|
||||
$("#postAlipayForm #new_version").show();
|
||||
$("#postAlipayForm #old_version").hide();
|
||||
}
|
||||
}else if (switch_set == 1) {
|
||||
$("#postAlipayForm #new_version").hide();
|
||||
$("#postAlipayForm #old_version").show();
|
||||
}
|
||||
}
|
||||
|
||||
function alipayset(){
|
||||
var is_open_alipay = $("#postAlipayForm input[name='pay_info[is_open_alipay]']:checked").val();
|
||||
if (is_open_alipay == 0){
|
||||
var switch_set = $("#postAlipayForm input[name='pay_info[version]']:checked").val();
|
||||
if (switch_set == 0) {
|
||||
// 新版判断
|
||||
if($('#postAlipayForm #app_id').val() == ''){
|
||||
layer.alert('支付APPID不能为空!', {icon: 2, title:false});
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#postAlipayForm #merchant_private_key').val() == ''){
|
||||
layer.alert('商户私钥不能为空!', {icon: 2, title:false});
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#postAlipayForm #alipay_public_key').val() == ''){
|
||||
layer.alert('支付宝公钥不能为空!', {icon: 2, title:false});
|
||||
return false;
|
||||
}
|
||||
}else if (switch_set == 1) {
|
||||
// 旧版判断
|
||||
if($('#postAlipayForm #account').val() == ''){
|
||||
layer.alert('支付宝账号不能为空!', {icon: 2, title:false});
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#postAlipayForm #code').val() == ''){
|
||||
layer.alert('交易安全校验码不能为空!', {icon: 2, title:false});
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('#postAlipayForm #id').val() == ''){
|
||||
layer.alert('合作者身份ID不能为空!', {icon: 2, title:false});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
layer_loading('正在处理');
|
||||
$.ajax({
|
||||
url: "{:url('PayApi/save_pay_api_config', ['_ajax'=>1])}",
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: $('#postAlipayForm').serialize(),
|
||||
success: function(res){
|
||||
layer.closeAll();
|
||||
if (1 == res.code) {
|
||||
var _parent = parent;
|
||||
_parent.layer.close(parentObj);
|
||||
_parent.layer.msg(res.msg, {shade: 0.3, time: 1000});
|
||||
} else {
|
||||
showErrorAlert(res.msg);
|
||||
}
|
||||
},
|
||||
error: function(e){
|
||||
layer.closeAll();
|
||||
showErrorAlert(e.responseText);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{include file="public/footer" /}
|
||||
87
src/application/admin/template/pay_api/pay_api_index.htm
Normal file
87
src/application/admin/template/pay_api/pay_api_index.htm
Normal file
@@ -0,0 +1,87 @@
|
||||
{include file="public/layout"/}
|
||||
<body class="bodystyle" style=" overflow-y: scroll; min-width: auto;">
|
||||
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
|
||||
<div id="append_parent"></div>
|
||||
<div id="ajaxwaitid"></div>
|
||||
<div class="page" style="min-width:auto;">
|
||||
{include file="system/bar" /}
|
||||
<div class="flexigrid">
|
||||
<!-- <div class="mDiv">
|
||||
<div class="ftitle">
|
||||
<h3>支付接口列表</h3>
|
||||
</div>
|
||||
<div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
|
||||
</div> -->
|
||||
<div class="plug-list">
|
||||
{empty name="list"}
|
||||
<div class="bDiv" style="height: auto;">
|
||||
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
|
||||
<table style="width: 100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="no-data" align="center" axis="col0" colspan="50">
|
||||
<i class="fa fa-exclamation-circle"></i>没有符合条件的记录
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="iDiv" style="display: none;"></div>
|
||||
</div>
|
||||
{else /}
|
||||
{foreach name="list" item="vo" key="k" }
|
||||
<div class="plug-item-content">
|
||||
<div class="plug-item-top">
|
||||
<div class="plug-img">
|
||||
<a href="JavaScript:void(0);"><img src="{$vo.litpic|get_default_pic=###}"></a>
|
||||
</div>
|
||||
<div class="plug-text">
|
||||
<div class="plug-text-title">
|
||||
<a href="JavaScript:void(0);">{$vo.pay_name}</a>
|
||||
</div>
|
||||
<div class="plug-text-versions">
|
||||
<span>{eq name="$vo.system_built" value="1"}系统内置{else/}插件应用{/eq}</span>
|
||||
</div>
|
||||
<!-- <div class="plug-text-des">暂无描述</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="plug-item-bottm">
|
||||
<a href="JavaScript:void(0);" onclick="PayApiConfig({$vo.pay_id}, '{$vo.pay_name}');">配置</a>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/empty}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
// 表格行点击选中切换
|
||||
$('#flexigrid > table>tbody >tr').click(function(){
|
||||
$(this).toggleClass('trSelected');
|
||||
});
|
||||
|
||||
// 点击刷新数据
|
||||
$('.fa-refresh').click(function(){
|
||||
location.href = location.href;
|
||||
});
|
||||
});
|
||||
|
||||
function PayApiConfig(pay_id, title) {
|
||||
if (!pay_id) return false;
|
||||
var url = "{:url('PayApi/open_pay_api_config')}";
|
||||
//iframe窗
|
||||
var iframes = layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
fixed: true,
|
||||
shadeClose: false,
|
||||
shade: 0.3,
|
||||
content: url + '&pay_id=' + pay_id
|
||||
});
|
||||
layer.full(iframes);
|
||||
}
|
||||
</script>
|
||||
|
||||
{include file="public/footer" /}
|
||||
143
src/application/admin/template/pay_api/wechat_template.htm
Normal file
143
src/application/admin/template/pay_api/wechat_template.htm
Normal file
@@ -0,0 +1,143 @@
|
||||
{include file="public/layout" /}
|
||||
<style type="text/css">
|
||||
.ncap-form-default dt.tit em.none{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit; min-width:400px;">
|
||||
<div id="append_parent"></div>
|
||||
<div id="ajaxwaitid"></div>
|
||||
<div class="page" style="min-width: 400px;">
|
||||
<div class="flexigrid">
|
||||
<form class="form-horizontal" id="postWechatForm">
|
||||
<input type="hidden" name="pay_id" value="{$Config.pay_id}">
|
||||
<div class="ncap-form-default">
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label>支付功能</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<div class="onoff">
|
||||
<label for="is_open_wechat0" class="cb-enable {if condition='!isset($pay_info.is_open_wechat) || empty($pay_info.is_open_wechat)'}selected{/if}">开启</label>
|
||||
<label for="is_open_wechat1" class="cb-disable {if condition='isset($pay_info.is_open_wechat) && $pay_info.is_open_wechat == 1'}selected{/if}">关闭</label>
|
||||
<input id="is_open_wechat0" name="pay_info[is_open_wechat]" value="0" type="radio" {if condition="!isset($pay_info.is_open_wechat) || empty($pay_info.is_open_wechat)"} checked="checked"{/if}>
|
||||
<input id="is_open_wechat1" name="pay_info[is_open_wechat]" value="1" type="radio" {if condition="isset($pay_info.is_open_wechat) && $pay_info.is_open_wechat == 1"} checked="checked"{/if}>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- <dl class="row">
|
||||
<dt class="tit">
|
||||
<label>支付终端</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<ul class="nc-row ncap-waybill-list">
|
||||
<li style="width: 100%;">
|
||||
<label class="label">
|
||||
<input class="check" type="checkbox" name="pay_terminal[]" value="1" {if condition="in_array(1, $Config.pay_terminal)"} checked="checked" {/if}>电脑端
|
||||
</label>
|
||||
|
||||
<label class="label">
|
||||
<input class="check" type="checkbox" name="pay_terminal[]" value="2" {if condition="in_array(2, $Config.pay_terminal)"} checked="checked" {/if}>手机浏览器
|
||||
</label>
|
||||
|
||||
<label class="label">
|
||||
<input class="check" type="checkbox" name="pay_terminal[]" value="3" {if condition="in_array(3, $Config.pay_terminal)"} checked="checked" {/if}>手机端微信
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl> -->
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_wechat'} none {/notempty}">*</em>微信AppId</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[appid]" id="appid" value="{$pay_info.appid|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的微信公众平台中的微信AppId,用于微信支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_wechat'} none {/notempty}">*</em>微信商户号</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[mchid]" id="mchid" value="{$pay_info.mchid|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的微信公众平台中的微信商户号,用于微信支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<dt class="tit">
|
||||
<label for="username"><em class="em_empty {notempty name='$pay_info.is_open_wechat'} none {/notempty}">*</em>微信KEY值</label>
|
||||
</dt>
|
||||
<dd class="opt">
|
||||
<input type="text" name="pay_info[key]" id="key" value="{$pay_info.key|default=''}" class="input-txt">
|
||||
<p class="notic">请输入您的微信公众平台中的微信KEY值,用于微信支付。</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="row">
|
||||
<div class="bot" style="padding-bottom:0px;">
|
||||
<a href="JavaScript:void(0);" onclick="wechatset();" class="ncap-btn-big ncap-btn-green" id="submitWechatBtn">确认提交</a>
|
||||
<a href="JavaScript:void(0);" onclick="click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid=8829','微信支付配置教程')" style="font-size: 12px;padding-left: 10px;position:absolute;top: 30px">不会配置?</a>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
|
||||
$(function(){
|
||||
$("input[name='pay_info[is_open_wechat]']").click(function(){
|
||||
if(1 == $(this).val()){
|
||||
$('.em_empty').hide();
|
||||
} else {
|
||||
$('.em_empty').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*微信支付配置*/
|
||||
function wechatset(){
|
||||
var is_open_wechat = $("#postWechatForm input[name='pay_info[is_open_wechat]']:checked").val();
|
||||
if (is_open_wechat == 0) {
|
||||
if ($('#postWechatForm input[id=appid]').val() == '') {
|
||||
layer.alert('微信AppId不能为空!', {icon: 2, title: false});
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($('#postWechatForm input[id=mchid]').val() == '') {
|
||||
layer.alert('微信商户号不能为空!', {icon: 2, title: false});
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($('#postWechatForm input[id=key]').val() == '') {
|
||||
layer.alert('微信KEY值不能为空!', {icon: 2, title: false});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
layer_loading('正在处理');
|
||||
$.ajax({
|
||||
url: "{:url('PayApi/save_pay_api_config', ['_ajax'=>1])}",
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: $('#postWechatForm').serialize(),
|
||||
success: function(res){
|
||||
layer.closeAll();
|
||||
if (1 == res.code) {
|
||||
var _parent = parent;
|
||||
_parent.layer.close(parentObj);
|
||||
_parent.layer.msg(res.msg, {shade: 0.3, time: 1000});
|
||||
} else {
|
||||
showErrorAlert(res.msg);
|
||||
}
|
||||
},
|
||||
error: function(e){
|
||||
layer.closeAll();
|
||||
showErrorAlert(e.responseText);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{include file="public/footer" /}
|
||||
Reference in New Issue
Block a user