main.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. inputType: { default: 'text' }
  57. },
  58. empty: {
  59. icon: { default: '/static/icon-empty.png' },
  60. height: { default: 140 },
  61. width: { default: 140 },
  62. text: { default: '暂无相关数据' }
  63. },
  64. icon: {
  65. customClass: {
  66. default: ''
  67. }
  68. },
  69. popup: {
  70. theme: {
  71. default: 'theme-ie'
  72. }
  73. },
  74. image: {
  75. customClass: {
  76. default: ''
  77. }
  78. },
  79. cell: {
  80. disableHover: {
  81. default: false
  82. }
  83. },
  84. collapseItem: {
  85. padding: {
  86. default: '12px 15px;'
  87. },
  88. data: { default: null },
  89. lazy: { default: false },
  90. load: { default: null }
  91. },
  92. input: {
  93. fontSize: { default: '30rpx' },
  94. disabledColor: { default: 'var(--back-light)' },
  95. customStyle: {
  96. default: () => ({
  97. height: '30px',
  98. paddingLeft: '40rpx',
  99. paddingRight: '40rpx',
  100. borderRadius: '24rpx'
  101. })
  102. }
  103. },
  104. tags: {
  105. customClass: {
  106. default: ''
  107. }
  108. },
  109. button: {
  110. hoverEffect: { default: true }
  111. }
  112. }
  113. })
  114. const { resolvePath } = useImage();
  115. uni.$zp = {
  116. config: {
  117. 'default-page-size': 20,
  118. 'refresher-title-style': {
  119. fontSize: '28rpx'
  120. },
  121. 'loading-more-title-custom-style': {
  122. fontSize: '26rpx'
  123. },
  124. // 底部安全区域以placeholder形式实现
  125. 'use-safe-area-placeholder': true
  126. // 'empty-view-img-style': {
  127. // width: '364rpx',
  128. // height: '252rpx'
  129. // },
  130. // 'empty-view-img': resolvePath('/pagesStudy/static/image/icon-empty.png'),
  131. // 'empty-view-title-style': {
  132. // color: '#B3B3B3',
  133. // fontSize: '30rpx',
  134. // marginTop: '40rpx'
  135. // },
  136. // 'empty-view-style': {
  137. // marginTop: '-200rpx'
  138. // }
  139. }
  140. }
  141. const pinia = Pinia.createPinia();
  142. app.use(pinia);
  143. pinia.use(piniaPluginPersistedstate);
  144. return {
  145. app
  146. }
  147. }
  148. // #endif