dl_uniapp/App.vue
2025-05-12 13:59:02 +08:00

48 lines
881 B
Vue

<script>
import config from './config'
import store from '@/store'
import {
getToken
} from '@/utils/auth'
export default {
onLaunch: function() {
this.initApp()
//开启分享功能
this.overShare()
},
methods: {
/**
* 开启朋友圈分享功能
* 监听路由切换/自动执行
*/
overShare() {
wx.onAppRoute((res) => {
// console.log('route', res)
let pages = getCurrentPages()
let view = pages[pages.length - 1]
if (view) {
wx.showShareMenu({
menus: ['shareAppMessage', 'shareTimeline'],
success(res) {},
fail(e) {}
})
}
})
},
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig()
},
initConfig() {
this.globalData.config = config
}
}
}
</script>
<style lang="scss">
@import '@/static/scss/index.scss';
</style>