爱简收旧衣按件回收前端代码仓库
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.

55 lines
1.3 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 weeks ago
3 weeks ago
3 weeks ago
2 months ago
2 months ago
  1. import App from './App'
  2. // import store from './store'
  3. import uView from './uni_modules/vk-uview-ui';
  4. import api from '@/api/api.js';
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. import './uni.promisify.adaptor'
  8. Vue.config.productionTip = false
  9. App.mpType = 'app'
  10. const app = new Vue({
  11. ...App
  12. })
  13. app.$mount()
  14. // #endif
  15. // #ifdef VUE3
  16. import { createSSRApp } from 'vue';
  17. import setupGlobalProperties from './utils/index.js';
  18. export function createApp() {
  19. const app = createSSRApp(App)
  20. // 挂载全局属性和方法
  21. setupGlobalProperties(app);
  22. app.config.globalProperties.$api = api;
  23. app.use(uView);
  24. // 全局混入分享
  25. app.mixin({
  26. //分享给好友
  27. onShareAppMessage() {
  28. const userInfo = uni.getStorageSync('userInfo') || {};
  29. const logoName = uni.getStorageSync('logoName') || ''
  30. const logoImage = uni.getStorageSync('logoImage') || ''
  31. return {
  32. title: '欢迎体验'+(logoName),
  33. path: '/pages/component/home?shareId=' + (userInfo.shareId || ''),
  34. imageUrl: logoImage
  35. }
  36. },
  37. //分享到朋友圈
  38. onShareTimeline() {
  39. const userInfo = uni.getStorageSync('userInfo') || {};
  40. return {
  41. title: '欢迎体验'+(logoName),
  42. query: 'shareId=' + (userInfo.shareId || ''),
  43. imageUrl: logoImage
  44. }
  45. }
  46. });
  47. return {
  48. app
  49. }
  50. }
  51. // #endif