12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import Vue from 'vue'
- import store from './store'
- import App from './App'
- import uView from "uview-ui";
- Vue.prototype.$store = store
- const msg = (title, duration=1500, mask=false, icon='none')=>{
-
- if(Boolean(title) === false){
- return;
- }
- uni.showToast({
- title,
- duration,
- mask,
- icon
- });
- }
- const prePage = ()=>{
-
- let pages = getCurrentPages();
- let prePage = pages[pages.length - 2];
-
- return prePage;
-
- return prePage.$vm;
- }
- var music = null;
- music = uni.createInnerAudioContext();
- music.autoplay = false;
- music.loop = true;
- music.src= "./static/audio/xx.mp3";
- Vue.prototype.ScanAudio = function(e){
- let player = e;
- if (player == true ) {
- music.play();
- console.log('执行播放1', player)
- } else {
- music.pause();
- console.log('暂停播放')
- }
- }
- Vue.use(uView);
- Vue.config.productionTip = false
- Vue.prototype.$fire = new Vue();
- Vue.prototype.$store = store;
- Vue.prototype.$api = {msg, prePage};
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
|