App.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <script lang="ts">
  2. import Vue from 'vue';
  3. // uni-app 应用配置接口
  4. interface AppConfig {
  5. mpType: string;
  6. onLaunch(): void;
  7. onShow(): void;
  8. onHide(): void;
  9. }
  10. export default Vue.extend({
  11. mpType: 'app',
  12. onLaunch() {
  13. console.log('App Launch');
  14. },
  15. onShow() {
  16. console.log('App Show');
  17. },
  18. onHide() {
  19. console.log('App Hide');
  20. },
  21. } as AppConfig);
  22. </script>
  23. <style lang="scss">
  24. /*每个页面公共css */
  25. /* 注意:必须首先导入自定义主题变量,然后再导入 uview-ui 的样式 */
  26. /* 先导入自定义主题变量 - 温暖商务风格 */
  27. @import '@/common/uview-theme.scss';
  28. /* 然后导入 uview-ui 的样式 */
  29. @import 'uview-ui/index.scss';
  30. /* 引入自定义图标系统 - 暂时禁用,使用uview-ui内置图标 */
  31. @import '@/static/fonts/iconfont.css';
  32. /* 修复uni-app和uview-ui兼容性问题 */
  33. page {
  34. height: 100%;
  35. }
  36. /* 全局字体设置 */
  37. .app {
  38. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
  39. 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
  40. 'Segoe UI Emoji', 'Segoe UI Symbol';
  41. }
  42. /* 修复uview-ui组件默认样式问题 */
  43. .u-border-top,
  44. .u-border-bottom,
  45. .u-border-left,
  46. .u-border-right,
  47. .u-border {
  48. position: relative;
  49. }
  50. .u-border-top::after,
  51. .u-border-bottom::after,
  52. .u-border-left::after,
  53. .u-border-right::after,
  54. .u-border::after {
  55. content: ' ';
  56. position: absolute;
  57. left: 0;
  58. top: 0;
  59. right: 0;
  60. height: 1px;
  61. border-top: 1px solid #dadbde;
  62. color: #dadbde;
  63. transform-origin: 0 0;
  64. transform: scaleY(0.5);
  65. }
  66. /* 修复微信小程序兼容性 */
  67. .u-safe-area-inset-bottom {
  68. padding-bottom: 0;
  69. padding-bottom: constant(safe-area-inset-bottom);
  70. padding-bottom: env(safe-area-inset-bottom);
  71. }
  72. /* uview-ui 按钮组件的图标修复 */
  73. .u-icon {
  74. display: flex;
  75. align-items: center;
  76. justify-content: center;
  77. }
  78. /* 确保图标字体正确加载 */
  79. .u-iconfont {
  80. font-family: 'uview-iconfont' !important;
  81. font-size: inherit;
  82. font-style: normal;
  83. color: #909399 !important;
  84. }
  85. /* 强制覆盖 uview-ui 的主题色 */
  86. /* 按钮主题色覆盖 */
  87. .u-button--primary {
  88. background-color: #0051d9 !important;
  89. border-color: #0051d9 !important;
  90. }
  91. .u-button--success {
  92. background-color: #388e3c !important;
  93. border-color: #388e3c !important;
  94. }
  95. .u-button--warning {
  96. background-color: #f57c00 !important;
  97. border-color: #f57c00 !important;
  98. }
  99. .u-button--error {
  100. background-color: #d32f2f !important;
  101. border-color: #d32f2f !important;
  102. }
  103. // .u-button--info {
  104. // background-color: #007dfb !important;
  105. // border-color: #007dfb !important;
  106. // }
  107. /* 标签主题色覆盖 */
  108. .u-tag--primary {
  109. background-color: #0051d9 !important;
  110. border-color: #0051d9 !important;
  111. }
  112. .u-tag--success {
  113. background-color: #388e3c !important;
  114. border-color: #388e3c !important;
  115. }
  116. .u-tag--warning {
  117. background-color: #f57c00 !important;
  118. border-color: #f57c00 !important;
  119. }
  120. .u-tag--error {
  121. background-color: #d32f2f !important;
  122. border-color: #d32f2f !important;
  123. }
  124. .u-tag--info {
  125. background-color: #007dfb !important;
  126. border-color: #007dfb !important;
  127. }
  128. /* ========== 全局温暖商务风格样式 ========== */
  129. /* 全局页面背景 */
  130. page {
  131. background-color: #fafafa;
  132. color: #2c2c2c;
  133. }
  134. /* 全局滚动条样式 - 温暖商务风格 */
  135. ::-webkit-scrollbar {
  136. width: 6px;
  137. height: 6px;
  138. }
  139. ::-webkit-scrollbar-track {
  140. background: #f5f5f5;
  141. }
  142. ::-webkit-scrollbar-thumb {
  143. background: #e0e0e0;
  144. border-radius: 3px;
  145. }
  146. ::-webkit-scrollbar-thumb:hover {
  147. background: #bdbdbd;
  148. }
  149. /* 全局链接样式 - 温暖商务风格 */
  150. .link {
  151. color: #0051d9;
  152. text-decoration: none;
  153. }
  154. .link:hover {
  155. color: #1976d2;
  156. }
  157. /* 全局按钮重置 - 应用温暖商务渐变 */
  158. .btn-primary {
  159. background: linear-gradient(135deg, #0051d9 0%, #1565c0 100%);
  160. border: none;
  161. color: white;
  162. }
  163. .btn-secondary {
  164. background: linear-gradient(135deg, #5d4037 0%, #8d6e63 100%);
  165. border: none;
  166. color: white;
  167. }
  168. .btn-accent {
  169. background: linear-gradient(135deg, #ff6f00 0%, #ffb74d 100%);
  170. border: none;
  171. color: white;
  172. }
  173. /* 全局卡片样式 - 温暖商务风格 */
  174. .card {
  175. background: #fafafa;
  176. border: 1px solid #e0e0e0;
  177. box-shadow: 0 2px 12px rgba(45, 45, 45, 0.1);
  178. }
  179. /* 全局分割线 - 温暖商务风格 */
  180. .divider {
  181. border-color: #e0e0e0;
  182. }
  183. /* 全局文本样式 - 温暖商务风格 */
  184. .text-primary {
  185. color: #0051d9 !important;
  186. }
  187. .text-success {
  188. color: #388e3c !important;
  189. }
  190. .text-warning {
  191. color: #f57c00 !important;
  192. }
  193. .text-error {
  194. color: #d32f2f !important;
  195. }
  196. .text-info {
  197. color: #1976d2 !important;
  198. }
  199. .text-secondary {
  200. color: #5d4037 !important;
  201. }
  202. .text-accent {
  203. color: #ff6f00 !important;
  204. }
  205. .text-main {
  206. color: #2c2c2c !important;
  207. }
  208. .text-content {
  209. color: #616161 !important;
  210. }
  211. .text-tips {
  212. color: #757575 !important;
  213. }
  214. .text-light {
  215. color: #9e9e9e !important;
  216. }
  217. /* 全局样式 - 温暖商务风格 */
  218. /*每个页面公共css */
  219. /* 温暖商务风格全局样式 */
  220. .warm-gradient-primary {
  221. background: linear-gradient(135deg, #0051d9 0%, #1565c0 100%);
  222. }
  223. .warm-gradient-secondary {
  224. background: linear-gradient(135deg, #5d4037 0%, #8d6e63 100%);
  225. }
  226. .warm-gradient-accent {
  227. background: linear-gradient(135deg, #ff6f00 0%, #ffb74d 100%);
  228. }
  229. /* 温暖商务文字颜色工具类 */
  230. .text-primary {
  231. color: #0051d9;
  232. }
  233. .text-secondary {
  234. color: #5d4037;
  235. }
  236. .text-accent {
  237. color: #ff6f00;
  238. }
  239. .text-success {
  240. color: #388e3c;
  241. }
  242. .text-warning {
  243. color: #f57c00;
  244. }
  245. .text-error {
  246. color: #d32f2f;
  247. }
  248. .text-info {
  249. color: #1976d2;
  250. }
  251. .text-warm-gold {
  252. color: #ffc107;
  253. }
  254. .text-warm-green {
  255. color: #689f38;
  256. }
  257. /* 温暖商务背景颜色工具类 */
  258. .bg-primary {
  259. background-color: #0051d9;
  260. }
  261. .bg-secondary {
  262. background-color: #5d4037;
  263. }
  264. .bg-accent {
  265. background-color: #ff6f00;
  266. }
  267. .bg-success {
  268. background-color: #388e3c;
  269. }
  270. .bg-warning {
  271. background-color: #f57c00;
  272. }
  273. .bg-error {
  274. background-color: #d32f2f;
  275. }
  276. .bg-info {
  277. background-color: #1976d2;
  278. }
  279. .bg-warm-gold {
  280. background-color: #ffc107;
  281. }
  282. .bg-warm-green {
  283. background-color: #689f38;
  284. }
  285. .u-toolbar__wrapper__confirm {
  286. color: #0051d9 !important;
  287. }
  288. .u-button--plain.u-button--primary {
  289. color: #ffffff !important;
  290. }
  291. .u-button--plain.u-button--error {
  292. color: #ffffff !important;
  293. }
  294. .u-button--plain.u-button--info {
  295. color: #3e3b3b !important;
  296. }
  297. .u-button--plain.u-button--warning {
  298. color: #ffffff !important;
  299. }
  300. .u-button--plain.u-button--success {
  301. color: #ffffff !important;
  302. }
  303. </style>