74 lines
1.6 KiB
JavaScript
74 lines
1.6 KiB
JavaScript
import Vue from "vue";
|
|
import App from "./App";
|
|
import cookies from "weapp-cookie";
|
|
import uView from "uview-ui";
|
|
import Vuex from "vuex";
|
|
// http接口API集中管理引入部分
|
|
// import httpApi from '@/common/http.api.js'
|
|
import createStore from "./store/index.js";
|
|
import "./uni.scss";
|
|
// 公共样式与字体图标
|
|
import "./common/css/common.css";
|
|
import "./common/css/iconfont.css";
|
|
|
|
import md5 from "js-md5";
|
|
|
|
// 引入公共组件 tabbar
|
|
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";
|
|
|
|
// 必须在导入 store 之前注册 Vuex
|
|
Vue.use(Vuex);
|
|
|
|
// import customizeAnswer from'@/components/customizeAnswer/customizeAnswer.vue'
|
|
// Vue.use('customizeAnswer',customizeAnswer)
|
|
Vue.use("tab-bar", tabbar);
|
|
|
|
Vue.use(uView);
|
|
|
|
uni.$u.config.unit = "rpx";
|
|
Vue.use(cookies);
|
|
Vue.config.productionTip = false;
|
|
|
|
Vue.prototype.$md5 = md5;
|
|
|
|
App.mpType = "app";
|
|
|
|
// 在 Vuex 注册后创建 store 实例
|
|
const store = createStore();
|
|
|
|
// #ifdef APP-PLUS
|
|
Vue.prototype.$store = store;
|
|
// #endif
|
|
|
|
const app = new Vue({
|
|
store,
|
|
render: (h) => h(App),
|
|
}).$mount("#app");
|
|
|
|
Vue.use(httpConfig, app);
|
|
|
|
// Vue.use(httpApi, app)
|
|
// #ifdef MP-WEIXIN
|
|
Vue.prototype.wxLogin = async function () {
|
|
console.log("wxLogin");
|
|
return await new Promise(function (reslove, reject) {
|
|
let that = this;
|
|
uni.login({
|
|
success: function (res) {
|
|
console.log("main.js==>res", res);
|
|
reslove(res.code);
|
|
},
|
|
});
|
|
});
|
|
};
|
|
|
|
// #endif
|
|
|
|
// app.$mount()
|
|
|
|
// 注册全局 mixin
|
|
Vue.mixin(PageScrollMixin);
|