main.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // #ifndef VUE3
  2. import Vue from 'vue'
  3. import App from './App'
  4. import navBar from '@/components/navBar/index.vue'
  5. // import shareAppMessage from './core/shareAppMessage.js';
  6. // Vue.prototype.$shareAppMessage = shareAppMessage; //分享
  7. Vue.component('navBar', navBar)
  8. import popup from '@/components/popup/index.vue'
  9. Vue.component('dpopup', popup)
  10. import uView from '@/uni_modules/uview-ui'
  11. Vue.use(uView)
  12. import store from 'store/index.js'
  13. Vue.prototype.$store = store
  14. Vue.prototype.$appId = 'wx98ab2939999e13de'
  15. Vue.prototype.$shareType = 1
  16. import uploadUrl from '@/common/config.js'
  17. Vue.prototype.$picUrl = uploadUrl.picUrl
  18. Vue.prototype.$picBase = uploadUrl.picBase
  19. Vue.prototype.$getCutDown = () => {
  20. if (uni.getStorageSync('switchs')[0]) {
  21. return 1
  22. } else if (uni.getStorageSync('switchs')[1]) {
  23. return uni.getStorageSync('priceConfig').member_price
  24. } else if (uni.getStorageSync('switchs')[2]) {
  25. return uni.getStorageSync('priceConfig').vip_price
  26. }
  27. }
  28. // 常见功能函数封装
  29. Vue.prototype.$toast = (title, icon = "none", duration = 1500) => {
  30. uni.showToast({
  31. title,
  32. icon,
  33. duration
  34. })
  35. }
  36. // 引入请求封装
  37. require('./utils/request/index')(app)
  38. Vue.config.productionTip = false
  39. App.mpType = 'app'
  40. const app = new Vue({
  41. ...App
  42. })
  43. app.$mount()
  44. // #endif
  45. // #ifdef VUE3
  46. import {
  47. createSSRApp
  48. } from 'vue'
  49. import App from './App.vue'
  50. export function createApp() {
  51. const app = createSSRApp(App)
  52. return {
  53. app
  54. }
  55. }
  56. // #endif