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

69 lines
1.4 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
1 month ago
1 month 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. let path = '/pages/index/index'
  32. if(userInfo.id){
  33. path += '?shareId=' + (userInfo.id || '')
  34. }
  35. return {
  36. title: '欢迎体验'+(logoName),
  37. path,
  38. imageUrl: logoImage
  39. }
  40. },
  41. //分享到朋友圈
  42. onShareTimeline() {
  43. const userInfo = uni.getStorageSync('userInfo') || {};
  44. let path = ''
  45. if(userInfo.id){
  46. query = 'shareId=' + (userInfo.id || '')
  47. }
  48. return {
  49. title: '欢迎体验'+(logoName),
  50. query,
  51. imageUrl: logoImage
  52. }
  53. }
  54. });
  55. return {
  56. app
  57. }
  58. }
  59. // #endif