main.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false;
  5. //组件库
  6. import uView from '@/uni_modules/uview-ui'
  7. Vue.use(uView)
  8. //colorui 自定义顶部nav
  9. import cuCustom from './colorui/components/cu-custom.vue'
  10. Vue.component('cu-custom', cuCustom)
  11. import timeHorizon from './components/timeHorizon'
  12. Vue.component('time-horizon', timeHorizon)
  13. import controlItem from "./control/modules/controlItem.vue"
  14. Vue.component('control-item', controlItem)
  15. import My_input from "./control/modules/My_input.vue"
  16. Vue.component('My_input', My_input)
  17. //自定义组件
  18. import My_listbox from './components/My_listbox';
  19. Vue.component('My_listbox', My_listbox);
  20. import My_search from './components/My_search';
  21. Vue.component('My_search', My_search);
  22. //挂载接口
  23. let env = 'dev';
  24. const http = {};
  25. // #ifdef H5
  26. http.baseUrl = env == 'dev' ? "/apis1" : "/apis";
  27. http.socket = env == 'dev' ? "/socket1" : "/socket";
  28. // #endif
  29. // #ifndef H5
  30. http.baseUrl = env == 'dev' ? "http://60.204.153.188" : "https://oms.idcgroup.com.cn:8079";
  31. http.socket = env == 'dev' ? "ws://60.204.153.188" : "wss://oms.idcgroup.com.cn:8079";
  32. // #endif
  33. console.log("接口地址", http)
  34. import {
  35. ApiModel
  36. } from './utils/api'
  37. Vue.prototype.$Http = new ApiModel(http);
  38. import {
  39. Socket
  40. } from './utils/Socket'
  41. Vue.prototype.$Socket = new Socket(http);
  42. App.mpType = 'app'
  43. const app = new Vue({
  44. ...App
  45. })
  46. app.$mount()
  47. // #endif
  48. // #ifdef VUE3
  49. import {
  50. createSSRApp
  51. } from 'vue'
  52. export function createApp() {
  53. const app = createSSRApp(App)
  54. return {
  55. app
  56. }
  57. }
  58. // #endif