要实现音频自动连续播放,需要在微信load事件中全部play再全部pause:
wx.ready(function(){
WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
audioPlay();
audioPause();
});
})
微信支付一个示例代码:
wx.chooseWXPay({
timestamp:params.timeStamp,
nonceStr:params.nonceStr,
package:params.package,
signType:params.signType,
paySign:params.paySign,
success:function(res){
if (res.errMsg == 'chooseWXPay:ok') {
//更改订单状态
window.location.href = data.data.url;
} else {
//alert('下单失败,请稍候重试');
poput.alertHtml({
htmls:'<p>下单失败,请稍候重试</p>',
puputName:'alert',
puputcenName:'alertinfo',
alertFun:function(dom){
dom.on('click',function(){
dom.remove();
})
setTimeout(function(){
dom.remove();
},3000)
}
});
}
},
fail:function(res) {
//alert('下单失败,请稍候重试');
},
cancel:function(res) {
//alert('下单失败,请稍候重试');
//window.location.href= data.data.url
},
complete:function name(res) {
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
$('.poputewm').find('.close').on('click', function name() {
window.location.href = data.data.url
});
if (res.errMsg == 'chooseWXPay:fail' || res.errMsg == 'chooseWXPay:cancel') {
}
}
});
取消分享功能
// 取消分享功能
wx.ready(function(){
wx.hideAllNonBaseMenuItem();
});
隐藏底部导航栏
$(function(){
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.call('hideToolbar');
});
})
网友评论