refactor: migrate legacy color classes to inline tailwind text utilities

Replace all usages of legacy `.color-*` and `.text-color-*` SCSS utility classes with inline Tailwind `text-[#hexcode]` arbitrary value classes. Remove the deprecated `src/static/scss/colors.scss` file, and fix minor formatting/indentation issues across multiple component files.
This commit is contained in:
duanshuwen
2026-07-24 21:38:17 +08:00
parent 01fdf80a72
commit 5f06d8ef11
67 changed files with 282 additions and 505 deletions

View File

@@ -2,7 +2,7 @@
<!-- 外层行容器接收来自父组件的对齐类 flex flex-justify-end -->
<view class="chat-mine-row">
<view class="chat-mine bg-[#17294e]">
<text class="font-size-15 color-white">{{ text }}</text>
<text class="font-size-15 text-white">{{ text }}</text>
<slot></slot>
</view>
</view>

View File

@@ -1,6 +1,6 @@
<template>
<view class="w-full flex flex-col overflow-hidden pl-[12px] mt-6 mb-6">
<text class="font-size-14 color-333">{{ text }}</text>
<text class="font-size-14 text-[#333333]">{{ text }}</text>
<slot></slot>
</view>
</template>

View File

@@ -1,82 +1,35 @@
<template>
<view
class="input-area-wrapper"
@touchend="handleVoiceTouchEndFromContainer"
@touchcancel="handleVoiceTouchEndFromContainer"
>
<view class="input-area-wrapper" @touchend="handleVoiceTouchEndFromContainer"
@touchcancel="handleVoiceTouchEndFromContainer">
<view v-if="!visibleWaveBtn || speechProvider !== 'wechat'" class="area-input">
<!-- 语音/键盘切换 -->
<view
v-if="isSpeechRecognitionSupported"
class="input-container-voice"
@click="toggleVoiceMode"
>
<image
class="voice-icon"
v-if="!isVoiceMode"
src="https://oss.nianxx.cn/mp/static/version_101/home/input_voice_icon.png"
/>
<image
class="voice-icon"
v-else
src="https://oss.nianxx.cn/mp/static/version_101/home/input_keyboard_icon.png"
/>
<view v-if="isSpeechRecognitionSupported" class="input-container-voice" @click="toggleVoiceMode">
<image class="voice-icon" v-if="!isVoiceMode"
src="https://oss.nianxx.cn/mp/static/version_101/home/input_voice_icon.png" />
<image class="voice-icon" v-else
src="https://oss.nianxx.cn/mp/static/version_101/home/input_keyboard_icon.png" />
</view>
<!-- 输入框/语音按钮容器 -->
<view
class="input-button-container"
:class="{ 'input-button-container--no-voice': !isSpeechRecognitionSupported }"
>
<textarea
ref="textareaRef"
v-if="!isVoiceMode"
class="textarea"
type="text"
cursor-spacing="20"
confirm-type="send"
v-model="inputMessage"
auto-height
:focus="isFocused"
:confirm-hold="true"
:placeholder="placeholder"
:show-confirm-bar="false"
:hold-keyboard="holdKeyboard"
:adjust-position="true"
:disable-default-padding="true"
maxlength="300"
@confirm="sendMessage"
@focus="handleFocus"
@blur="handleBlur"
@touchstart="handleTouchStart"
@touchend="handleTouchEnd"
/>
<view class="input-button-container"
:class="{ 'input-button-container--no-voice': !isSpeechRecognitionSupported }">
<textarea ref="textareaRef" v-if="!isVoiceMode" class="textarea" type="text" cursor-spacing="20"
confirm-type="send" v-model="inputMessage" auto-height :focus="isFocused" :confirm-hold="true"
:placeholder="placeholder" :show-confirm-bar="false" :hold-keyboard="holdKeyboard" :adjust-position="true"
:disable-default-padding="true" maxlength="300" @confirm="sendMessage" @focus="handleFocus" @blur="handleBlur"
@touchstart="handleTouchStart" @touchend="handleTouchEnd" />
<!-- #ifdef MP-WEIXIN -->
<view
v-if="isVoiceMode"
class="hold-to-talk-button"
@longpress="handleVoiceTouchStart"
@touchend="handleVoiceTouchEnd"
@touchcancel="handleVoiceTouchEnd"
>
<view v-if="isVoiceMode" class="hold-to-talk-button" @longpress="handleVoiceTouchStart"
@touchend="handleVoiceTouchEnd" @touchcancel="handleVoiceTouchEnd">
按住 说话
</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view
v-if="isVoiceMode"
class="hold-to-talk-button"
@touchstart="handleVoiceTouchStart"
@touchend="handleVoiceTouchEnd"
@touchcancel="handleVoiceTouchEnd"
>
<RecordingWaveBtn
v-if="visibleWaveBtn"
class="recording-wave-inline"
ref="recordingWaveBtnRef"
/>
<view v-if="isVoiceMode" class="hold-to-talk-button" @touchstart="handleVoiceTouchStart"
@touchend="handleVoiceTouchEnd" @touchcancel="handleVoiceTouchEnd">
<RecordingWaveBtn v-if="visibleWaveBtn" class="recording-wave-inline" ref="recordingWaveBtnRef" />
<text v-else>按住 说话</text>
</view>
<!-- #endif -->
@@ -85,11 +38,7 @@
<view class="input-container-send">
<view class="input-container-send-btn" @click="sendMessage">
<view v-if="props.isSessionActive" class="send-stop"> </view>
<image
v-else
class="send-icon"
src="https://oss.nianxx.cn/mp/static/version_101/home/input_send_icon.png"
/>
<image v-else class="send-icon" src="https://oss.nianxx.cn/mp/static/version_101/home/input_send_icon.png" />
</view>
</view>
</view>
@@ -100,17 +49,11 @@
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<yao-asdRealSpeech
v-if="isSpeechRecognitionSupported && appSpeechVisible"
:key="appSpeechKey"
ref="appSpeechRef"
:options="appSpeechOptions"
@result="handleAppSpeechResult"
@change="handleAppSpeechChange"
/>
<yao-asdRealSpeech v-if="isSpeechRecognitionSupported && appSpeechVisible" :key="appSpeechKey" ref="appSpeechRef"
:options="appSpeechOptions" @result="handleAppSpeechResult" @change="handleAppSpeechChange" />
<!-- #endif -->
<view class="color-99A0AE font-size-9 text-center text-gray-400">
<view class="text-[#99a0ae] font-size-9 text-center text-gray-400">
内容由AI大模型生成请仔细鉴别
</view>
</view>

View File

@@ -5,7 +5,7 @@
@click="sendReply(item)">
<view class="flex items-center justify-center">
<image v-if="item.icon" class="icon" :src="item.icon" />
<text class="font-size-14 theme-color-500 leading-[20px]">
<text class="font-size-14 text-[#0CCD58] leading-[20px]">
{{ item.title }}
</text>
</view>

View File

@@ -12,7 +12,7 @@
:totalFrames="spriteStyle.totalFrames" :columns="spriteStyle.columns" :displayWidth="spriteStyle.displayWidth"
:fps="16" />
<text v-show="show" :class="[
'font-size-14 font-500 color-171717 ml-10',
'font-size-14 font-500 text-[#171717] ml-10',
{ 'text-animated': show },
]">
{{ config.name }}

View File

@@ -6,7 +6,7 @@ v
<SpriteAnimator :src="spriteStyle.ipLargeImage" :frameWidth="spriteStyle.frameWidth"
:frameHeight="spriteStyle.frameHeight" :totalFrames="spriteStyle.totalFrames" :columns="spriteStyle.columns"
:displayWidth="spriteStyle.displayWidth" :fps="16" />
<view class="welcome-text font-size-14 font-500 font-family-misans-vf color-171717 leading-[24px]">
<view class="welcome-text font-size-14 font-500 font-family-misans-vf text-[#171717] leading-[24px]">
{{ welcomeContent }}
</view>
</view>

View File

@@ -150,7 +150,7 @@ const weatherTextMap = {
.home-welcome-title {
flex: 1;
min-width: 0;
color: $text-color-900;
color: $text-[#0B5C2D];
font-size: 21px;
line-height: 28px;
font-weight: 900;

View File

@@ -11,14 +11,14 @@
<image v-if="coverImage" class="w-full h-auto block" :src="coverImage" mode="widthFix" />
<view class="pt-[16px] px-[12px] pb-[24px] border-box">
<view class="color-171717 font-size-16 font-weight-600">{{ detailTitle }}</view>
<view class="text-[#171717] font-size-16 font-weight-600">{{ detailTitle }}</view>
<view v-if="publishTime" class="notice-time-tag flex flex-row flex-items-center mt-16">
<uni-icons type="clock" size="18" color="#5A6780" />
<text class="color-171717 font-size-12 font-weight-600 ml-8">发布时间{{ publishTime }}</text>
<text class="text-[#171717] font-size-12 font-weight-600 ml-8">发布时间{{ publishTime }}</text>
</view>
<view class="mt-20 pt-[16px] color-666 font-size-14 leading-[20px] border-top">{{ noticeContent }}</view>
<view class="mt-20 pt-[16px] text-[#666666] font-size-14 leading-[20px] border-top">{{ noticeContent }}</view>
</view>
</view>
</scroll-view>

View File

@@ -105,11 +105,12 @@ const clickItem = (item) => {
}
.text-color {
color: $text-color-900;
color: $text-[#0B5C2D];
}
.underline-text {
text-decoration: underline;
text-decoration-color: $text-color-400;
text-decoration-color: $text-[#35F37F];
color: $text-color-400;
}
@@ -128,11 +129,10 @@ const clickItem = (item) => {
}
.noMessage-text {
color: $text-color-900;
color: $text-[#0B5C2D];
line-height: 16px;
white-space: normal;
overflow-wrap: break-word;
word-break: break-all;
}
</style>