├── php-api/ # 改造后的PHP接口层 ├── java-ad-service/ # 若依框架微服务(广告+VIP+分账) ├── uniapp-reader/ # UniApp前端项目 │ ├── pages/ # 各端页面 │ └──
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="theme-picker">
  3. <view class="current-theme" @click="showSelector = !showSelector">
  4. <text>{{ themeStore.getThemeLabel(themeStore.currentTheme) }}</text>
  5. <uni-icons :type="showSelector ? 'arrowup' : 'arrowdown'" size="16"></uni-icons>
  6. </view>
  7. <view v-if="showSelector" class="theme-selector">
  8. <view
  9. v-for="theme in themeStore.themeOptions"
  10. :key="theme.name"
  11. class="theme-item"
  12. :class="{ active: theme.name === themeStore.currentTheme }"
  13. @click="changeTheme(theme.name)"
  14. >
  15. <view class="color-preview">
  16. <view
  17. v-for="(color, key) in theme.colors"
  18. v-if="key.includes('color')"
  19. :key="key"
  20. class="color-block"
  21. :style="{ backgroundColor: color }"
  22. ></view>
  23. </view>
  24. <text class="theme-label">{{ theme.label }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import { ref } from 'vue'
  31. import { useThemeStore } from '@/stores/theme'
  32. const themeStore = useThemeStore()
  33. const showSelector = ref(false)
  34. // 切换主题
  35. const changeTheme = (themeName) => {
  36. themeStore.setTheme(themeName)
  37. showSelector.value = false
  38. }
  39. </script>
  40. <style scoped>
  41. .theme-picker {
  42. position: relative;
  43. z-index: 100;
  44. }
  45. .current-theme {
  46. display: flex;
  47. align-items: center;
  48. padding: 8px 12px;
  49. background-color: var(--card-bg);
  50. border-radius: 20px;
  51. font-size: 14px;
  52. cursor: pointer;
  53. }
  54. .theme-selector {
  55. position: absolute;
  56. top: 40px;
  57. right: 0;
  58. width: 180px;
  59. background-color: var(--card-bg);
  60. border-radius: 12px;
  61. box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  62. padding: 10px;
  63. z-index: 200;
  64. }
  65. .theme-item {
  66. padding: 10px;
  67. border-radius: 8px;
  68. margin-bottom: 8px;
  69. cursor: pointer;
  70. transition: all 0.3s;
  71. }
  72. .theme-item.active {
  73. background-color: rgba(42, 92, 170, 0.1);
  74. }
  75. .theme-item:hover {
  76. background-color: rgba(0,0,0,0.05);
  77. }
  78. .color-preview {
  79. display: flex;
  80. height: 20px;
  81. border-radius: 4px;
  82. overflow: hidden;
  83. margin-bottom: 6px;
  84. }
  85. .color-block {
  86. flex: 1;
  87. height: 100%;
  88. }
  89. .theme-label {
  90. font-size: 13px;
  91. text-align: center;
  92. display: block;
  93. }
  94. </style>