App.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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. /* Tabs组件主题色覆盖 - 全局统一底部方块颜色 */
  129. .u-tabs__wrapper__nav__line {
  130. background-color: #0051d9 !important;
  131. }
  132. .u-tabs .u-tabs__wrapper__nav__line {
  133. background: #0051d9 !important;
  134. }
  135. /* Navbar导航栏主题色覆盖 - 勤工俭学模块统一背景色 */
  136. .u-navbar {
  137. background-color: #0051d9 !important;
  138. }
  139. .u-navbar__content {
  140. background-color: #0051d9 !important;
  141. }
  142. .u-navbar__content__title {
  143. color: #fff !important;
  144. }
  145. /* uni-app 原生导航栏样式覆盖 */
  146. uni-page-head {
  147. background-color: #0051d9 !important;
  148. }
  149. .uni-page-head {
  150. background-color: #0051d9 !important;
  151. }
  152. .uni-page-head__title {
  153. color: #fff !important;
  154. }
  155. /* ========== 全局温暖商务风格样式 ========== */
  156. /* 全局页面背景 */
  157. page {
  158. background-color: #fafafa;
  159. color: #2c2c2c;
  160. }
  161. /* 全局滚动条样式 - 温暖商务风格 */
  162. ::-webkit-scrollbar {
  163. width: 6px;
  164. height: 6px;
  165. }
  166. ::-webkit-scrollbar-track {
  167. background: #f5f5f5;
  168. }
  169. ::-webkit-scrollbar-thumb {
  170. background: #e0e0e0;
  171. border-radius: 3px;
  172. }
  173. ::-webkit-scrollbar-thumb:hover {
  174. background: #bdbdbd;
  175. }
  176. /* 全局链接样式 - 温暖商务风格 */
  177. .link {
  178. color: #0051d9;
  179. text-decoration: none;
  180. }
  181. .link:hover {
  182. color: #1976d2;
  183. }
  184. /* 全局按钮重置 - 应用温暖商务渐变 */
  185. .btn-primary {
  186. background: linear-gradient(135deg, #0051d9 0%, #1565c0 100%);
  187. border: none;
  188. color: white;
  189. }
  190. .btn-secondary {
  191. background: linear-gradient(135deg, #5d4037 0%, #8d6e63 100%);
  192. border: none;
  193. color: white;
  194. }
  195. .btn-accent {
  196. background: linear-gradient(135deg, #ff6f00 0%, #ffb74d 100%);
  197. border: none;
  198. color: white;
  199. }
  200. /* 全局卡片样式 - 温暖商务风格 */
  201. .card {
  202. background: #fafafa;
  203. border: 1px solid #e0e0e0;
  204. box-shadow: 0 2px 12px rgba(45, 45, 45, 0.1);
  205. }
  206. /* 全局分割线 - 温暖商务风格 */
  207. .divider {
  208. border-color: #e0e0e0;
  209. }
  210. /* 全局文本样式 - 温暖商务风格 */
  211. .text-primary {
  212. color: #0051d9 !important;
  213. }
  214. .text-success {
  215. color: #388e3c !important;
  216. }
  217. .text-warning {
  218. color: #f57c00 !important;
  219. }
  220. .text-error {
  221. color: #d32f2f !important;
  222. }
  223. .text-info {
  224. color: #1976d2 !important;
  225. }
  226. .text-secondary {
  227. color: #5d4037 !important;
  228. }
  229. .text-accent {
  230. color: #ff6f00 !important;
  231. }
  232. .text-main {
  233. color: #2c2c2c !important;
  234. }
  235. .text-content {
  236. color: #616161 !important;
  237. }
  238. .text-tips {
  239. color: #757575 !important;
  240. }
  241. .text-light {
  242. color: #9e9e9e !important;
  243. }
  244. /* 全局样式 - 温暖商务风格 */
  245. /*每个页面公共css */
  246. /* 温暖商务风格全局样式 */
  247. .warm-gradient-primary {
  248. background: linear-gradient(135deg, #0051d9 0%, #1565c0 100%);
  249. }
  250. .warm-gradient-secondary {
  251. background: linear-gradient(135deg, #5d4037 0%, #8d6e63 100%);
  252. }
  253. .warm-gradient-accent {
  254. background: linear-gradient(135deg, #ff6f00 0%, #ffb74d 100%);
  255. }
  256. /* 温暖商务文字颜色工具类 */
  257. .text-primary {
  258. color: #0051d9;
  259. }
  260. .text-secondary {
  261. color: #5d4037;
  262. }
  263. .text-accent {
  264. color: #ff6f00;
  265. }
  266. .text-success {
  267. color: #388e3c;
  268. }
  269. .text-warning {
  270. color: #f57c00;
  271. }
  272. .text-error {
  273. color: #d32f2f;
  274. }
  275. .text-info {
  276. color: #1976d2;
  277. }
  278. .text-warm-gold {
  279. color: #ffc107;
  280. }
  281. .text-warm-green {
  282. color: #689f38;
  283. }
  284. /* 温暖商务背景颜色工具类 */
  285. .bg-primary {
  286. background-color: #0051d9;
  287. }
  288. .bg-secondary {
  289. background-color: #5d4037;
  290. }
  291. .bg-accent {
  292. background-color: #ff6f00;
  293. }
  294. .bg-success {
  295. background-color: #388e3c;
  296. }
  297. .bg-warning {
  298. background-color: #f57c00;
  299. }
  300. .bg-error {
  301. background-color: #d32f2f;
  302. }
  303. .bg-info {
  304. background-color: #1976d2;
  305. }
  306. .bg-warm-gold {
  307. background-color: #ffc107;
  308. }
  309. .bg-warm-green {
  310. background-color: #689f38;
  311. }
  312. .u-toolbar__wrapper__confirm {
  313. color: #0051d9 !important;
  314. }
  315. .u-button--plain.u-button--primary {
  316. color: #ffffff !important;
  317. }
  318. .u-button--plain.u-button--error {
  319. color: #ffffff !important;
  320. }
  321. .u-button--plain.u-button--info {
  322. color: #3e3b3b !important;
  323. }
  324. .u-button--plain.u-button--warning {
  325. color: #ffffff !important;
  326. }
  327. .u-button--plain.u-button--success {
  328. color: #ffffff !important;
  329. }
  330. </style>