main.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // @ts-nocheck
  2. import App from './App'
  3. import uvUiTools from "@/uni_modules/uv-ui-tools";
  4. // #ifdef H5
  5. import "@/uni.webview.1.5.6"
  6. import './common/webview.bridge'
  7. import './preload'
  8. // #endif
  9. import tool from '@/utils/uni-tool'
  10. import * as Pinia from 'pinia';
  11. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
  12. import { useImage } from '@/hooks/useImage';
  13. // #ifndef VUE3
  14. import Vue from 'vue'
  15. import './uni.promisify.adaptor'
  16. Vue.config.productionTip = false
  17. Vue.use(uvUiTools)
  18. App.mpType = 'app'
  19. const app = new Vue({
  20. ...App
  21. })
  22. app.$mount()
  23. // #endif
  24. // #ifdef VUE3
  25. import { createSSRApp } from 'vue'
  26. import "./static/style/tailwind.scss";
  27. export function createApp() {
  28. const app = createSSRApp(App)
  29. app.use(uvUiTools)
  30. uni.$ie = tool;
  31. uni.$uv.setConfig({
  32. props: {
  33. loadingPage: {
  34. loadingText: { default: '' },
  35. image: { default: '/static/logo/loading1.gif' },
  36. class: { default: 'mx-loading-page' }
  37. },
  38. navbar: {
  39. placeholder: { default: true },
  40. clickHover: { default: true },
  41. statusBarHeight: { default: 0 }
  42. },
  43. statusBar: {
  44. statusBarHeight: { default: 0 }
  45. },
  46. tabs: {
  47. activeStyle: { default: () => ({ color: 'var(--primary-color)' }) },
  48. animationEnabled: { default: true } // 滚动时是否带有动画
  49. },
  50. steps: {
  51. activeColor: { default: 'var(--primary-color)' }
  52. },
  53. search: {
  54. color: { default: 'var(--main-color)' },
  55. actionStyle: { default: () => ({ color: 'var(--primary-color)' }) }
  56. },
  57. empty: {
  58. icon: { default: '/static/icon-empty.png' },
  59. height: { default: 140 },
  60. width: { default: 140 },
  61. text: { default: '暂无相关数据' }
  62. },
  63. icon: {
  64. customClass: {
  65. default: ''
  66. }
  67. },
  68. popup: {
  69. theme: {
  70. default: 'theme-ie'
  71. }
  72. },
  73. image: {
  74. customClass: {
  75. default: ''
  76. }
  77. },
  78. cell: {
  79. disableHover: {
  80. default: false
  81. }
  82. },
  83. collapseItem: {
  84. padding: {
  85. default: '12px 15px;'
  86. },
  87. data: { default: null },
  88. lazy: { default: false },
  89. load: { default: null }
  90. },
  91. input: {
  92. fontSize: { default: '30rpx' },
  93. disabledColor: { default: 'var(--back-light)' },
  94. customStyle: {
  95. default: () => ({
  96. height: '30px',
  97. paddingLeft: '40rpx',
  98. paddingRight: '40rpx',
  99. borderRadius: '24rpx'
  100. })
  101. }
  102. },
  103. tags: {
  104. customClass: {
  105. default: ''
  106. }
  107. }
  108. }
  109. })
  110. const { resolvePath } = useImage();
  111. uni.$zp = {
  112. config: {
  113. 'default-page-size': 20,
  114. 'refresher-title-style': {
  115. fontSize: '28rpx'
  116. },
  117. 'loading-more-title-custom-style': {
  118. fontSize: '26rpx'
  119. },
  120. // 底部安全区域以placeholder形式实现
  121. 'use-safe-area-placeholder': true
  122. // 'empty-view-img-style': {
  123. // width: '364rpx',
  124. // height: '252rpx'
  125. // },
  126. // 'empty-view-img': resolvePath('/pagesStudy/static/image/icon-empty.png'),
  127. // 'empty-view-title-style': {
  128. // color: '#B3B3B3',
  129. // fontSize: '30rpx',
  130. // marginTop: '40rpx'
  131. // },
  132. // 'empty-view-style': {
  133. // marginTop: '-200rpx'
  134. // }
  135. }
  136. }
  137. const pinia = Pinia.createPinia();
  138. app.use(pinia);
  139. pinia.use(piniaPluginPersistedstate);
  140. return {
  141. app
  142. }
  143. }
  144. // #endif