smartmeter-app/main.js

62 lines
1.3 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'
2024-08-31 18:01:17 +08:00
import cookies from 'weapp-cookie'
2023-12-05 16:45:28 +08:00
import uView from "uview-ui";
2024-03-13 10:54:22 +08:00
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'
2023-12-05 16:45:28 +08:00
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
2024-04-27 17:20:50 +08:00
// import md5 from 'js-md5'
2023-12-05 16:45:28 +08:00
// 引入公共组件 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);
2024-08-31 18:01:17 +08:00
Vue.use(cookies);
2023-12-05 16:45:28 +08:00
Vue.config.productionTip = false
2024-04-27 17:20:50 +08:00
// Vue.prototype.$md5 = md5;
2023-12-05 16:45:28 +08:00
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
2024-03-13 10:54:22 +08:00
const app = new Vue({
store,
render: h => h(App),
}).$mount('#app');
import httpInterceptor from '@/common/http.interceptor.js'
2023-12-05 16:45:28 +08:00
Vue.use(httpInterceptor, app)
2024-03-13 10:54:22 +08:00
// Vue.use(httpApi, app)
2023-12-05 16:45:28 +08:00
// #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
2024-03-13 10:54:22 +08:00
// app.$mount()