Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

pay_set.htm 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page" style="min-width: auto;">
  6. {include file="member/bar" /}
  7. <div class="flexigrid">
  8. <div class="mDiv">
  9. <div class="ftitle">
  10. <h3>接口配置</h3>
  11. </div>
  12. <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
  13. <div class="sDiv">
  14. <div class="sDiv2 addartbtn fl" style="margin-right: 6px;">
  15. <input type="button" class="btn selected" value="接口配置" onclick="window.location.href='{:url("Member/pay_set")}';">
  16. </div>
  17. <div class="sDiv2 addartbtn fl" style="margin-right: 6px;">
  18. <input type="button" class="btn current" value="账户充值记录" onclick="window.location.href='{:url("Member/money_index")}';">
  19. </div>
  20. </div>
  21. </div>
  22. <form class="form-horizontal" id="postWechatForm" action="{:url('Member/wechat_set')}" method="post">
  23. <div class="hDiv">
  24. <div class="hDivBox">
  25. <table cellspacing="0" cellpadding="0" style="width: 100%">
  26. <thead>
  27. <tr>
  28. <th class="sign w10" axis="col0">
  29. <div class="tc"></div>
  30. </th>
  31. <th abbr="article_title" axis="col3" class="w10">
  32. <div class="tc">微信支付配置</div>
  33. </th>
  34. <th abbr="ac_id" axis="col4">
  35. <div class=""></div>
  36. </th>
  37. </tr>
  38. </thead>
  39. </table>
  40. </div>
  41. </div>
  42. <div class="ncap-form-default">
  43. <dl class="row">
  44. <dt class="tit">
  45. <label>支付方式</label>
  46. </dt>
  47. <dd class="opt">
  48. <div class="onoff">
  49. <label for="is_open_wechat0" class="cb-enable {if condition="!isset($wechat.is_open_wechat) || empty($wechat.is_open_wechat)"}selected{/if}">开启</label>
  50. <label for="is_open_wechat1" class="cb-disable {if condition="$wechat.is_open_wechat == 1"}selected{/if}">关闭</label>
  51. <input id="is_open_wechat0" name="wechat[is_open_wechat]" value="0" type="radio" {if condition="!isset($wechat.is_open_wechat) || empty($wechat.is_open_wechat)"} checked="checked"{/if}>
  52. <input id="is_open_wechat1" name="wechat[is_open_wechat]" value="1" type="radio" {if condition="$wechat.is_open_wechat == 1"} checked="checked"{/if}>
  53. </div>
  54. </dd>
  55. </dl>
  56. <dl class="row">
  57. <dt class="tit">
  58. <label for="username"><em>*</em>微信AppId</label>
  59. </dt>
  60. <dd class="opt">
  61. <input type="text" name="wechat[appid]" id="appid" value="{$wechat.appid}" class="input-txt">
  62. <p class="notic">请输入您的微信公众平台中的微信AppId,用于微信支付。</p>
  63. </dd>
  64. </dl>
  65. <dl class="row">
  66. <dt class="tit">
  67. <label for="username"><em>*</em>微信商户号</label>
  68. </dt>
  69. <dd class="opt">
  70. <input type="text" name="wechat[mchid]" id="mchid" value="{$wechat.mchid}" class="input-txt">
  71. <p class="notic">请输入您的微信公众平台中的微信商户号,用于微信支付。</p>
  72. </dd>
  73. </dl>
  74. <dl class="row">
  75. <dt class="tit">
  76. <label for="username"><em>*</em>微信KEY值</label>
  77. </dt>
  78. <dd class="opt">
  79. <input type="text" name="wechat[key]" id="key" value="{$wechat.key}" class="input-txt">
  80. <p class="notic">请输入您的微信公众平台中的微信KEY值,用于微信支付。</p>
  81. </dd>
  82. </dl>
  83. <dl class="row">
  84. <div class="bot" style="padding-bottom:0px;">
  85. <a href="JavaScript:void(0);" onclick="wechatset();" class="ncap-btn-big ncap-btn-green" id="submitWechatBtn">确认提交</a>
  86. &nbsp;<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>
  87. </div>
  88. </dl>
  89. </div>
  90. </form>
  91. <form class="form-horizontal" id="postAlipayForm" action="{:url('Member/alipay_set')}" method="post">
  92. <div class="hDiv">
  93. <div class="hDivBox">
  94. <table cellspacing="0" cellpadding="0" style="width: 100%">
  95. <thead>
  96. <tr>
  97. <th class="sign w10" axis="col0">
  98. <div class="tc"></div>
  99. </th>
  100. <th abbr="article_title" axis="col3" class="w10">
  101. <div class="tc">支付宝支付配置</div>
  102. </th>
  103. <th abbr="ac_id" axis="col4">
  104. <div class=""></div>
  105. </th>
  106. </tr>
  107. </thead>
  108. </table>
  109. </div>
  110. </div>
  111. <div class="ncap-form-default">
  112. <dl class="row">
  113. <dt class="tit">
  114. <label>支付方式</label>
  115. </dt>
  116. <dd class="opt">
  117. <div class="onoff">
  118. <label for="is_open_alipay0" class="cb-enable {if condition="!isset($alipay.is_open_alipay) || empty($alipay.is_open_alipay)"}selected{/if}">开启</label>
  119. <label for="is_open_alipay1" class="cb-disable {if condition="$alipay.is_open_alipay == 1"}selected{/if}">关闭</label>
  120. <input id="is_open_alipay0" name="alipay[is_open_alipay]" value="0" type="radio" {if condition="!isset($alipay.is_open_alipay) || empty($alipay.is_open_alipay)"} checked="checked"{/if}>
  121. <input id="is_open_alipay1" name="alipay[is_open_alipay]" value="1" type="radio" {if condition="$alipay.is_open_alipay == 1"} checked="checked"{/if}>
  122. </div>
  123. </dd>
  124. </dl>
  125. <dl class="row">
  126. <dt class="tit">
  127. <label for="uname"><em></em>使用支付宝版本</label>
  128. </dt>
  129. <dd class="opt">
  130. <label>
  131. <input type="radio" name="alipay[version]" onclick="switch_set(this);" value="0" {if condition="empty($php_version) && empty($alipay.version)"}checked="checked"{/if} />新版接口
  132. <span style="padding-left: 10px; color: #C0C0C0;">支持<font color="red">php5.5.0</font>或更高版本!(阿里云空间必须php7.0或以上)</span>
  133. </label>
  134. <br/>
  135. <label>
  136. <input type="radio" name="alipay[version]" onclick="switch_set(this);" value="1" {if condition="$alipay.version == 1 || $php_version == 1"}checked="checked"{/if} />旧版接口
  137. <span style="padding-left: 10px; color: #C0C0C0;">可支持<font color="red">php5.4</font>或更高版本!</span>
  138. </label>
  139. </dd>
  140. </dl>
  141. <div id="new_version" {if condition="$alipay.version == 1 || $php_version == 1"}class="none"{/if}>
  142. <dl class="row">
  143. <dt class="tit">
  144. <label for="username"><em>*</em>支付宝APPID</label>
  145. </dt>
  146. <dd class="opt">
  147. <input type="text" name="alipay[app_id]" id="app_id" value="{$alipay.app_id}" class="input-txt">
  148. <p class="notic">请输入您的支付宝APPID,用于支付宝支付。</p>
  149. </dd>
  150. </dl>
  151. <dl class="row">
  152. <dt class="tit">
  153. <label for="username"><em>*</em>商户私钥</label>
  154. </dt>
  155. <dd class="opt">
  156. <textarea rows="5" cols="80" id="merchant_private_key" name="alipay[merchant_private_key]" style="height:120px;">{$alipay.merchant_private_key}</textarea>
  157. <p class="notic">请输入您的商户私钥,用于支付宝支付。</p>
  158. </dd>
  159. </dl>
  160. <dl class="row">
  161. <dt class="tit">
  162. <label for="username"><em>*</em>支付宝公钥</label>
  163. </dt>
  164. <dd class="opt">
  165. <textarea rows="5" cols="80" id="alipay_public_key" name="alipay[alipay_public_key]" style="height:106px;">{$alipay.alipay_public_key}</textarea>
  166. <p class="notic">请输入您的支付宝公钥,用于支付宝支付。</p>
  167. </dd>
  168. </dl>
  169. </div>
  170. <div id="old_version" {if condition="empty($php_version) && empty($alipay.version)"}class="none"{/if}>
  171. <dl class="row">
  172. <dt class="tit">
  173. <label for="username"><em>*</em>支付宝账号</label>
  174. </dt>
  175. <dd class="opt">
  176. <input type="text" name="alipay[account]" id="account" value="{$alipay.account}" class="input-txt">
  177. <p class="notic">请输入您的支付宝账号,用于支付宝支付。</p>
  178. </dd>
  179. </dl>
  180. <dl class="row">
  181. <dt class="tit">
  182. <label for="username"><em>*</em>交易安全校验码</label>
  183. </dt>
  184. <dd class="opt">
  185. <input type="text" name="alipay[code]" id="code" value="{$alipay.code}" class="input-txt">
  186. <p class="notic">请输入您的交易安全校验码,用于支付宝支付。</p>
  187. </dd>
  188. </dl>
  189. <dl class="row">
  190. <dt class="tit">
  191. <label for="username"><em>*</em>合作者身份ID</label>
  192. </dt>
  193. <dd class="opt">
  194. <input type="text" name="alipay[id]" id="id" value="{$alipay.id}" class="input-txt">
  195. <p class="notic">请输入您的合作者身份ID,用于支付宝支付。</p>
  196. </dd>
  197. </dl>
  198. </div>
  199. <dl class="row">
  200. <div class="bot">
  201. <a href="JavaScript:void(0);" onclick="alipayset();" class="ncap-btn-big ncap-btn-green" id="submitAlipayBtn">确认提交</a>
  202. </div>
  203. </dl>
  204. </div>
  205. </form>
  206. </div>
  207. </div>
  208. <script>
  209. $(document).ready(function(){
  210. // 表格行点击选中切换
  211. $('#flexigrid > table>tbody >tr').click(function(){
  212. $(this).toggleClass('trSelected');
  213. });
  214. // 点击刷新数据
  215. $('.fa-refresh').click(function(){
  216. location.href = location.href;
  217. });
  218. });
  219. /*微信支付配置*/
  220. function wechatset(){
  221. if($('#postWechatForm input[id=appid]').val() == ''){
  222. layer.alert('微信AppId不能为空!', {icon: 2, title:false});
  223. return false;
  224. }
  225. if($('#postWechatForm input[id=mchid]').val() == ''){
  226. layer.alert('微信商户号不能为空!', {icon: 2, title:false});
  227. return false;
  228. }
  229. if($('#postWechatForm input[id=key]').val() == ''){
  230. layer.alert('微信KEY值不能为空!', {icon: 2, title:false});
  231. return false;
  232. }
  233. layer_loading('正在处理');
  234. $.ajax({
  235. url: "{:url('Member/wechat_set', ['_ajax'=>1])}",
  236. type: 'POST',
  237. dataType: 'JSON',
  238. data: $('#postWechatForm').serialize(),
  239. success: function(res){
  240. layer.closeAll();
  241. if (1 == res.code) {
  242. layer.msg(res.msg, {icon: 1, time: 1000});
  243. return false;
  244. } else {
  245. layer.alert(res.msg, {icon: 2, title:false});
  246. return false;
  247. }
  248. },
  249. error: function(e){
  250. layer.closeAll();
  251. showErrorMsg(e.responseText);
  252. return false;
  253. }
  254. });
  255. }
  256. function php_version(is){
  257. var php_version = {$php_version};
  258. // php_version=1,表示php本版低于5.5.0,不可用新版支付方式
  259. if (php_version == 1) {
  260. if (is == true) {
  261. layer.alert('PHP版本低于5.5.0,不可用新版支付方式,请使用旧版!', {icon: 2, title:false});
  262. }
  263. $("#postAlipayForm input[name='alipay[version]'][value=1]").attr("checked","checked");
  264. return false;
  265. }
  266. return true;
  267. }
  268. function switch_set(obj){
  269. var switch_set = $(obj).val();
  270. if (switch_set == 0) {
  271. if (php_version(true)) {
  272. $("#postAlipayForm #new_version").show();
  273. $("#postAlipayForm #old_version").hide();
  274. }
  275. }else if (switch_set == 1) {
  276. $("#postAlipayForm #new_version").hide();
  277. $("#postAlipayForm #old_version").show();
  278. }
  279. }
  280. function alipayset(){
  281. var switch_set = $("#postAlipayForm input[name='alipay[version]']:checked").val();
  282. if (switch_set == 0) {
  283. // 新版判断
  284. if($('#postAlipayForm #app_id').val() == ''){
  285. layer.alert('支付APPID不能为空!', {icon: 2, title:false});
  286. return false;
  287. }
  288. if($('#postAlipayForm #merchant_private_key').val() == ''){
  289. layer.alert('商户私钥不能为空!', {icon: 2, title:false});
  290. return false;
  291. }
  292. if($('#postAlipayForm #alipay_public_key').val() == ''){
  293. layer.alert('支付宝公钥不能为空!', {icon: 2, title:false});
  294. return false;
  295. }
  296. }else if (switch_set == 1) {
  297. // 旧版判断
  298. if($('#postAlipayForm #account').val() == ''){
  299. layer.alert('支付宝账号不能为空!', {icon: 2, title:false});
  300. return false;
  301. }
  302. if($('#postAlipayForm #code').val() == ''){
  303. layer.alert('交易安全校验码不能为空!', {icon: 2, title:false});
  304. return false;
  305. }
  306. if($('#postAlipayForm #id').val() == ''){
  307. layer.alert('合作者身份ID不能为空!', {icon: 2, title:false});
  308. return false;
  309. }
  310. }
  311. layer_loading('正在处理');
  312. $.ajax({
  313. url: "{:url('Member/alipay_set', ['_ajax'=>1])}",
  314. type: 'POST',
  315. dataType: 'JSON',
  316. data: $('#postAlipayForm').serialize(),
  317. success: function(res){
  318. layer.closeAll();
  319. if (1 == res.code) {
  320. layer.msg(res.msg, {icon: 1, time: 1000});
  321. return false;
  322. } else {
  323. layer.alert(res.msg, {icon: 2, title:false});
  324. return false;
  325. }
  326. },
  327. error: function(e){
  328. layer.closeAll();
  329. showErrorMsg(e.responseText);
  330. return false;
  331. }
  332. });
  333. }
  334. </script>
  335. {include file="public/footer" /}