wip: 临时提交

This commit is contained in:
Ray.Hao
2025-07-22 23:21:44 +08:00
parent 030e19084f
commit 088ff87ea3
11 changed files with 501 additions and 1275 deletions

View File

@@ -0,0 +1,60 @@
/*
* @Author: weisheng
* @Date: 2024-10-29 22:12:54
* @LastEditTime: 2025-06-25 13:33:39
* @LastEditors: weisheng
* @Description:
* @FilePath: /wot-demo/src/composables/useTabbar.ts
* 记得注释
*/
export interface TabbarItem {
name: string;
value: number | null;
active: boolean;
title: string;
icon: string;
}
const tabbarItems = ref<TabbarItem[]>([
{ name: "home", value: null, active: true, title: "首页", icon: "home" },
{ name: "mine", value: null, active: false, title: "我的", icon: "user" },
]);
export function useTabbar() {
const tabbarList = computed(() => tabbarItems.value);
const activeTabbar = computed(() => {
const item = tabbarItems.value.find((item) => item.active);
return item || tabbarItems.value[0];
});
const getTabbarItemValue = (name: string) => {
const item = tabbarItems.value.find((item) => item.name === name);
return item && item.value ? item.value : null;
};
const setTabbarItem = (name: string, value: number) => {
const tabbarItem = tabbarItems.value.find((item) => item.name === name);
if (tabbarItem) {
tabbarItem.value = value;
}
};
const setTabbarItemActive = (name: string) => {
tabbarItems.value.forEach((item) => {
if (item.name === name) {
item.active = true;
} else {
item.active = false;
}
});
};
return {
tabbarList,
activeTabbar,
getTabbarItemValue,
setTabbarItem,
setTabbarItemActive,
};
}

View File

