<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>支付测试模板</title> </head> <body> <form action="" name="pay" method="post" enctype="multipart/form-data"> 评估类型:<input type="text" name="assess_type"/><br/> 购买年限:<input type="text" name="assess_year"/><br/> 邀请码数量:<input type="text" name="code_num"/><br/> 团队报告购买年限:<input type="text" name="report_year"/><br/> 团队报告是否开发票:<input type="text" name="report_bill"/><br/> 团队报告的姓名:<input type="text" name="report_address_uname"/><br/> 团队报告的电话:<input type="text" name="report_address_mobile"/><br/> 团队报告的地址:<input type="text" name="report_address"/><br/> 单价:<input type="text" name="price"/><br/> 数量:<input type="text" name="num"/><br/> 总金额:<input type="text" name="total_fee"/><br/> <button οnclick="wei()"/>微信支付</button> <button οnclick="zhi()"/>支付宝支付</button> </form> </body> </html> <script> function wei(){ // document.("表单的name值").action // document.("表单的name值").submit document.pay.action="{:U('Home/Payment/getQrcode')}"; document.pay.submit(); } function zhi() { document.pay.action = "{:U('Home/Payment/doalipay')}"; document.pay.submit(); } </script>