完成XGL微信授权

This commit is contained in:
Andy Leong
2022-07-28 19:26:05 +08:00
parent 30727f4f65
commit 0be21f0195
12 changed files with 403 additions and 82 deletions

View File

@@ -1,6 +1,9 @@
<template>
<div class="homePage">
<Index />
<!-- 加载页 -->
<!-- 首页 -->
<Index @indexPage="indexPage" />
</div>
</template>
@@ -18,17 +21,14 @@ import Index from "@/components/Index"
onBeforeMount(() => { });
// 页面挂载
onMounted(() => {
onMounted(() => { });
// 来自首页的事件
const indexPage = (actions) => {
console.log("来自index组件", actions);
}
// 微信分享
const optionShare = {
title: '2022中国中产女性财富管理及幸福指数报告', // 分享标题
desc: ' ', // 分享描述
link: process.env.VUE_APP_BASE_URL + 'index.html', // 分享链接
imgUrl: process.env.VUE_APP_CDN + 'share.jpg', // 分享图标
}
wxShare(optionShare)
});
</script>
<style lang="scss" scoped>

View File

@@ -5,15 +5,26 @@ import App from './Home.vue'
import Vue from 'vue'
import store from '@/store'
import "amfe-flexible"
import h5plugin from '@/utils/plugin'
import VConsole from 'vconsole'
const vConsole = new VConsole();
// 注册全局方法
const app = createApp(App);
app.config.globalProperties.$H5Plugin = h5plugin;
// 测试环境微信端才展示vconsole
if (h5plugin.isMobile() && h5plugin.isWX() && process.env.NODE_ENV == "test") {
const vConsole = new VConsole();
}
console.log("环境:", process.env.NODE_ENV)
// app.use(router)
app.use(store)
app.mount('#app')