迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
模板標(biāo)簽里面
那位大神幫忙寫段AJAX代碼
功能需求:在前端頁面購買會員組時(shí)選擇支付方式后直接在當(dāng)前頁面顯示付款二維碼
URL地址相對路徑:/index.php?s=member&c=apply&m=index&gid=會員組ID
模板文件相對路徑:/template/pc/default/member/apply_index.html
可以參考官網(wǎng)的Ajax代碼,只能用于微信掃描二維碼支付
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
我做過這種彈出式二維碼
回復(fù)@官方研發(fā)技術(shù)-羅老師 不會寫才求助 ??
回復(fù)@二開/定制/使用解答專家 只需要一段前端頁面的提交AJAX腳本 不想動(dòng)后端PHP
微信我就沒辦法了,我沒認(rèn)證號,但是支付寶當(dāng)面付我就有
回復(fù)@小黃人 18html 這個(gè)實(shí)現(xiàn)腳本能共享下不
唯一的個(gè)人可以簽約支付寶在線支付接口
回復(fù)@醉貓貓
這個(gè)是要配合我的插件,目前還不是完整版本,需要優(yōu)化
回復(fù)@小黃人 18html 好的 謝謝 那不適用我這邊 我這邊是微信支付 如果有人能寫段AJAX代碼實(shí)現(xiàn)是最好的
二樓可以做,我是找二樓幫我做的,寫前端ajax代碼,不需要寫php
<script type="text/javascript"> function dr_pay() { $.ajax({ type: "POST", dataType: "json", url: '/index.php?s=member&c=pay', data: $("#payform").serialize(), success: function(json) { if (json.code) { // 生成訂單成功 $.ajax({ type: "GET", url: "/index.php?s=api&c=pay&id="+json.code, dataType: "json", success: function(json2){ if (json2.code) { // 請求訂單成功 if (json2.msg == 'html') { var win = window.open('', '運(yùn)行窗口'); win.document.open(); win.document.write(json2.data); win.document.close(); layer.confirm('是否已經(jīng)支付成功?', { btn: ['查看支付', '取消'] }, function(index, layero){ window.location.href = "/index.php?s=api&c=pay&m=call&id="+json.code; }, function(index){ return true }); } else if (json2.msg == 'url') { window.open(json2.data); layer.confirm('是否已經(jīng)支付成功?', { btn: ['查看支付', '取消'] }, function(index, layero){ window.location.href = "/index.php?s=api&c=pay&m=call&id="+json.code; }, function(index){ return true }); } else if (json2.msg == 'show') { dr_cmf_tips(1, '支付成功'); } else { layer.open({ type: 1, title: '支付', fix:true, shadeClose: true, shade: 0, area: ['50%', '50%'], content: "<div class=\"fc-pay\" style=\"padding:10px;\">"+json2.data+"</div>" }); } } else { dr_cmf_tips(0, json2.msg); } }, error: function(HttpRequest, ajaxOptions, thrownError) { var html = HttpRequest.responseText; var win = window.open('', '運(yùn)行窗口'); win.document.open(); win.document.write(html); win.document.close(); } }); } else { dr_cmf_tips(0, json.msg); } }, error: function(HttpRequest, ajaxOptions, thrownError) { dr_ajax_alert_error(HttpRequest, ajaxOptions, thrownError) } }); } </script>
結(jié)帖,結(jié)帖,完美幫樓主解決了
可以參考官網(wǎng)的Ajax代碼,只能用于微信掃描二維碼支付
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
我做過這種彈出式二維碼
回復(fù)@官方研發(fā)技術(shù)-羅老師 不會寫才求助 ??
回復(fù)@二開/定制/使用解答專家 只需要一段前端頁面的提交AJAX腳本 不想動(dòng)后端PHP
微信我就沒辦法了,我沒認(rèn)證號,但是支付寶當(dāng)面付我就有
回復(fù)@小黃人 18html 這個(gè)實(shí)現(xiàn)腳本能共享下不
支付寶當(dāng)面付
唯一的個(gè)人可以簽約支付寶在線支付接口
回復(fù)@醉貓貓
這個(gè)是要配合我的插件,目前還不是完整版本,需要優(yōu)化
回復(fù)@小黃人 18html 好的 謝謝 那不適用我這邊 我這邊是微信支付 如果有人能寫段AJAX代碼實(shí)現(xiàn)是最好的
二樓可以做,我是找二樓幫我做的,寫前端ajax代碼,不需要寫php
回復(fù)@醉貓貓
<script type="text/javascript"> function dr_pay() { $.ajax({ type: "POST", dataType: "json", url: '/index.php?s=member&c=pay', data: $("#payform").serialize(), success: function(json) { if (json.code) { // 生成訂單成功 $.ajax({ type: "GET", url: "/index.php?s=api&c=pay&id="+json.code, dataType: "json", success: function(json2){ if (json2.code) { // 請求訂單成功 if (json2.msg == 'html') { var win = window.open('', '運(yùn)行窗口'); win.document.open(); win.document.write(json2.data); win.document.close(); layer.confirm('是否已經(jīng)支付成功?', { btn: ['查看支付', '取消'] }, function(index, layero){ window.location.href = "/index.php?s=api&c=pay&m=call&id="+json.code; }, function(index){ return true }); } else if (json2.msg == 'url') { window.open(json2.data); layer.confirm('是否已經(jīng)支付成功?', { btn: ['查看支付', '取消'] }, function(index, layero){ window.location.href = "/index.php?s=api&c=pay&m=call&id="+json.code; }, function(index){ return true }); } else if (json2.msg == 'show') { dr_cmf_tips(1, '支付成功'); } else { layer.open({ type: 1, title: '支付', fix:true, shadeClose: true, shade: 0, area: ['50%', '50%'], content: "<div class=\"fc-pay\" style=\"padding:10px;\">"+json2.data+"</div>" }); } } else { dr_cmf_tips(0, json2.msg); } }, error: function(HttpRequest, ajaxOptions, thrownError) { var html = HttpRequest.responseText; var win = window.open('', '運(yùn)行窗口'); win.document.open(); win.document.write(html); win.document.close(); } }); } else { dr_cmf_tips(0, json.msg); } }, error: function(HttpRequest, ajaxOptions, thrownError) { dr_ajax_alert_error(HttpRequest, ajaxOptions, thrownError) } }); } </script>結(jié)帖,結(jié)帖,完美幫樓主解決了