smartmeter-app/main.js

61 lines
1.2 KiB
JavaScript
Raw Normal View History

2023-12-05 16:45:28 +08:00
import Vue from 'vue'
2023-11-27 09:57:03 +08:00
import App from './App'
2023-12-05 16:45:28 +08:00
import cookies from 'weapp-cookie'
import uView from "uview-ui";
import httpInterceptor from '@/common/http.interceptor.js'
// http接口API集中管理引入部分
import httpApi from '@/common/http.api.js'
import store from "./store/index.js"
import './uni.scss';
// 公共样式与字体图标
import './common/css/common.css'
import'./common/css/iconfont.css'
2023-11-27 09:57:03 +08:00
2023-12-05 16:45:28 +08:00
import md5 from 'js-md5'
// 引入公共组件 tabbar
2024-01-23 19:15:52 +08:00
import tabbar from '@/components/tab-bar/tab-bar.vue';
2023-12-05 16:45:28 +08:00
// import customizeAnswer from'@/components/customizeAnswer/customizeAnswer.vue'
// Vue.use('customizeAnswer',customizeAnswer)
2024-01-23 19:15:52 +08:00
Vue.use('tab-bar',tabbar)
2023-12-05 16:45:28 +08:00
Vue.use(uView);
Vue.use(cookies);
Vue.config.productionTip = false
Vue.prototype.$md5 = md5;
2023-11-27 09:57:03 +08:00
App.mpType = 'app'
2023-12-05 16:45:28 +08:00
// #ifdef APP-PLUS
Vue.prototype.$store = store
// #endif
2023-11-27 09:57:03 +08:00
const app = new Vue({
2023-12-05 16:45:28 +08:00
store,
...App
2023-11-27 09:57:03 +08:00
})
2023-12-05 16:45:28 +08:00
Vue.use(httpInterceptor, 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)
}
});
})
}
2023-11-27 09:57:03 +08:00
// #endif
2023-12-05 16:45:28 +08:00
app.$mount()