webpackJsonp([33],{"N/BN":function(e,t){},PdiS:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("mvHQ"),c=r.n(a),o=(r("Au9i"),{mixins:[r("5g4Q").a],data:function(){return{accelerometerInfo:{flag:!1,cardDom:null,player:null,timer:null,text:"卡片"}}},created:function(){plus.screen.lockOrientation("portrait-primary")},mounted:function(){this.accelerometerInfo.cardDom=this.$refs.cardWrap,this.watchAcceleration()},methods:{watchAcceleration:function(){var e=this;plus.accelerometer.watchAcceleration(function(t){e.accelerometerInfo.cardDom&&!e.accelerometerInfo.player&&Math.abs(t.xAxis)+Math.abs(t.yAxis)+Math.abs(t.zAxis)>30&&(console.log("搖一搖成功"),e.cardTurn())},function(e){console.log("摇一摇失败")},{frequency:100})},cardTurn:function(){var e=this,t=e.accelerometerInfo.player;t||(t=plus.audio.createPlayer("/static/media/shake.wav"),console.log("player "+c()(t)),t.play()),setTimeout(function(){t&&t.stop(),delete e.accelerometerInfo.player,t=null},1e3),e.accelerometerInfo.cardDom.style.webkitTransform="rotateY(180deg)",e.accelerometerInfo.cardDom.style.msTransform="rotateY(180deg)",e.accelerometerInfo.timer&&clearTimeout(e.accelerometerInfo.timer),e.accelerometerInfo.timer=setTimeout(function(){e.accelerometerInfo.timer=null,e.accelerometerInfo.cardDom.style.webkitTransform="",e.accelerometerInfo.cardDom.style.msTransform=""},500)}}}),n={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("transition",{attrs:{name:"slide"}},[r("div",{staticClass:"accelerometer"},[r("mt-header",{staticClass:"header",attrs:{title:"Accelerometer",fixed:e.headerConf.fixed}},[r("div",{attrs:{slot:"left"},slot:"left"},[r("mt-button",{attrs:{icon:"back"},on:{click:e.back}},[e._v("返回")])],1)]),e._v(" "),r("div",{staticClass:"content"},[r("div",{staticClass:"row-block"},[r("mt-button",{attrs:{type:"primary"},on:{click:e.cardTurn}},[e._v("摇一摇")])],1),e._v(" "),r("div",{ref:"cardWrap",staticClass:"cardWrap",attrs:{id:"cardWrap"}},[e._v("\n        "+e._s(e.accelerometerInfo.text)+"\n      ")])])],1)])},staticRenderFns:[]};var l=r("VU/8")(o,n,!1,function(e){r("N/BN")},"data-v-03074e64",null);t.default=l.exports}});
//# sourceMappingURL=33.9be78caaad260adebe82.js.map