hookehuyr

主题色变量配置调整优化

......@@ -33,7 +33,7 @@ import vConsole from "@/utils/vconsole";
// import { wxJsAPI } from '@/api/wx/config'
// import { apiList } from '@/api/wx/jsApiList.js'
import { wxInfo } from "@/utils/tools";
import { styleColor } from "@/constant.js";
// 使用 include + pinia 状态管理动态缓存页面
const store = mainStore();
const keepPages = computed(() => store.getKeepPages);
......@@ -75,7 +75,9 @@ onMounted(async () => {
// console.warn(err);
// });
// TAG: 全局背景色
document.querySelector("body").setAttribute("style", "background-color:#fff9ef");
document
.querySelector("body")
.setAttribute("style", `background-color: ${styleColor.backgroundColor}`);
});
</script>
......
......@@ -28,6 +28,7 @@
:name="x"
icon-size="1rem"
shape="square"
:checked-color="themeVars.radioColor"
style="margin-bottom: 0.25rem"
>{{ x }}</van-checkbox
>
......@@ -38,10 +39,15 @@
</template>
<script setup>
import { styleColor } from "@/constant.js";
const props = defineProps({
item: Object,
});
// TAG: 自定义主题颜色
const themeVars = {
radioColor: styleColor.baseColor,
};
onMounted(() => {
// 默认值为数组
props.item.value = [];
......
......@@ -23,6 +23,7 @@
:key="index"
:name="x"
icon-size="1rem"
:checked-color="themeVars.radioColor"
style="margin-bottom: 0.25rem"
>{{ x }}</van-radio
>
......@@ -33,9 +34,16 @@
</template>
<script setup>
import { styleColor } from "@/constant.js";
const props = defineProps({
item: Object,
});
// TAG: 自定义主题颜色
const themeVars = {
radioColor: styleColor.baseColor,
};
</script>
<style lang="less" scoped>
......
......@@ -7,9 +7,6 @@
*/
// 颜色变量
export const styleColor = {
baseColor: '#8F652E',
baseFontColor: '#333333',
subFontColor: '#999999',
subColor: '#2B000C',
affixColor: '#999999',
baseColor: '#C2915F',
backgroundColor: '#FFF9EF',
}
......
......@@ -52,6 +52,7 @@ import { queryFormAPI } from "@/api/form.js";
import { addFormDataAPI } from "@/api/data.js";
import { showSuccessToast, showFailToast } from "vant";
import { wxInfo } from "@/utils/tools";
import { styleColor } from "@/constant.js";
// web端判断封面图片高度
const is_pc = computed(() => wxInfo().isPC);
const PHeaderHeight = computed(() => {
......@@ -63,8 +64,8 @@ const PHeaderHeight = computed(() => {
});
// TAG: 自定义主题颜色
const themeVars = {
buttonPrimaryBackground: "#c2915f",
buttonPrimaryBorderColor: "#c2915f",
buttonPrimaryBackground: styleColor.baseColor,
buttonPrimaryBorderColor: styleColor.baseColor,
};
const $route = useRoute();
......