dl_uniapp/App.vue

48 lines
881 B
Vue
Raw Normal View History

2025-03-18 17:41:45 +08:00
<script>
2025-03-21 17:57:53 +08:00
import config from './config'
import store from '@/store'
import {
getToken
} from '@/utils/auth'
2025-03-18 17:41:45 +08:00
2025-03-21 17:57:53 +08:00
export default {
onLaunch: function() {
this.initApp()
2025-05-06 13:24:53 +08:00
//开启分享功能
this.overShare()
2025-03-21 17:57:53 +08:00
},
methods: {
2025-05-06 13:24:53 +08:00
/**
* 开启朋友圈分享功能
* 监听路由切换/自动执行
*/
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) {}
})
}
})
},
2025-03-21 17:57:53 +08:00
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig()
2025-04-21 12:26:33 +08:00
2025-03-21 17:57:53 +08:00
},
initConfig() {
this.globalData.config = config
}
}
}
2025-03-18 17:41:45 +08:00
</script>
<style lang="scss">
2025-04-02 15:17:19 +08:00
@import '@/static/scss/index.scss';
2025-05-12 13:59:02 +08:00
</style>