buddhism/main.js

74 lines
1.6 KiB
JavaScript
Raw Normal View History

2025-08-28 12:00:35 +08:00
import Vue from "vue";
import App from "./App";
import cookies from "weapp-cookie";
import uView from "uview-ui";
import Vuex from "vuex";
2023-12-05 16:45:28 +08:00
// http接口API集中管理引入部分
2024-03-13 10:54:22 +08:00
// import httpApi from '@/common/http.api.js'
import createStore from "./store/index.js";
2025-08-28 12:00:35 +08:00
import "./uni.scss";
2023-12-05 16:45:28 +08:00
// 公共样式与字体图标
2025-08-28 12:00:35 +08:00
import "./common/css/common.css";
import "./common/css/iconfont.css";
2023-11-27 09:57:03 +08:00
2025-08-28 12:00:35 +08:00
import md5 from "js-md5";
2023-12-05 16:45:28 +08:00
// 引入公共组件 tabbar
2025-08-28 12:00:35 +08:00
import tabbar from "@/components/tab-bar/tab-bar.vue";
import httpConfig from "@/common/http.config.js";
// 初始化全局loading管理器
import PageScrollMixin from "./mixins/page-scroll-mixin.js";
2023-12-05 16:45:28 +08:00
2025-09-16 16:20:50 +08:00
// 必须在导入 store 之前注册 Vuex
Vue.use(Vuex);
2023-12-05 16:45:28 +08:00
// import customizeAnswer from'@/components/customizeAnswer/customizeAnswer.vue'
// Vue.use('customizeAnswer',customizeAnswer)
2025-08-28 12:00:35 +08:00
Vue.use("tab-bar", tabbar);
2023-12-05 16:45:28 +08:00
2025-08-28 12:00:35 +08:00
Vue.use(uView);
2025-08-28 12:00:35 +08:00
uni.$u.config.unit = "rpx";
Vue.use(cookies);
Vue.config.productionTip = false;
2025-07-29 17:56:31 +08:00
2025-08-28 12:00:35 +08:00
Vue.prototype.$md5 = md5;
2023-12-05 16:45:28 +08:00
2025-08-28 12:00:35 +08:00
App.mpType = "app";
2023-12-05 16:45:28 +08:00
// 在 Vuex 注册后创建 store 实例
const store = createStore();
2023-12-05 16:45:28 +08:00
// #ifdef APP-PLUS
2025-08-28 12:00:35 +08:00
Vue.prototype.$store = store;
2023-12-05 16:45:28 +08:00
// #endif
2025-08-14 11:22:53 +08:00
const app = new Vue({
store,
2025-08-28 12:00:35 +08:00
render: (h) => h(App),
}).$mount("#app");
2025-08-28 12:00:35 +08:00
Vue.use(httpConfig, app);
2024-03-13 10:54:22 +08:00
// Vue.use(httpApi, app)
2023-12-05 16:45:28 +08:00
// #ifdef MP-WEIXIN
2025-08-14 11:22:53 +08:00
Vue.prototype.wxLogin = async function () {
2025-08-28 12:00:35 +08:00
console.log("wxLogin");
2025-08-14 11:22:53 +08:00
return await new Promise(function (reslove, reject) {
2025-08-28 12:00:35 +08:00
let that = this;
2025-08-14 11:22:53 +08:00
uni.login({
success: function (res) {
2025-08-28 12:00:35 +08:00
console.log("main.js==>res", res);
reslove(res.code);
2025-08-14 11:22:53 +08:00
},
2025-08-28 12:00:35 +08:00
});
});
};
2025-08-01 18:33:52 +08:00
2023-11-27 09:57:03 +08:00
// #endif
2024-03-13 10:54:22 +08:00
// app.$mount()
2025-08-07 17:30:36 +08:00
// 注册全局 mixin
2025-08-28 12:00:35 +08:00
Vue.mixin(PageScrollMixin);