时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. import Vue from 'vue'
  2. import App from './App'
  3. import mixin from '@/common/mixin.js';
  4. import * as API from '@/common/api.js';
  5. import * as $shared from '@/common/shared.js';
  6. import { uploadFile } from '@/common/uploadFile.js'
  7. Vue.config.productionTip = false
  8. App.mpType = 'app'
  9. Vue.mixin(mixin);
  10. // 将API注入全局
  11. Vue.prototype.API = API;
  12. // 全局共享方法
  13. Vue.prototype.$shared = $shared;
  14. Vue.prototype.uploadFile = uploadFile
  15. // 引入全局uView
  16. import uView from 'uview-ui'
  17. Vue.use(uView);
  18. import { $http } from '@/common/http.js';
  19. Vue.prototype.$http = $http;
  20. // 价格组件
  21. import lfPrice from './components/lf-price/lf-price.vue';
  22. Vue.component('lf-price', lfPrice);
  23. //骨架屏
  24. import Skeleton from './components/my-uni-skeleton/index.vue'
  25. Vue.component('skeleton', Skeleton);
  26. // 无数据
  27. import myNocontent from './components/my-nocontent/my-nocontent.vue';
  28. Vue.component('my-nocontent', myNocontent);
  29. Vue.prototype.$toast=msg=>{
  30. uni.showToast({
  31. icon:'none',
  32. title:msg
  33. })
  34. }
  35. //路由跳转
  36. Vue.prototype.$routerGo = (obj) => {
  37. uni.navigateTo({
  38. url: obj
  39. })
  40. }
  41. const app = new Vue({
  42. ...App
  43. })
  44. // 引入http拦截器
  45. import httpInterceptor from '@/common/http.interceptor.js'
  46. Vue.use(httpInterceptor, app);
  47. app.$mount();