<button type="button" class="mui-btn mui-btn-block mui-disabled js-wechat-pay">微信支付(加载中)</button>
<button type="button" onclick="dopayBaidu()" class="mui-btn mui-btn-block">百度钱包</button>

<script type="text/javascript">

//发起微信支付,微信支付依赖于 WeixinJSBridge 组件,所以发起时应该在ready事件中进行
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
    $('.js-wechat-pay').removeClass('mui-disabled');
    $('.js-wechat-pay').click(function(){
        //先通过AJAX获取最新的订单号
//         $.getJSON("xxxx.php", function(data, status){
//             if(status == 'success'){
                util.pay({
                    orderFee : 1,
                    payMethod : 'wechat',
                    orderTitle : '充值1元',
                    orderTid : '99886566323232',
                    module : 'week_cp',
                    success : function(result) {
                        alert('支付成功');
                    },
                    fail : function(result) {
                        alert('fail : ' + result.message);
                    },
                    complete : function(result) {
                        location.reload();
                    }
                });
//             }
//         });
    });
    $('.js-wechat-pay').html('微信支付');
});

//百度钱包和其它支付则无浏览器组件要求,可直接使用
function dopayBaidu() {
        util.pay({
            orderFee : 0.01,
            payMethod : 'baifubao',
            orderTitle : '充值10元',
            orderTid : 1234567104,
            module : 'recharge',
            success : function(res) {
                alert('支付成功');
            },
            fail : function(result) {
                alert('fail : ' + result.message);
            },
            complete : function(result) {
                alert('complete : ' + result.message);
            }
        });
}
</script>