Created
June 7, 2017 23:09
-
-
Save xhat/e5005127c77edffba68abe33f2fbd74c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="mainbody"> | |
<div class="demo_title">演示代码</div> | |
<div class="blank"></div> | |
<p id="m-radio"> | |
<input type="radio" name="money" value="10" checked > 0.1元 | |
<input type="radio" name="money" value="500" > 5元 | |
<input type="radio" name="money" value="1000" > 10元 | |
<input type="radio" name="money" value="5000" > 50元 | |
</p> | |
<p id="p-radio"> | |
<input type="radio" name="pay" value="wxpay" checked > 微信支付 | |
<input type="radio" name="pay" value="alipay" > 支付宝 | |
<input type="radio" name="pay" value="jdpay" > 京东钱包 | |
<input type="radio" name="pay" value="qpay" > QQ钱包 | |
</p> | |
<!-- 支付代码接入 开始 --> | |
<script | |
src="https://payjs.cn/pay.js" | |
mch="Wr6BrP" | |
amount="10" | |
id="popfeng"> | |
</script> | |
<!-- 支付代码接入 结束 --> | |
</div> | |
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
$("#p-radio :radio").click(function(){ | |
var value = $(this).val(); | |
$("#popfeng").attr("pay",value); | |
}); | |
$("#m-radio :radio").click(function(){ | |
var value = $(this).val(); | |
$("#popfeng").attr("amount",value); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment