Browse Source

云南主题

duy 5 months ago
parent
commit
1c0c3f830d
2 changed files with 26 additions and 1 deletions
  1. 11 0
      src/App.vue
  2. 15 1
      src/store/modules/useProject.js

+ 11 - 0
src/App.vue

@@ -39,6 +39,17 @@ nextTick(() => {
 
 //设置主题
 const setUserTheme = (theme, appColor) => {
+
+    const projectInfo = appStore.projectInfo
+    const id = '1891312830718746625'
+    let isYunNan = projectInfo?.id === id
+    if (isYunNan) {
+        setElementMainColor('#409eff')
+        let colorName = 'blue'
+        let theme = 'light'
+        document.documentElement.setAttribute('class', `${theme} color-${colorName}`)
+        return
+    }
     const colorVal = getObjValue(appColor)
     //设置主色调
     setElementMainColor(colorVal?.color)

+ 15 - 1
src/store/modules/useProject.js

@@ -1,6 +1,7 @@
 import { computed, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { isNullES } from 'js-fast-way'
+import { setElementMainColor } from 'js-fast-way'
 
 export function useProject() {
     const useAppState = useAppStore()
@@ -18,12 +19,25 @@ export function useProject() {
         contractId.value = cid
         projectInfo.value = pinfo
         contractInfo.value = cinfo
+        setYunNanTheme(pid)
     }, { deep: true })
 
     const isAppLoading = computed(() => {
         return !isNullES(projectId.value) && !isNullES(contractId.value)
     })
-
+    const setYunNanTheme = (pid)=>{
+        console.log( projectId.value, ' projectId.value ')
+        
+        const id = '1891312830718746625'
+        let isYunNan = pid === id
+        if (isYunNan) {
+            setElementMainColor('#409eff')
+            let colorName = 'blue'
+            let theme = 'light'
+            document.documentElement.setAttribute('class', `${theme} color-${colorName}`)
+            return
+        }
+    }
     return {
         projectId,
         contractId,