@@ -1,162 +1,178 @@
import { ref, watch, computed } from "vue";
import type { ConfigProviderThemeVars } from "wot-design-uni";
/* 默认的主题色列表 */
export const colorColumns = [
{ value: "#165DFF", label: "海洋蓝" },
{ value: "#1677FF", label: "天空蓝" },
{ value: "#0081FF", label: "梦幻蓝" },
{ value: "#4080FF", label: "皇家蓝" },
{ value: "#4D74FF", label: "靛蓝" },
{ value: "#0FC6C2", label: "碧波绿" },
{ value: "#722ED1", label: "魔幻紫" },
{ value: "#F5222D", label: "热情红" },
{ value: "#FA8C16", label: "活力橙" },
{ value: "#FADB14", label: "阳光黄" },
{ value: "#52C41A", label: "生机绿" },
{ value: "#EB2F96", label: "浪漫粉" },
{ value: "#13C2C2", label: "清新青" },
{ value: "#36CFC9", label: "湖水蓝" },
{ value: "#CD5C5C", label: "复古红" },
{ value: "#228B22", label: "森林绿" },
// 定义主题色选项
export interface ThemeColorOption {
name: string;
value: string;
primary: string;
}
// 预定义的主题色选项
export const themeColorOptions: ThemeColorOption[] = [
{ name: "默认蓝", value: "blue", primary: "#4D7FFF" },
{ name: "活力橙", value: "orange", primary: "#FF7D00" },
{ name: "薄荷绿", value: "green", primary: "#07C160" },
{ name: "樱花粉", value: "pink", primary: "#FF69B4" },
{ name: "紫罗兰", value: "purple", primary: "#8A2BE2" },
{ name: "朱砂红", value: "red", primary: "#FF4757" },
];
/* 存储键名 */
const THEME_STORAGE_KEY = "app_theme_mode";
const THEME_COLOR_STORAGE_KEY = "app_theme_color";
export function useTheme() {
// 状态定义
const theme = ref<"light" | "dark">("light");
const followSystem = ref(true); // 是否跟随系统主题
const hasUserSet = ref(false); // 用户是否手动设置过主题
const currentThemeColor = ref<ThemeColorOption>(themeColorOptions[0]);
const showThemeColorSheet = ref(false);
/* 从存储中获取主题模式 */
const getStoredTheme = (): "light" | "dark" => {
try {
const stored = uni.getStorageSync(THEME_STORAGE_KEY);
return stored === "dark" ? "dark" : "light";
} catch {
return "light";
}
};
const themeVars = reactive<ConfigProviderThemeVars>({
darkBackground: "#0f0f0f",
darkBackground2: "#1a1a1a",
darkBackground3: "#242424",
darkBackground4: "#2f2f2f",
darkBackground5: "#3d3d3d",
darkBackground6: "#4a4a4a",
darkBackground7: "#606060",
darkColor: "#ffffff",
darkColor2: "#e0e0e0",
darkColor3: "#a0a0a0",
colorTheme: themeColorOptions[0].primary,
});
/* 从存储中获取主题色 */
const getStoredThemeColor = (): string => {
try {
const stored = uni.getStorageSync(THEME_COLOR_STORAGE_KEY);
return stored || colorColumns[0].value;
} catch {
return colorColumns[0].value;
}
};
// 计算属性
const isDark = computed(() => theme.value === "dark");
/* 主题状态 */
export const theme = ref<"light" | "dark">(getStoredTheme());
export const currentThemeColor = ref<string>(getStoredThemeColor());
/* 主题变量(供 ConfigProvider 使用) */
export const themeVars = computed<ConfigProviderThemeVars>(() => ({
colorTheme: currentThemeColor.value,
// 按钮颜色
buttonPrimaryBgColor: currentThemeColor.value,
buttonPrimaryColor: "#ffffff",
// 开关颜色
switchOnBgColor: currentThemeColor.value,
// 其他组件颜色
cellIconColor: currentThemeColor.value,
tagPrimaryBgColor: currentThemeColor.value,
tagPrimaryColor: "#ffffff",
}));
/* 应用主题到根元素 */
const applyThemeToRoot = () => {
// 获取根元素
const root = document.documentElement;
const body = document.body;
// #ifdef H5
// 应用暗黑模式
if (theme.value === "dark") {
root.setAttribute("data-theme", "dark");
body.classList.add("wot-theme-dark");
} else {
root.removeAttribute("data-theme");
body.classList.remove("wot-theme-dark");
/* 手动切换主题 */
function toggleTheme(mode?: "light" | "dark") {
theme.value = mode || (theme.value === "light" ? "dark" : "light");
hasUserSet.value = true; // 标记用户已手动设置
followSystem.value = false; // 不再跟随系统
setNavigationBarColor();
}
// 应用主题色类
// 移除所有主题色类
root.className = root.className.replace(/theme-color-\w+/g, "").trim();
// 添加当前主题色类
const colorClass = `theme-color-${currentThemeColor.value.replace("#", "")}`;
root.classList.add(colorClass);
// #endif
// #ifdef MP
// 小程序环境下通过设置页面的 data-theme 属性
const pages = getCurrentPages();
if (pages.length > 0) {
const currentPage = pages[pages.length - 1] as any;
if (currentPage) {
currentPage.setData?.({
"data-theme": theme.value,
themeColor: currentThemeColor.value,
});
/* 设置是否跟随系统主题 */
function setFollowSystem(follow: boolean) {
followSystem.value = follow;
if (follow) {
hasUserSet.value = false;
initTheme(); // 重新获取系统主题
}
}
// #endif
};
/* 监听主题模式变化 */
watch(
theme,
(newTheme) => {
uni.setStorageSync(THEME_STORAGE_KEY, newTheme);
applyThemeToRoot();
},
{ immediate: true }
);
/* 设置导航栏颜色 */
function setNavigationBarColor() {
uni.setNavigationBarColor({
frontColor: theme.value === "light" ? "#000000" : "#ffffff",
backgroundColor: theme.value === "light" ? "#ffffff" : "#000000",
});
}
/* 监听主题色变化 */
watch(
currentThemeColor,
(newColor) => {
uni.setStorageSync(THEME_COLOR_STORAGE_KEY, newColor);
applyThemeToRoot();
},
{ immediate: true }
);
/* 设置主题色 */
function setCurrentThemeColor(color: ThemeColorOption) {
currentThemeColor.value = color;
themeVars.colorTheme = color.primary;
}
/* 切换主题模式 */
export const toggleTheme = () => {
theme.value = theme.value === "light" ? "dark" : "light";
};
/* 获取系统主题 */
function getSystemTheme(): "light" | "dark" {
try {
// #ifdef MP-WEIXIN
// 微信小程序使用 getAppBaseInfo
const appBaseInfo = uni.getAppBaseInfo();
if (appBaseInfo && appBaseInfo.theme) {
return appBaseInfo.theme as "light" | "dark";
}
// #endif
/* 设置主题色 */
export const setThemeColor = (color: string) => {
currentThemeColor.value = color;
};
// #ifndef MP-WEIXIN
// 其他平台使用 getSystemInfoSync
const systemInfo = uni.getSystemInfoSync();
if (systemInfo && systemInfo.theme) {
return systemInfo.theme as "light" | "dark";
}
// #endif
} catch (error) {
console.warn("获取系统主题失败:", error);
}
return "light"; // 默认返回 light
}
/* 重置主题 */
export const resetTheme = () => {
theme.value = "light";
currentThemeColor.value = colorColumns[0].value;
};
/* 初始化主题 */
function initTheme() {
// 如果用户已手动设置且不跟随系统,保持当前主题
if (hasUserSet.value && !followSystem.value) {
console.log("使用用户设置的主题:", theme.value);
setNavigationBarColor();
return;
}
/* 初始化主题 */
export const initTheme = () => {
applyThemeToRoot();
console.log("主题初始化完成:", {
mode: theme.value,
color: currentThemeColor.value,
// 获取系统主题
const systemTheme = getSystemTheme();
// 如果是首次启动或跟随系统,使用系统主题
if (!hasUserSet.value || followSystem.value) {
theme.value = systemTheme;
if (!hasUserSet.value) {
followSystem.value = true;
console.log("首次启动,使用系统主题:", theme.value);
} else {
console.log("跟随系统主题:", theme.value);
}
}
setNavigationBarColor();
}
/* 打开主题色选择 */
function openThemeColorPicker() {
showThemeColorSheet.value = true;
}
/* 关闭主题色选择 */
function closeThemeColorPicker() {
showThemeColorSheet.value = false;
}
/* 选择主题色 */
function selectThemeColor(option: ThemeColorOption) {
setCurrentThemeColor(option);
closeThemeColorPicker();
}
// 检查函数是否存在的工具函数
const isFunction = (fn: any): boolean => typeof fn === "function";
onBeforeMount(() => {
initTheme();
if (isFunction(uni.onThemeChange)) {
uni.onThemeChange((res) => {
toggleTheme(res.theme);
});
}
});
onUnmounted(() => {
if (isFunction(uni.offThemeChange)) {
uni.offThemeChange((res) => {
toggleTheme(res.theme);
});
}
});
};
/* 导出主题相关的工具 */
export const useTheme = () => {
return {
theme,
theme: computed(() => theme.value),
isDark,
followSystem: computed(() => followSystem.value),
hasUserSet: computed(() => hasUserSet.value),
currentThemeColor: computed(() => currentThemeColor.value),
showThemeColorSheet,
themeVars,
currentThemeColor,
toggleTheme,
setThemeColor,
resetTheme,
themeColorOptions,
initTheme,
colorColumns,
toggleTheme,
setFollowSystem,
openThemeColorPicker,
closeThemeColorPicker,
selectThemeColor,
};
};
}

View File

@@ -1,22 +1,5 @@
<script lang="ts" setup>
import { useTheme } from "@/composables/useTheme";
const { theme, themeVars } = useTheme();
// 状态栏高度
const statusBarHeight = ref(0);
// 获取状态栏高度
onMounted(() => {
uni.getSystemInfo({
success: (res) => {
statusBarHeight.value = res.statusBarHeight || 20;
},
fail: () => {
statusBarHeight.value = 20;
},
});
});
</script>
<script lang="ts">
@@ -30,19 +13,22 @@ export default {
</script>
<template>
<wd-config-provider
:theme="theme"
:theme-vars="themeVars"
custom-style="background-color: #f5f5f5;min-height: 100vh"
:class="{ 'wot-theme-dark': theme === 'dark' }"
>
<view class="box-border w-full min-h-screen" :style="{ paddingTop: statusBarHeight + 'px' }">
<slot />
</view>
<wd-config-provider :theme-vars="themeVars" :theme="theme" :custom-class="`page-wraper ${theme}`">
<slot />
<wd-notify />
<wd-toast />
<wd-message-box />
</wd-config-provider>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.page-wraper {
box-sizing: border-box;
min-height: calc(100vh - var(--window-top));
background: #f9f9f9;
}
.wot-theme-dark.page-wraper {
background: #222;
}
</style>

View File

@@ -1,31 +1,6 @@
<!--
* @Author: Ray.Hao
* @Date: 2025-05-01 12:31:47
* @LastEditTime: 2025-05-01 12:31:47
* @LastEditors: Ray.Hao
* @Description: Tabbar 布局组件
-->
<script lang="ts">
export default {
options: {
addGlobalClass: true,
virtualHost: true,
styleIsolation: "shared",
},
};
</script>
<template>
<wd-config-provider
:theme="theme"
:theme-vars="themeVars"
custom-style="min-height: 100vh"
:class="{ 'wot-theme-dark': theme === 'dark' }"
>
<view class="box-border w-full min-h-screen" :style="{ paddingTop: statusBarHeight + 'px' }">
<slot />
</view>
<wd-config-provider :theme-vars="themeVars" :custom-class="`page-wraper ${theme}`" :theme="theme">
<slot />
<wd-tabbar
:model-value="activeTabbar.name"
placeholder
@@ -50,92 +25,45 @@ export default {
</template>
<script setup lang="ts">
import { onShow } from "@dcloudio/uni-app";
import { useTheme } from "@/composables/useTheme";
// 定义 TabbarItem 接口
interface TabbarItem {
name: string;
value: number | null;
active: boolean;
title: string;
icon: string;
}
const { theme, themeVars } = useTheme();
// 状态栏高度
const statusBarHeight = ref(0);
// tabbar 配置
const tabbarItems = ref<TabbarItem[]>([
{ name: "index", value: null, active: true, title: "首页", icon: "home" },
{ name: "mine", value: null, active: false, title: "我的", icon: "user" },
]);
// 计算属性
const tabbarList = computed(() => tabbarItems.value);
const activeTabbar = computed(
() => tabbarItems.value.find((item) => item.active) || tabbarItems.value[0]
);
// 更新 tabbar 状态
const updateTabbarState = () => {
const pages = getCurrentPages();
if (!pages.length) return;
const route = pages[pages.length - 1].route;
if (route === "pages/index/index") {
setTabbarActive("index");
} else if (route === "pages/mine/index") {
setTabbarActive("mine");
}
};
// 设置激活状态
const setTabbarActive = (name: string) => {
tabbarItems.value.forEach((item) => {
item.active = item.name === name;
});
};
// 处理点击事件
const handleTabbarChange = ({ value }: { value: string }) => {
setTabbarActive(value);
const url = value === "index" ? "/pages/index/index" : "/pages/mine/index";
uni.reLaunch({ url });
};
const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = useTabbar();
// 生命周期
onMounted(() => {
// 获取状态栏高度(改为异步方法)
uni.getSystemInfo({
success: (res) => {
statusBarHeight.value = res.statusBarHeight || 20;
},
fail: () => {
statusBarHeight.value = 20;
},
});
// 初始化状态
nextTick(updateTabbarState);
// 监听事件
uni.$on("updateTabbar", setTabbarActive);
});
onShow(() => {
nextTick(updateTabbarState);
// #ifdef APP-PLUS
uni.hideTabBar();
// #endif
});
nextTick(() => {
const pages = getCurrentPages();
if (!pages.length) return;
onUnmounted(() => {
uni.$off("updateTabbar");
const route = pages[pages.length - 1].route;
if (route.name && route.name !== activeTabbar.value.name) {
setTabbarItemActive(route.name);
}
});
});
</script>
<script lang="ts">
export default {
options: {
addGlobalClass: true,
virtualHost: true,
styleIsolation: "shared",
},
};
</script>
<style lang="scss">
.page-wraper {
box-sizing: border-box;
min-height: calc(100vh - var(--window-top));
background: #f9f9f9;
}
.wot-theme-dark.page-wraper {
background: #222;
}
</style>

View File

@@ -5,19 +5,11 @@ import "uno.css";
import "@/styles/index.scss";
import { setupStore } from "@/store";
// 可选:导入业务组件
// import BusinessComponents from '@/components/business';
export function createApp() {
const app = createSSRApp(App);
setupStore(app);
// 可选:全局注册业务组件
// Object.entries(BusinessComponents).forEach(([name, component]) => {
// app.component(name, component);
// });
return {
app,
};

View File

@@ -1,5 +1,3 @@
@import "./theme";
html,
body,
#app {

View File

@@ -1,190 +0,0 @@
/**
* 统一主题系统
* 简洁易懂,一个文件搞定所有主题
*/
/* 亮色主题(默认) */
:root,
page {
/* ===== 主题色 ===== */
--wot-color-theme: #165dff;
--primary-color: var(--wot-color-theme);
--primary-color-light: #94bfff;
--primary-color-dark: #0e3c9b;
/* ===== 功能色 ===== */
--wot-color-success: #0fc6c2;
--wot-color-warning: #ff7d00;
--wot-color-danger: #f5222d;
--wot-color-info: #86909c;
/* ===== 文本颜色 ===== */
--wot-color-text: #1d2129;
--wot-color-text-secondary: #4e5969;
--wot-color-text-placeholder: #86909c;
--wot-color-text-disabled: #c9cdd4;
/* ===== 背景颜色 ===== */
--wot-color-bg: #ffffff;
--wot-color-bg-page: #f5f7fa;
--wot-color-bg-light: #f8f9fa;
--wot-color-bg-container: #ffffff;
/* ===== 边框颜色 ===== */
--wot-color-border: #e5e6eb;
--wot-color-border-light: #f2f3f5;
/* ===== 组件专用变量 ===== */
--wot-card-bg-color: var(--wot-color-bg-container);
--wot-card-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
--wot-cell-bg-color: var(--wot-color-bg-container);
--wot-popup-bg-color: var(--wot-color-bg-container);
--wot-navbar-bg-color: var(--wot-color-bg-container);
--wot-tabbar-bg-color: var(--wot-color-bg-container);
}
/* 暗黑主题 */
[data-theme="dark"],
[data-theme="dark"] page,
.wot-theme-dark,
.wot-theme-dark page {
/* ===== 主题色(暗黑模式下稍微调亮) ===== */
--wot-color-theme: #4080ff;
--primary-color: var(--wot-color-theme);
--primary-color-light: #6fa0ff;
--primary-color-dark: #2060df;
/* ===== 功能色 ===== */
--wot-color-success: #1dd1cc;
--wot-color-warning: #ff8c1a;
--wot-color-danger: #ff4757;
--wot-color-info: #9ca3af;
/* ===== 文本颜色 ===== */
--wot-color-text: #ffffff;
--wot-color-text-secondary: #d1d5db;
--wot-color-text-placeholder: #9ca3af;
--wot-color-text-disabled: #6b7280;
/* ===== 背景颜色 ===== */
--wot-color-bg: #1a1a1a;
--wot-color-bg-page: #0f0f0f;
--wot-color-bg-light: #2a2a2a;
--wot-color-bg-container: #1f1f1f;
/* ===== 边框颜色 ===== */
--wot-color-border: #404040;
--wot-color-border-light: #606060;
/* ===== 组件专用变量 ===== */
--wot-card-bg-color: var(--wot-color-bg-container);
--wot-card-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.3);
--wot-cell-bg-color: var(--wot-color-bg-container);
--wot-popup-bg-color: var(--wot-color-bg-container);
--wot-navbar-bg-color: var(--wot-color-bg-container);
--wot-tabbar-bg-color: var(--wot-color-bg-container);
}
/* 动态主题色类(这些会被 useTheme 动态应用到根元素) */
.theme-color-165DFF {
--wot-color-theme: #165dff;
--primary-color: #165dff;
}
.theme-color-0FC6C2 {
--wot-color-theme: #0fc6c2;
--primary-color: #0fc6c2;
}
.theme-color-722ED1 {
--wot-color-theme: #722ed1;
--primary-color: #722ed1;
}
.theme-color-F5222D {
--wot-color-theme: #f5222d;
--primary-color: #f5222d;
}
.theme-color-FA8C16 {
--wot-color-theme: #fa8c16;
--primary-color: #fa8c16;
}
.theme-color-FADB14 {
--wot-color-theme: #fadb14;
--primary-color: #fadb14;
}
.theme-color-52C41A {
--wot-color-theme: #52c41a;
--primary-color: #52c41a;
}
.theme-color-EB2F96 {
--wot-color-theme: #eb2f96;
--primary-color: #eb2f96;
}
.theme-color-13C2C2 {
--wot-color-theme: #13c2c2;
--primary-color: #13c2c2;
}
.theme-color-1890FF {
--wot-color-theme: #1890ff;
--primary-color: #1890ff;
}
.theme-color-CD5C5C {
--wot-color-theme: #cd5c5c;
--primary-color: #cd5c5c;
}
.theme-color-228B22 {
--wot-color-theme: #228b22;
--primary-color: #228b22;
}
/* 全局基础样式 */
page {
color: var(--wot-color-text);
background-color: var(--wot-color-bg-page);
transition:
background-color 0.3s ease,
color 0.3s ease;
}
/* H5 环境下的 body 样式 */
/* #ifdef H5 */
body {
color: var(--wot-color-text);
background-color: var(--wot-color-bg-page);
transition:
background-color 0.3s ease,
color 0.3s ease;
}
/* #endif */
/* 通用组件样式重置 */
view,
text,
button,
input,
textarea {
transition:
background-color 0.3s ease,
color 0.3s ease,
border-color 0.3s ease;
}
/* 确保所有 Wot 组件使用主题变量 */
:deep(.wd-button--primary) {
background-color: var(--wot-color-theme) !important;
border-color: var(--wot-color-theme) !important;
}
:deep(.wd-cell) {
background-color: var(--wot-cell-bg-color) !important;
}
:deep(.wd-navbar) {
background-color: var(--wot-navbar-bg-color) !important;
}
:deep(.wd-tabbar) {
background-color: var(--wot-tabbar-bg-color) !important;
}
:deep(.wd-icon) {
color: var(--wot-color-theme) !important;
}

View File

@@ -6,22 +6,49 @@
// biome-ignore lint: disable
export {}
declare global {
const CommonUtil: typeof import('wot-design-uni')['CommonUtil']
const EffectScope: typeof import('vue')['EffectScope']
const Storage: typeof import('../utils/storage')['Storage']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const applyThemeOnPageShow: typeof import('../utils/theme')['applyThemeOnPageShow']
const applyThemeToMiniProgram: typeof import('../utils/theme')['applyThemeToMiniProgram']
const auth: typeof import('../api/auth')['default']
const checkLogin: typeof import('../utils/auth')['checkLogin']
const clearAll: typeof import('../utils/storage')['clearAll']
const clearTokens: typeof import('../utils/auth')['clearTokens']
const colorColumns: typeof import('../composables/useTheme')['colorColumns']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createPinia: typeof import('pinia')['createPinia']
const currentThemeColor: typeof import('../composables/useTheme')['currentThemeColor']
const customRef: typeof import('vue')['customRef']
const debounce: typeof import('../utils/index')['debounce']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const effectScope: typeof import('vue')['effectScope']
const file: typeof import('../api/file')['default']
const getAccessToken: typeof import('../utils/auth')['getAccessToken']
const getActivePinia: typeof import('pinia')['getActivePinia']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const getRefreshToken: typeof import('../utils/auth')['getRefreshToken']
const getToken: typeof import('../utils/storage')['getToken']
const getUserInfo: typeof import('../utils/storage')['getUserInfo']
const guessSerializerType: typeof import('@uni-helper/uni-use')['guessSerializerType']
const h: typeof import('vue')['h']
const initTheme: typeof import('../composables/useTheme')['initTheme']
const inject: typeof import('vue')['inject']
const isLoggedIn: typeof import('../utils/auth')['isLoggedIn']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters']
const mapState: typeof import('pinia')['mapState']
const mapStores: typeof import('pinia')['mapStores']
const mapWritableState: typeof import('pinia')['mapWritableState']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
@@ -65,17 +92,35 @@ declare global {
const onUpdated: typeof import('vue')['onUpdated']
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
const provide: typeof import('vue')['provide']
const publicRequest: typeof import('../utils/request')['publicRequest']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const request: typeof import('../utils/request')['default']
const requireLogin: typeof import('../utils/auth')['requireLogin']
const resetTheme: typeof import('../composables/useTheme')['resetTheme']
const resolveComponent: typeof import('vue')['resolveComponent']
const setAccessToken: typeof import('../utils/auth')['setAccessToken']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const setRefreshToken: typeof import('../utils/auth')['setRefreshToken']
const setThemeColor: typeof import('../composables/useTheme')['setThemeColor']
const setToken: typeof import('../utils/storage')['setToken']
const setUserInfo: typeof import('../utils/storage')['setUserInfo']
const setupStore: typeof import('../store/index')['setupStore']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const store: typeof import('../store/index')['store']
const storeToRefs: typeof import('pinia')['storeToRefs']
const theme: typeof import('../composables/useTheme')['theme']
const themeColorOptions: typeof import('../composables/useTheme')['themeColorOptions']
const themeVars: typeof import('../composables/useTheme')['themeVars']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const toggleTheme: typeof import('../composables/useTheme')['toggleTheme']
const triggerRef: typeof import('vue')['triggerRef']
const tryOnBackPress: typeof import('@uni-helper/uni-use')['tryOnBackPress']
const tryOnHide: typeof import('@uni-helper/uni-use')['tryOnHide']
@@ -97,9 +142,11 @@ declare global {
const useInterceptor: typeof import('@uni-helper/uni-use')['useInterceptor']
const useLink: (typeof import("vue-router"))["useLink"]
const useLoading: typeof import('@uni-helper/uni-use')['useLoading']
const useMessage: typeof import('wot-design-uni')['useMessage']
const useModal: typeof import('@uni-helper/uni-use')['useModal']
const useModel: typeof import('vue')['useModel']
const useNetwork: typeof import('@uni-helper/uni-use')['useNetwork']
const useNotify: typeof import('wot-design-uni')['useNotify']
const useOnline: typeof import('@uni-helper/uni-use')['useOnline']
const usePage: typeof import('@uni-helper/uni-use')['usePage']
const usePageScroll: typeof import('@uni-helper/uni-use')['usePageScroll']
@@ -117,13 +164,20 @@ declare global {
const useSelectorQuery: typeof import('@uni-helper/uni-use')['useSelectorQuery']
const useSlots: typeof import('vue')['useSlots']
const useSocket: typeof import('@uni-helper/uni-use')['useSocket']
const useStomp: typeof import('../composables/useStomp')['useStomp']
const useStorage: typeof import('@uni-helper/uni-use')['useStorage']
const useStorageAsync: typeof import('@uni-helper/uni-use')['useStorageAsync']
const useStorageSync: typeof import('@uni-helper/uni-use')['useStorageSync']
const useTabbar: typeof import('../composables/useTabbar')['useTabbar']
const useTemplateRef: typeof import('vue')['useTemplateRef']
const useToast: typeof import('@uni-helper/uni-use')['useToast']
const useTheme: typeof import('../composables/useTheme')['useTheme']
const useThemeStore: typeof import('../store/modules/theme.store')['useThemeStore']
const useToast: typeof import('wot-design-uni')['useToast']
const useUploadFile: typeof import('@uni-helper/uni-use')['useUploadFile']
const useUserStore: typeof import('../store/modules/user.store')['useUserStore']
const useVisible: typeof import('@uni-helper/uni-use')['useVisible']
const useWechat: typeof import('../composables/useWechat')['useWechat']
const user: typeof import('../api/user')['default']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
@@ -135,3 +189,176 @@ declare global {
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly CommonUtil: UnwrapRef<typeof import('wot-design-uni')['CommonUtil']>
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly Storage: UnwrapRef<typeof import('../utils/storage')['Storage']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly applyThemeOnPageShow: UnwrapRef<typeof import('../utils/theme')['applyThemeOnPageShow']>
readonly applyThemeToMiniProgram: UnwrapRef<typeof import('../utils/theme')['applyThemeToMiniProgram']>
readonly auth: UnwrapRef<typeof import('../api/auth')['default']>
readonly checkLogin: UnwrapRef<typeof import('../utils/auth')['checkLogin']>
readonly clearAll: UnwrapRef<typeof import('../utils/storage')['clearAll']>
readonly clearTokens: UnwrapRef<typeof import('../utils/auth')['clearTokens']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly debounce: UnwrapRef<typeof import('../utils/index')['debounce']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly file: UnwrapRef<typeof import('../api/file')['default']>
readonly getAccessToken: UnwrapRef<typeof import('../utils/auth')['getAccessToken']>
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getRefreshToken: UnwrapRef<typeof import('../utils/auth')['getRefreshToken']>
readonly getToken: UnwrapRef<typeof import('../utils/storage')['getToken']>
readonly getUserInfo: UnwrapRef<typeof import('../utils/storage')['getUserInfo']>
readonly guessSerializerType: UnwrapRef<typeof import('@uni-helper/uni-use')['guessSerializerType']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly isLoggedIn: UnwrapRef<typeof import('../utils/auth')['isLoggedIn']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onAddToFavorites: UnwrapRef<typeof import('@dcloudio/uni-app')['onAddToFavorites']>
readonly onBackPress: UnwrapRef<typeof import('@dcloudio/uni-app')['onBackPress']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onError: UnwrapRef<typeof import('@dcloudio/uni-app')['onError']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onHide: UnwrapRef<typeof import('@dcloudio/uni-app')['onHide']>
readonly onLaunch: UnwrapRef<typeof import('@dcloudio/uni-app')['onLaunch']>
readonly onLoad: UnwrapRef<typeof import('@dcloudio/uni-app')['onLoad']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onNavigationBarButtonTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']>
readonly onNavigationBarSearchInputChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']>
readonly onNavigationBarSearchInputClicked: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']>
readonly onNavigationBarSearchInputConfirmed: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']>
readonly onNavigationBarSearchInputFocusChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']>
readonly onPageNotFound: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageNotFound']>
readonly onPageScroll: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageScroll']>
readonly onPullDownRefresh: UnwrapRef<typeof import('@dcloudio/uni-app')['onPullDownRefresh']>
readonly onReachBottom: UnwrapRef<typeof import('@dcloudio/uni-app')['onReachBottom']>
readonly onReady: UnwrapRef<typeof import('@dcloudio/uni-app')['onReady']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onResize: UnwrapRef<typeof import('@dcloudio/uni-app')['onResize']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onShareAppMessage: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareAppMessage']>
readonly onShareTimeline: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareTimeline']>
readonly onShow: UnwrapRef<typeof import('@dcloudio/uni-app')['onShow']>
readonly onTabItemTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onTabItemTap']>
readonly onThemeChange: UnwrapRef<typeof import('@dcloudio/uni-app')['onThemeChange']>
readonly onUnhandledRejection: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnhandledRejection']>
readonly onUnload: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnload']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly publicRequest: UnwrapRef<typeof import('../utils/request')['publicRequest']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly request: UnwrapRef<typeof import('../utils/request')['default']>
readonly requireLogin: UnwrapRef<typeof import('../utils/auth')['requireLogin']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly setAccessToken: UnwrapRef<typeof import('../utils/auth')['setAccessToken']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly setRefreshToken: UnwrapRef<typeof import('../utils/auth')['setRefreshToken']>
readonly setToken: UnwrapRef<typeof import('../utils/storage')['setToken']>
readonly setUserInfo: UnwrapRef<typeof import('../utils/storage')['setUserInfo']>
readonly setupStore: UnwrapRef<typeof import('../store/index')['setupStore']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly store: UnwrapRef<typeof import('../store/index')['store']>
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
readonly themeColorOptions: UnwrapRef<typeof import('../composables/useTheme')['themeColorOptions']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly tryOnBackPress: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnBackPress']>
readonly tryOnHide: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnHide']>
readonly tryOnInit: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnInit']>
readonly tryOnLoad: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnLoad']>
readonly tryOnReady: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnReady']>
readonly tryOnScopeDispose: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnScopeDispose']>
readonly tryOnShow: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnShow']>
readonly tryOnUnload: UnwrapRef<typeof import('@uni-helper/uni-use')['tryOnUnload']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly useActionSheet: UnwrapRef<typeof import('@uni-helper/uni-use')['useActionSheet']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useClipboardData: UnwrapRef<typeof import('@uni-helper/uni-use')['useClipboardData']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useDownloadFile: UnwrapRef<typeof import('@uni-helper/uni-use')['useDownloadFile']>
readonly useGlobalData: UnwrapRef<typeof import('@uni-helper/uni-use')['useGlobalData']>
readonly useId: UnwrapRef<typeof import('vue')['useId']>
readonly useInterceptor: UnwrapRef<typeof import('@uni-helper/uni-use')['useInterceptor']>
readonly useLoading: UnwrapRef<typeof import('@uni-helper/uni-use')['useLoading']>
readonly useMessage: UnwrapRef<typeof import('wot-design-uni')['useMessage']>
readonly useModal: UnwrapRef<typeof import('@uni-helper/uni-use')['useModal']>
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
readonly useNetwork: UnwrapRef<typeof import('@uni-helper/uni-use')['useNetwork']>
readonly useNotify: UnwrapRef<typeof import('wot-design-uni')['useNotify']>
readonly useOnline: UnwrapRef<typeof import('@uni-helper/uni-use')['useOnline']>
readonly usePage: UnwrapRef<typeof import('@uni-helper/uni-use')['usePage']>
readonly usePageScroll: UnwrapRef<typeof import('@uni-helper/uni-use')['usePageScroll']>
readonly usePages: UnwrapRef<typeof import('@uni-helper/uni-use')['usePages']>
readonly usePreferredDark: UnwrapRef<typeof import('@uni-helper/uni-use')['usePreferredDark']>
readonly usePreferredLanguage: UnwrapRef<typeof import('@uni-helper/uni-use')['usePreferredLanguage']>
readonly usePrevPage: UnwrapRef<typeof import('@uni-helper/uni-use')['usePrevPage']>
readonly usePrevRoute: UnwrapRef<typeof import('@uni-helper/uni-use')['usePrevRoute']>
readonly useProvider: UnwrapRef<typeof import('@uni-helper/uni-use')['useProvider']>
readonly useRequest: UnwrapRef<typeof import('@uni-helper/uni-use')['useRequest']>
readonly useRoute: UnwrapRef<typeof import('@uni-helper/uni-use')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('@uni-helper/uni-use')['useRouter']>
readonly useScanCode: UnwrapRef<typeof import('@uni-helper/uni-use')['useScanCode']>
readonly useScreenBrightness: UnwrapRef<typeof import('@uni-helper/uni-use')['useScreenBrightness']>
readonly useSelectorQuery: UnwrapRef<typeof import('@uni-helper/uni-use')['useSelectorQuery']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useSocket: UnwrapRef<typeof import('@uni-helper/uni-use')['useSocket']>
readonly useStomp: UnwrapRef<typeof import('../composables/useStomp')['useStomp']>
readonly useStorage: UnwrapRef<typeof import('@uni-helper/uni-use')['useStorage']>
readonly useStorageAsync: UnwrapRef<typeof import('@uni-helper/uni-use')['useStorageAsync']>
readonly useStorageSync: UnwrapRef<typeof import('@uni-helper/uni-use')['useStorageSync']>
readonly useTabbar: UnwrapRef<typeof import('../composables/useTabbar')['useTabbar']>
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
readonly useTheme: UnwrapRef<typeof import('../composables/useTheme')['useTheme']>
readonly useThemeStore: UnwrapRef<typeof import('../store/modules/theme.store')['useThemeStore']>
readonly useToast: UnwrapRef<typeof import('wot-design-uni')['useToast']>
readonly useUploadFile: UnwrapRef<typeof import('@uni-helper/uni-use')['useUploadFile']>
readonly useUserStore: UnwrapRef<typeof import('../store/modules/user.store')['useUserStore']>
readonly useVisible: UnwrapRef<typeof import('@uni-helper/uni-use')['useVisible']>
readonly useWechat: UnwrapRef<typeof import('../composables/useWechat')['useWechat']>
readonly user: UnwrapRef<typeof import('../api/user')['default']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
}
}