chore: 升级 wot-ui 至 2.2.0 并适配暗黑模式主题色

- ConfigProvider 全局配置 button 默认类型、tag 默认变体
- 清理模板中重复的 type=primary 和 variant=plain
- 静态资源 logo.png 迁至 src/static/images/
- 暗黑模式 --wot-filled-oppo 统一组件背景色
This commit is contained in:
Ray.Hao
2026-07-23 23:13:21 +08:00
parent ce01e3cff8
commit 4dd142bb5a
25 changed files with 52 additions and 40 deletions

6
components.d.ts vendored
View File

@@ -19,11 +19,14 @@ declare module 'vue' {
QiunError: typeof import('./src/components/qiun-error/qiun-error.vue')['default']
QiunLoading: typeof import('./src/components/qiun-loading/qiun-loading.vue')['default']
WdActionSheet: typeof import('@wot-ui/ui/components/wd-action-sheet/wd-action-sheet.vue')['default']
WdBadge: typeof import('@wot-ui/ui/components/wd-badge/wd-badge.vue')['default']
WdButton: typeof import('@wot-ui/ui/components/wd-button/wd-button.vue')['default']
WdCalendar: typeof import('@wot-ui/ui/components/wd-calendar/wd-calendar.vue')['default']
WdCard: typeof import('@wot-ui/ui/components/wd-card/wd-card.vue')['default']
WdCascader: typeof import('@wot-ui/ui/components/wd-cascader/wd-cascader.vue')['default']
WdCell: typeof import('@wot-ui/ui/components/wd-cell/wd-cell.vue')['default']
WdCellGroup: typeof import('@wot-ui/ui/components/wd-cell-group/wd-cell-group.vue')['default']
WdCheckbox: typeof import('@wot-ui/ui/components/wd-checkbox/wd-checkbox.vue')['default']
WdCollapse: typeof import('@wot-ui/ui/components/wd-collapse/wd-collapse.vue')['default']
WdCollapseItem: typeof import('@wot-ui/ui/components/wd-collapse-item/wd-collapse-item.vue')['default']
WdConfigProvider: typeof import('@wot-ui/ui/components/wd-config-provider/wd-config-provider.vue')['default']
@@ -35,6 +38,8 @@ declare module 'vue' {
WdFab: typeof import('@wot-ui/ui/components/wd-fab/wd-fab.vue')['default']
WdForm: typeof import('@wot-ui/ui/components/wd-form/wd-form.vue')['default']
WdFormItem: typeof import('@wot-ui/ui/components/wd-form-item/wd-form-item.vue')['default']
WdGrid: typeof import('@wot-ui/ui/components/wd-grid/wd-grid.vue')['default']
WdGridItem: typeof import('@wot-ui/ui/components/wd-grid-item/wd-grid-item.vue')['default']
WdIcon: typeof import('@wot-ui/ui/components/wd-icon/wd-icon.vue')['default']
WdImgCropper: typeof import('@wot-ui/ui/components/wd-img-cropper/wd-img-cropper.vue')['default']
WdInput: typeof import('@wot-ui/ui/components/wd-input/wd-input.vue')['default']
@@ -47,6 +52,7 @@ declare module 'vue' {
WdRadioGroup: typeof import('@wot-ui/ui/components/wd-radio-group/wd-radio-group.vue')['default']
WdSearch: typeof import('@wot-ui/ui/components/wd-search/wd-search.vue')['default']
WdSelectPicker: typeof import('@wot-ui/ui/components/wd-select-picker/wd-select-picker.vue')['default']
WdSwiper: typeof import('@wot-ui/ui/components/wd-swiper/wd-swiper.vue')['default']
WdSwitch: typeof import('@wot-ui/ui/components/wd-switch/wd-switch.vue')['default']
WdTabbar: typeof import('@wot-ui/ui/components/wd-tabbar/wd-tabbar.vue')['default']
WdTabbarItem: typeof import('@wot-ui/ui/components/wd-tabbar-item/wd-tabbar-item.vue')['default']

View File

@@ -96,7 +96,7 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-4020420240722002",
"@uni-helper/uni-use": "^0.19.15",
"@vueuse/core": "9.13.0",
"@wot-ui/ui": "2.0.8",
"@wot-ui/ui": "^2.2.0",
"dayjs": "^1.11.13",
"pinia": "^2.3.1",
"vue": "^3.5.22",

View File

@@ -21,6 +21,8 @@ export default {
:theme-vars="themeVars"
:custom-class="theme === 'dark' ? 'dark' : ''"
:theme="theme === 'dark' ? 'dark' : ''"
:button="{ type: 'primary' }"
:tag="{ variant: 'plain' }"
>
<slot />
<wd-notify />

View File

@@ -1,6 +1,6 @@
<template>
<view :class="`wot-theme-${theme}`" :style="themeCSSVars">
<wd-config-provider :theme-vars="themeVars" :theme="theme === 'dark' ? 'dark' : ''">
<wd-config-provider :theme-vars="themeVars" :theme="theme === 'dark' ? 'dark' : ''" :button="{ type: 'primary' }" :tag="{ variant: 'plain' }">
<slot />
<wd-tabbar
v-model="active"

View File

@@ -21,7 +21,7 @@
<view class="login__body" :style="{ paddingTop: `${statusBarHeight + navBarHeight + 4}px` }">
<!-- Logo -->
<view class="login__brand">
<image class="login__logo" src="/logo.png" mode="aspectFit" />
<image class="login__logo" src="/static/images/logo.png" mode="aspectFit" />
<text class="login__brand-name">youlai-app</text>
</view>
@@ -120,7 +120,7 @@
<!-- 登录按钮 -->
<view class="login__form-item">
<wd-button type="primary" block :loading="isLoading" @click="handleLogin">
<wd-button block :loading="isLoading" @click="handleLogin">
</wd-button>
</view>
@@ -243,7 +243,7 @@
<text class="login__demo-hint-text">演示环境验证码123456</text>
</view>
<wd-button type="primary" block :loading="isBindLoading" @click="handleBindMobile">
<wd-button block :loading="isBindLoading" @click="handleBindMobile">
确认绑定
</wd-button>
</view>

View File

@@ -2,7 +2,7 @@
<view class="page page--padding">
<wd-card>
<view class="about__header">
<image class="about__logo" src="/logo.png" mode="aspectFit" />
<image class="about__logo" src="/static/images/logo.png" mode="aspectFit" />
<view class="about__info">
<text class="about__app-title">youlai-app</text>
<text class="about__app-version">版本 {{ version }}</text>
@@ -172,7 +172,7 @@
{{ currentProject.summary }}
</view>
<view class="about__popup-action">
<wd-button type="primary" block @click="goCurrentProjectRepo">去仓库</wd-button>
<wd-button block @click="goCurrentProjectRepo">去仓库</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -74,7 +74,7 @@
/>
</wd-cell-group>
<view class="p-24rpx">
<wd-button type="primary" size="large" block @click="handleSubmit">提交</wd-button>
<wd-button size="large" block @click="handleSubmit">提交</wd-button>
</view>
</wd-form>
<wd-form
@@ -104,6 +104,7 @@
>
<template #suffix>
<wd-button
type=""
plain
:disabled="mobileCountdown > 0"
@click="handleSendVerificationCode('MOBILE')"
@@ -114,7 +115,7 @@
</wd-input>
</wd-cell-group>
<view class="p-24rpx">
<wd-button type="primary" size="large" block @click="handleSubmit">提交</wd-button>
<wd-button size="large" block @click="handleSubmit">提交</wd-button>
</view>
</wd-form>
<wd-form
@@ -144,6 +145,7 @@
>
<template #suffix>
<wd-button
type=""
plain
:disabled="emailCountdown > 0"
@click="handleSendVerificationCode('EMAIL')"
@@ -154,7 +156,7 @@
</wd-input>
</wd-cell-group>
<view class="p-24rpx">
<wd-button type="primary" size="large" block @click="handleSubmit">提交</wd-button>
<wd-button size="large" block @click="handleSubmit">提交</wd-button>
</view>
</wd-form>
</wd-popup>

View File

@@ -65,7 +65,7 @@
</view>
<view v-if="!isLogin" class="profile-card__action" @click.stop="navigateToLogin()">
<wd-button custom-class="profile-card__button" size="small" type="primary">
<wd-button custom-class="profile-card__button" size="small">
立即登录
</wd-button>
</view>
@@ -81,7 +81,7 @@
/>
<view class="community-card__mask" />
<view class="community-card__logo">
<image src="/logo.png" mode="aspectFit" class="w-full h-full" />
<image src="/static/images/logo.png" mode="aspectFit" class="w-full h-full" />
</view>
<view class="community-card__body">
<view class="community-card__title-row">

View File

@@ -104,7 +104,6 @@
<view class="profile-footer">
<wd-button
class="profile-footer__submit"
type="primary"
size="large"
block
:disabled="!canComplete || isLoading"

View File

@@ -68,7 +68,7 @@
</wd-cell>
</wd-cell-group>
<view class="edit-form__submit">
<wd-button type="primary" size="large" block @click="handleSubmit">提交</wd-button>
<wd-button size="large" block @click="handleSubmit">提交</wd-button>
</view>
</wd-form>
</wd-popup>

View File

@@ -14,7 +14,7 @@
</wd-collapse>
<view class="agreement__action">
<wd-button type="primary" block @click="handleAgree">我已阅读并同意</wd-button>
<wd-button block @click="handleAgree">我已阅读并同意</wd-button>
</view>
</view>
</template>

View File

@@ -14,7 +14,7 @@
</wd-collapse>
<view class="privacy__action">
<wd-button type="primary" block @click="handleAgree">我已阅读并同意</wd-button>
<wd-button block @click="handleAgree">我已阅读并同意</wd-button>
</view>
</view>
</template>

View File

@@ -55,11 +55,11 @@
<wd-cell>
<template #default>
<view class="flex items-center justify-center gap-24rpx py-12rpx">
<wd-button type="primary" size="small">主要按钮</wd-button>
<wd-button size="small">主要按钮</wd-button>
<text class="text-28rpx font-500" :style="{ color: currentThemeColor }">
主题色文本
</text>
<wd-tag type="primary" size="small">标签</wd-tag>
<wd-tag type="primary" size="small" variant="filled">标签</wd-tag>
</view>
</template>
</wd-cell>
@@ -67,7 +67,7 @@
<!-- 操作按钮 -->
<view class="mt-32rpx">
<wd-button type="primary" plain size="large" block @click="handleResetTheme">
<wd-button plain size="large" block @click="handleResetTheme">
重置为默认主题
</wd-button>
</view>
@@ -102,7 +102,7 @@
<view class="popup-actions">
<wd-button type="info" plain @click="showCustomColorInput = false">取消</wd-button>
<wd-button type="primary" @click="applyCustomColor">应用</wd-button>
<wd-button @click="applyCustomColor">应用</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -12,14 +12,14 @@
<view class="qr-confirm__body" :style="{ paddingTop: `${statusBarHeight + navBarHeight + 24}px` }">
<view class="qr-confirm__card">
<image class="qr-confirm__logo" src="/logo.png" mode="aspectFit" />
<image class="qr-confirm__logo" src="/static/images/logo.png" mode="aspectFit" />
<text class="qr-confirm__tip">PC 端扫码登录</text>
<text class="qr-confirm__user">{{ scanResult?.nickname || "未知用户" }}</text>
<text class="qr-confirm__hint">是否确认在 PC 端登录</text>
<view class="qr-confirm__actions">
<wd-button type="error" plain block @click="handleCancel">取消登录</wd-button>
<wd-button type="primary" block :loading="isLoading" @click="handleConfirm">确认登录</wd-button>
<wd-button block :loading="isLoading" @click="handleConfirm">确认登录</wd-button>
</view>
</view>
</view>

View File

@@ -72,7 +72,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeConfigDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitConfigForm">
<wd-button :loading="isSubmitting" @click="submitConfigForm">
保存
</wd-button>
</view>

View File

@@ -77,7 +77,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeDeptDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitDeptForm">保存</wd-button>
<wd-button :loading="isSubmitting" @click="submitDeptForm">保存</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -23,7 +23,7 @@
</view>
<text class="text-24rpx color-text-secondary">字典编码{{ item.dictCode }}</text>
</view>
<wd-tag :type="item.status === 1 ? 'success' : 'danger'" variant="plain">
<wd-tag :type="item.status === 1 ? 'success' : 'danger'">
{{ item.status === 1 ? "启用" : "禁用" }}
</wd-tag>
</view>
@@ -75,7 +75,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeDictDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitDictForm">保存</wd-button>
<wd-button :loading="isSubmitting" @click="submitDictForm">保存</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -25,7 +25,7 @@
字典值{{ item.value }} · 排序{{ item.sort }}
</text>
</view>
<wd-tag :type="item.status === 1 ? 'success' : 'danger'" variant="plain">
<wd-tag :type="item.status === 1 ? 'success' : 'danger'">
{{ item.status === 1 ? "启用" : "禁用" }}
</wd-tag>
</view>
@@ -80,7 +80,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeItemDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitItemForm">保存</wd-button>
<wd-button :loading="isSubmitting" @click="submitItemForm">保存</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -103,7 +103,7 @@
</scroll-view>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeMenuDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitMenuForm">保存</wd-button>
<wd-button :loading="isSubmitting" @click="submitMenuForm">保存</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -27,7 +27,7 @@
{{ item.publisherName || "系统管理员" }}
</text>
</view>
<wd-tag :type="getStatusType(item.publishStatus)" variant="plain">
<wd-tag :type="getStatusType(item.publishStatus)">
{{ getStatusText(item.publishStatus) }}
</wd-tag>
</view>
@@ -134,7 +134,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeNoticeForm">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitNoticeForm">
<wd-button :loading="isSubmitting" @click="submitNoticeForm">
保存
</wd-button>
</view>

View File

@@ -9,8 +9,8 @@
<view class="action-bar">
<view class="action-bar__left">
<wd-button size="small" variant="plain" @click="handleSelectAll">全选</wd-button>
<wd-button size="small" variant="plain" @click="handleClearAll">取消全选</wd-button>
<wd-button type="" size="small" variant="plain" @click="handleSelectAll">全选</wd-button>
<wd-button type="" size="small" variant="plain" @click="handleClearAll">取消全选</wd-button>
</view>
</view>
</view>
@@ -70,7 +70,7 @@
<!-- 固定底部操作栏 -->
<view class="bottom-bar">
<wd-button type="info" variant="plain" @click="handleCancel">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="handleSubmit">保存</wd-button>
<wd-button :loading="isSubmitting" @click="handleSubmit">保存</wd-button>
</view>
</view>
</template>

View File

@@ -25,7 +25,7 @@
</view>
<text class="role-card__code">{{ item.code }}</text>
</view>
<wd-tag :type="item.status === 1 ? 'success' : 'danger'" variant="plain">
<wd-tag :type="item.status === 1 ? 'success' : 'danger'">
{{ item.status === 1 ? "正常" : "禁用" }}
</wd-tag>
</view>
@@ -102,7 +102,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeRoleDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitRoleForm">保存</wd-button>
<wd-button :loading="isSubmitting" @click="submitRoleForm">保存</wd-button>
</view>
</view>
</wd-popup>

View File

@@ -34,7 +34,7 @@
<cu-date-query v-model="queryParams.createTime" label="创建时间" />
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="resetUserFilter">重置</wd-button>
<wd-button type="primary" @click="applyUserFilter">查询</wd-button>
<wd-button @click="applyUserFilter">查询</wd-button>
</view>
</view>
</wd-drop-menu-item>
@@ -71,7 +71,7 @@
</view>
<text class="user-card__role">{{ item.roleNames }} · {{ item.deptName }}</text>
</view>
<wd-tag :type="item.status === 1 ? 'success' : 'danger'" variant="plain">
<wd-tag :type="item.status === 1 ? 'success' : 'danger'">
{{ item.status === 1 ? "正常" : "禁用" }}
</wd-tag>
</view>
@@ -174,7 +174,7 @@
</wd-form>
<view class="popup-actions">
<wd-button type="info" variant="plain" @click="closeUserDialog">取消</wd-button>
<wd-button type="primary" :loading="isSubmitting" @click="submitUserForm">保存</wd-button>
<wd-button :loading="isSubmitting" @click="submitUserForm">保存</wd-button>
</view>
</view>
</wd-popup>
@@ -204,7 +204,6 @@
取消
</wd-button>
<wd-button
type="primary"
:loading="resetPwdDialog.isSubmitting"
@click="handleResetPassword"
>

BIN
src/static/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -176,4 +176,8 @@ page {
// 以下只保留主色调自定义,其余交给 Wot UI 官方暗黑模式
// -----------------------------------------------------------------------
--wot-color-theme: var(--color-primary);
// Wot UI 的 card / cell / input / grid / popup 等 40+ 组件默认用纯黑填充,
// 与项目 --color-bg深蓝灰产生色差。统一指向项目主背景。
--wot-filled-oppo: var(--color-bg);
}