wip: 重构临时提交
This commit is contained in:
3
components.d.ts
vendored
3
components.d.ts
vendored
@@ -21,8 +21,6 @@ declare module 'vue' {
|
||||
WdCard: typeof import('wot-design-uni/components/wd-card/wd-card.vue')['default']
|
||||
WdCell: typeof import('wot-design-uni/components/wd-cell/wd-cell.vue')['default']
|
||||
WdCellGroup: typeof import('wot-design-uni/components/wd-cell-group/wd-cell-group.vue')['default']
|
||||
WdCollapse: typeof import('wot-design-uni/components/wd-collapse/wd-collapse.vue')['default']
|
||||
WdCollapseItem: typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue')['default']
|
||||
WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default']
|
||||
WdDivider: typeof import('wot-design-uni/components/wd-divider/wd-divider.vue')['default']
|
||||
WdForm: typeof import('wot-design-uni/components/wd-form/wd-form.vue')['default']
|
||||
@@ -40,7 +38,6 @@ declare module 'vue' {
|
||||
WdPopup: typeof import('wot-design-uni/components/wd-popup/wd-popup.vue')['default']
|
||||
WdRadio: typeof import('wot-design-uni/components/wd-radio/wd-radio.vue')['default']
|
||||
WdRadioGroup: typeof import('wot-design-uni/components/wd-radio-group/wd-radio-group.vue')['default']
|
||||
WdStatusTip: typeof import('wot-design-uni/components/wd-status-tip/wd-status-tip.vue')['default']
|
||||
WdSwiper: typeof import('wot-design-uni/components/wd-swiper/wd-swiper.vue')['default']
|
||||
WdSwitch: typeof import('wot-design-uni/components/wd-switch/wd-switch.vue')['default']
|
||||
WdTabbar: typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue')['default']
|
||||
|
||||
17
src/App.vue
17
src/App.vue
@@ -1,20 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useTheme } from "@/composables/useTheme";
|
||||
|
||||
const { initTheme, toggleTheme } = useTheme();
|
||||
|
||||
onLaunch(() => {
|
||||
// 应用启动时初始化主题
|
||||
initTheme();
|
||||
|
||||
// 监听系统主题变化
|
||||
uni.onThemeChange((res) => {
|
||||
toggleTheme(res.theme);
|
||||
});
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
// 应用显示时确保主题同步
|
||||
initTheme();
|
||||
console.log("onShow");
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -29,12 +29,7 @@
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
<view class="form-item">
|
||||
<wd-icon
|
||||
name="lock-on"
|
||||
size="22"
|
||||
:color="isDarkMode ? '#7AC5FF' : '#333'"
|
||||
class="input-icon"
|
||||
/>
|
||||
<wd-icon name="lock-on" size="22" class="input-icon" />
|
||||
<input
|
||||
v-model="loginFormData.password"
|
||||
class="form-input input-transparent"
|
||||
@@ -45,7 +40,6 @@
|
||||
<wd-icon
|
||||
:name="showPassword ? 'eye-open' : 'eye-close'"
|
||||
size="18"
|
||||
:color="isDarkMode ? '#7AC5FF' : '#9ca3af'"
|
||||
class="eye-icon"
|
||||
@click="showPassword = !showPassword"
|
||||
/>
|
||||
@@ -126,8 +120,6 @@ import { type LoginData } from "@/api/auth";
|
||||
import { useUserStore } from "@/store/modules/user.store";
|
||||
import { useToast } from "wot-design-uni";
|
||||
import { useWechat } from "@/composables/useWechat";
|
||||
import { useThemeStore } from "@/composables/types/theme";
|
||||
import { computed, onMounted } from "vue";
|
||||
|
||||
const loginFormRef = ref();
|
||||
const toast = useToast();
|
||||
@@ -136,10 +128,6 @@ const userStore = useUserStore();
|
||||
const showPassword = ref(false);
|
||||
const loginType = ref<"account" | "phone">("account");
|
||||
const { authState, getLoginCode, getPhoneNumber } = useWechat();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
// 是否暗黑模式
|
||||
const isDarkMode = computed(() => themeStore.theme === "dark");
|
||||
|
||||
// 登录表单数据
|
||||
const loginFormData = ref<LoginData>({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="app-container">
|
||||
<view class="app-container dark:text-[var(--wot-dark-color)]">
|
||||
<!-- 用户信息卡片 -->
|
||||
<view class="user-profile">
|
||||
<view class="blur-bg"></view>
|
||||
@@ -44,7 +44,7 @@
|
||||
<view class="stats-container">
|
||||
<view class="stat-item" @click="navigateToSection('wallet')">
|
||||
<view class="stat-value">0.00</view>
|
||||
<view class="stat-label">我的余额</view>
|
||||
<view class="">我的余额</view>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
<view class="stat-item" @click="navigateToSection('favorites')">
|
||||
@@ -114,7 +114,7 @@
|
||||
<view class="service-desc">解锁更多特权</view>
|
||||
</view>
|
||||
</view>
|
||||
<wd-icon name="arrow-right" size="14" color="#999" />
|
||||
<wd-icon name="arrow-right" size="14" />
|
||||
</view>
|
||||
<view class="service-item" @click="navigateToSection('services', 'coupon')">
|
||||
<view class="service-left">
|
||||
@@ -126,7 +126,7 @@
|
||||
<view class="service-desc">查看我的优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
<wd-icon name="arrow-right" size="14" color="#999" />
|
||||
<wd-icon name="arrow-right" size="14" />
|
||||
</view>
|
||||
<view class="service-item" @click="navigateToSection('services', 'invite')">
|
||||
<view class="service-left">
|
||||
@@ -138,7 +138,7 @@
|
||||
<view class="service-desc">邀请好友得奖励</view>
|
||||
</view>
|
||||
</view>
|
||||
<wd-icon name="arrow-right" size="14" color="#999" />
|
||||
<wd-icon name="arrow-right" size="14" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="app-container">
|
||||
<view class="app-container dark:text-[var(--wot-dark-color)]">
|
||||
<!-- 页面标题 -->
|
||||
<view class="page-header">
|
||||
<text class="page-title">主题设置</text>
|
||||
@@ -73,7 +73,7 @@
|
||||
<!-- 预览区域 -->
|
||||
<wd-card class="setting-section">
|
||||
<view class="section-header">
|
||||
<wd-icon name="eye" size="20" color="#666" />
|
||||
<wd-icon name="eye" size="20" />
|
||||
<text class="section-title">效果预览</text>
|
||||
</view>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<wd-grid :column="2" border>
|
||||
<wd-grid-item>
|
||||
<wd-button type="primary" size="small">主要按钮</wd-button>
|
||||
<wd-button type="primary">主要按钮</wd-button>
|
||||
</wd-grid-item>
|
||||
<wd-grid-item>
|
||||
<text class="preview-text" :style="{ color: currentThemeColor }">主题色文本</text>
|
||||
@@ -353,7 +353,7 @@ onShow(() => {
|
||||
|
||||
.color-name {
|
||||
font-size: 22rpx;
|
||||
color: var(--wot-color-text-secondary, #666);
|
||||
color: var(--wot-color-text-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export const useThemeStore = defineStore("theme", () => {
|
||||
|
||||
// 设置导航栏颜色
|
||||
const setNavigationBarColor = () => {
|
||||
console.log("设置导航栏颜色", theme.value);
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: theme.value === "light" ? "#000000" : "#ffffff",
|
||||
backgroundColor: theme.value === "light" ? "#ffffff" : "#000000",
|
||||
|
||||
Reference in New Issue
Block a user