Showing
5 changed files
with
24 additions
and
10 deletions
| ... | @@ -33,7 +33,7 @@ import vConsole from "@/utils/vconsole"; | ... | @@ -33,7 +33,7 @@ import vConsole from "@/utils/vconsole"; |
| 33 | // import { wxJsAPI } from '@/api/wx/config' | 33 | // import { wxJsAPI } from '@/api/wx/config' |
| 34 | // import { apiList } from '@/api/wx/jsApiList.js' | 34 | // import { apiList } from '@/api/wx/jsApiList.js' |
| 35 | import { wxInfo } from "@/utils/tools"; | 35 | import { wxInfo } from "@/utils/tools"; |
| 36 | - | 36 | +import { styleColor } from "@/constant.js"; |
| 37 | // 使用 include + pinia 状态管理动态缓存页面 | 37 | // 使用 include + pinia 状态管理动态缓存页面 |
| 38 | const store = mainStore(); | 38 | const store = mainStore(); |
| 39 | const keepPages = computed(() => store.getKeepPages); | 39 | const keepPages = computed(() => store.getKeepPages); |
| ... | @@ -75,7 +75,9 @@ onMounted(async () => { | ... | @@ -75,7 +75,9 @@ onMounted(async () => { |
| 75 | // console.warn(err); | 75 | // console.warn(err); |
| 76 | // }); | 76 | // }); |
| 77 | // TAG: 全局背景色 | 77 | // TAG: 全局背景色 |
| 78 | - document.querySelector("body").setAttribute("style", "background-color:#fff9ef"); | 78 | + document |
| 79 | + .querySelector("body") | ||
| 80 | + .setAttribute("style", `background-color: ${styleColor.backgroundColor}`); | ||
| 79 | }); | 81 | }); |
| 80 | </script> | 82 | </script> |
| 81 | 83 | ... | ... |
| ... | @@ -28,6 +28,7 @@ | ... | @@ -28,6 +28,7 @@ |
| 28 | :name="x" | 28 | :name="x" |
| 29 | icon-size="1rem" | 29 | icon-size="1rem" |
| 30 | shape="square" | 30 | shape="square" |
| 31 | + :checked-color="themeVars.radioColor" | ||
| 31 | style="margin-bottom: 0.25rem" | 32 | style="margin-bottom: 0.25rem" |
| 32 | >{{ x }}</van-checkbox | 33 | >{{ x }}</van-checkbox |
| 33 | > | 34 | > |
| ... | @@ -38,10 +39,15 @@ | ... | @@ -38,10 +39,15 @@ |
| 38 | </template> | 39 | </template> |
| 39 | 40 | ||
| 40 | <script setup> | 41 | <script setup> |
| 42 | +import { styleColor } from "@/constant.js"; | ||
| 43 | + | ||
| 41 | const props = defineProps({ | 44 | const props = defineProps({ |
| 42 | item: Object, | 45 | item: Object, |
| 43 | }); | 46 | }); |
| 44 | - | 47 | +// TAG: 自定义主题颜色 |
| 48 | +const themeVars = { | ||
| 49 | + radioColor: styleColor.baseColor, | ||
| 50 | +}; | ||
| 45 | onMounted(() => { | 51 | onMounted(() => { |
| 46 | // 默认值为数组 | 52 | // 默认值为数组 |
| 47 | props.item.value = []; | 53 | props.item.value = []; | ... | ... |
| ... | @@ -23,6 +23,7 @@ | ... | @@ -23,6 +23,7 @@ |
| 23 | :key="index" | 23 | :key="index" |
| 24 | :name="x" | 24 | :name="x" |
| 25 | icon-size="1rem" | 25 | icon-size="1rem" |
| 26 | + :checked-color="themeVars.radioColor" | ||
| 26 | style="margin-bottom: 0.25rem" | 27 | style="margin-bottom: 0.25rem" |
| 27 | >{{ x }}</van-radio | 28 | >{{ x }}</van-radio |
| 28 | > | 29 | > |
| ... | @@ -33,9 +34,16 @@ | ... | @@ -33,9 +34,16 @@ |
| 33 | </template> | 34 | </template> |
| 34 | 35 | ||
| 35 | <script setup> | 36 | <script setup> |
| 37 | +import { styleColor } from "@/constant.js"; | ||
| 38 | + | ||
| 36 | const props = defineProps({ | 39 | const props = defineProps({ |
| 37 | item: Object, | 40 | item: Object, |
| 38 | }); | 41 | }); |
| 42 | + | ||
| 43 | +// TAG: 自定义主题颜色 | ||
| 44 | +const themeVars = { | ||
| 45 | + radioColor: styleColor.baseColor, | ||
| 46 | +}; | ||
| 39 | </script> | 47 | </script> |
| 40 | 48 | ||
| 41 | <style lang="less" scoped> | 49 | <style lang="less" scoped> | ... | ... |
| ... | @@ -7,9 +7,6 @@ | ... | @@ -7,9 +7,6 @@ |
| 7 | */ | 7 | */ |
| 8 | // 颜色变量 | 8 | // 颜色变量 |
| 9 | export const styleColor = { | 9 | export const styleColor = { |
| 10 | - baseColor: '#8F652E', | 10 | + baseColor: '#C2915F', |
| 11 | - baseFontColor: '#333333', | 11 | + backgroundColor: '#FFF9EF', |
| 12 | - subFontColor: '#999999', | ||
| 13 | - subColor: '#2B000C', | ||
| 14 | - affixColor: '#999999', | ||
| 15 | } | 12 | } | ... | ... |
| ... | @@ -52,6 +52,7 @@ import { queryFormAPI } from "@/api/form.js"; | ... | @@ -52,6 +52,7 @@ import { queryFormAPI } from "@/api/form.js"; |
| 52 | import { addFormDataAPI } from "@/api/data.js"; | 52 | import { addFormDataAPI } from "@/api/data.js"; |
| 53 | import { showSuccessToast, showFailToast } from "vant"; | 53 | import { showSuccessToast, showFailToast } from "vant"; |
| 54 | import { wxInfo } from "@/utils/tools"; | 54 | import { wxInfo } from "@/utils/tools"; |
| 55 | +import { styleColor } from "@/constant.js"; | ||
| 55 | // web端判断封面图片高度 | 56 | // web端判断封面图片高度 |
| 56 | const is_pc = computed(() => wxInfo().isPC); | 57 | const is_pc = computed(() => wxInfo().isPC); |
| 57 | const PHeaderHeight = computed(() => { | 58 | const PHeaderHeight = computed(() => { |
| ... | @@ -63,8 +64,8 @@ const PHeaderHeight = computed(() => { | ... | @@ -63,8 +64,8 @@ const PHeaderHeight = computed(() => { |
| 63 | }); | 64 | }); |
| 64 | // TAG: 自定义主题颜色 | 65 | // TAG: 自定义主题颜色 |
| 65 | const themeVars = { | 66 | const themeVars = { |
| 66 | - buttonPrimaryBackground: "#c2915f", | 67 | + buttonPrimaryBackground: styleColor.baseColor, |
| 67 | - buttonPrimaryBorderColor: "#c2915f", | 68 | + buttonPrimaryBorderColor: styleColor.baseColor, |
| 68 | }; | 69 | }; |
| 69 | 70 | ||
| 70 | const $route = useRoute(); | 71 | const $route = useRoute(); | ... | ... |
-
Please register or login to post a comment