苹果CMS在线/卡密充值教程
作者 :
发布时间:2026-09-21 18:27:25
共人阅读
文件目录html/user/buy.html
在线充值表单示例:
<div class="line40"> <p>充值的金额:<input type="text" name="price" value="{$config.min}" class="jifen-input"></p> <p><input type="button" class="jifen2-button" value="确认"></p> <p class="hui">友情提示:最小充值金额为{$config.min}元,1元可以兑换{$config.scale}个积分</p></div><script> $('#btn_submit_pay').click(function(){ var that=$(this); var price = $("input[name='price']").val(); if(Number(price)<1){ return; } if(confirm('确定要在线充值吗')) { $.ajax({ url: "{:url('user/buy')}", type: "post", dataType: "json", data: {price: price,flag:'pay'}, beforeSend: function () { $("#btn_submit_pay").css("background","#fd6a6a").val("loading..."); }, success: function (r) { if (r.code == 1) { //生成订单后跳转支付页面 location.href="{:url('user/pay')}?order_code=" + r.data.order_code; } else{ alert(r.msg); } }, complete: function () { $("#btn_submit_pay").css("background","#fa4646").val("提交"); } }); } });</script>卡密充值表单示例:
<div class="line40"> <p>充值卡号:<input type="text" name="card_no" value="" class="jifen-input"> {if condition="$GLOBALS['config']['pay']['card']['url'] neq ''"} <a target="_blank" href="{$GLOBALS['config']['pay']['card']['url']}">点击购买卡密</a> {/if} </p> <p>充值密码:<input type="text" name="card_pwd" value="" class="jifen-input"></p> <p><input type="button" class="jifen2-button" value="确认"></p> <p class="hui">友情提示:请到卡密平台购买充值卡</p></div><script> $('#btn_submit_card').click(function(){ var that=$(this); var no = $('input[name="card_no"]').val(); var pwd = $('input[name="card_pwd"]').val(); if(no=='' || pwd==''){ alert('请输入充值卡号和密码'); return; } if(confirm('确定要使用充值卡充值吗')) { $.ajax({ url: "{:url('user/buy')}", type: "post", dataType: "json", data: {card_no: no,card_pwd:pwd,flag:'card'}, beforeSend: function () { $("#btn_submit_card").css("background","#fd6a6a").val("loading..."); }, success: function (r) { alert(r.msg); }, complete: function () { $("#btn_submit_card").css("background","#fa4646").val("提交"); } }); } });</script>
1、本站资源均收集与网络,仅供学习与参考,请勿用于商业用途。
2、禁止恶意使用本站资源从事违法行为,一律用于者承担。
3、本站资源版权均归原作者所有,如需商业,请购买正版。
4、转载或引用本网站内容须注明原网址,并标明本网站网址:www.laiac.com
2、禁止恶意使用本站资源从事违法行为,一律用于者承担。
3、本站资源版权均归原作者所有,如需商业,请购买正版。
4、转载或引用本网站内容须注明原网址,并标明本网站网址:www.laiac.com




