在微信公众号中 没有iframe的时候window.WeixinJSBridge为对象,有iframe时为undefined 要使用 window.parent.WeixinJSBridge得到 if(window.WeixinJSBridge || window.parent.WeixinJSBridge) { this.play() }