1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import Vue from 'vue'
- import App from './App'
- Vue.config.productionTip = false
- // 打开App
- Vue.prototype.openApp = function (page, channel, audioType, audioId) {
- const res = uni.getSystemInfoSync()
- var ua = window.navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/WeiBo/i) == "weibo" || ua.match(/QQ/i) == "qq") {
- uni.showToast({
- icon: 'none',
- title: '右上角在浏览器打开',
- mask: true
- })
- } else {
- if (res.platform === 'ios') {
- window.location.href = 'airsmart://?page=${page}&channel=${channel}&audioType=${audioType}&audioId=${audioId}'
- } else {
- window.location.href = `airsmart://com.muzen.radioplayer:8888/main?page=${page}&channel=${channel}&audioType=${audioType}&audioId=${audioId}`
- }
- var timer = setTimeout(() => {
- if (res.platform === 'ios') {
- window.location.href = 'itms-appss://itunes.apple.com/cn/app/apple-store/id1621419943?mt=8'
- } else {
- window.location.href = 'https://music-play.oss-cn-shenzhen.aliyuncs.com/backOss/file/bacde3d529014ad08fcddb6baaffbc28.apk'
- }
- }, 3000);
- }
- document.addEventListener('visibilitychange', function () {
- if (document.hidden) {
- clearTimeout(timer)
- }
- })
- window.onpagehide = event => {
- if (event.persisted) {
- clearTimeout(timer)
- }
- }
- }
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
|