first commit
This commit is contained in:
1092
apps/miniprogram/pages/settings/index.js
Normal file
1092
apps/miniprogram/pages/settings/index.js
Normal file
File diff suppressed because it is too large
Load Diff
7
apps/miniprogram/pages/settings/index.json
Normal file
7
apps/miniprogram/pages/settings/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "设置",
|
||||
"disableScroll": true,
|
||||
"usingComponents": {
|
||||
"bottom-nav": "/components/bottom-nav/index"
|
||||
}
|
||||
}
|
||||
601
apps/miniprogram/pages/settings/index.wxml
Normal file
601
apps/miniprogram/pages/settings/index.wxml
Normal file
@@ -0,0 +1,601 @@
|
||||
<view class="page-root settings-page" style="{{themeStyle}}">
|
||||
<view class="settings-tabs">
|
||||
<block wx:for="{{tabs}}" wx:key="id">
|
||||
<button class="settings-tab-btn {{activeTab === item.id ? 'active' : ''}}" data-tab="{{item.id}}" bindtap="onTabTap">{{item.label}}</button>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="page-content">
|
||||
<scroll-view class="surface-scroll" scroll-y="true">
|
||||
<view class="surface-panel settings-panel">
|
||||
<view class="actions settings-header-actions">
|
||||
<text class="settings-save-status">{{saveStatusText}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{activeTab === 'ui'}}" class="settings-sections">
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.languageTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.languageDesc}}</text>
|
||||
</view>
|
||||
<scroll-view class="pill-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="pill-row">
|
||||
<block wx:for="{{uiLanguageOptions}}" wx:key="value">
|
||||
<view
|
||||
class="pill-chip {{uiLanguageIndex === index ? 'active' : ''}}"
|
||||
data-key="uiLanguage"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.uiTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.uiDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.themeMode}}</text>
|
||||
<view class="segment-control">
|
||||
<block wx:for="{{uiThemeModeOptions}}" wx:key="value">
|
||||
<view
|
||||
class="segment-item {{uiThemeModeIndex === index ? 'active' : ''}}"
|
||||
data-key="uiThemeMode"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.themePreset}}</text>
|
||||
<scroll-view class="pill-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="pill-row">
|
||||
<block wx:for="{{uiThemePresetOptions}}" wx:key="value">
|
||||
<view
|
||||
class="pill-chip {{uiThemePresetIndex === index ? 'active' : ''}}"
|
||||
data-key="uiThemePreset"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.uiAccentColor}}</text>
|
||||
<view class="input color-trigger" data-key="uiAccentColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.uiAccentColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'uiAccentColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.uiAccentColor === item.value ? 'active' : ''}}"
|
||||
data-key="uiAccentColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.uiBgColor}}</text>
|
||||
<view class="input color-trigger" data-key="uiBgColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.uiBgColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'uiBgColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.uiBgColor === item.value ? 'active' : ''}}"
|
||||
data-key="uiBgColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.uiTextColor}}</text>
|
||||
<view class="input color-trigger" data-key="uiTextColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.uiTextColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'uiTextColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.uiTextColor === item.value ? 'active' : ''}}"
|
||||
data-key="uiTextColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.uiBtnColor}}</text>
|
||||
<view class="input color-trigger" data-key="uiBtnColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.uiBtnColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'uiBtnColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.uiBtnColor === item.value ? 'active' : ''}}"
|
||||
data-key="uiBtnColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{activeTab === 'shell'}}" class="settings-sections">
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.shellDisplayTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.shellDisplayDesc}}</text>
|
||||
</view>
|
||||
<view
|
||||
class="terminal-style-preview"
|
||||
style="background: {{form.shellBgColor}}; color: {{form.shellTextColor}}; font-family: {{form.shellFontFamily}}; font-size: {{form.shellFontSize}}px; line-height: {{form.shellLineHeight}};"
|
||||
>
|
||||
<text class="terminal-style-preview-line">Last login: Sat Feb 28 20:49:12 2026 from 115.193.12.66</text>
|
||||
<text class="terminal-style-preview-line">
|
||||
<text class="terminal-style-preview-prompt" style="color: {{form.shellAccentColor}};">gavin mini ~ %</text> ls -la
|
||||
</text>
|
||||
<text class="terminal-style-preview-line">drwxr-xr-x 4 gavin staff 128 Feb 28 20:49 workspace</text>
|
||||
<text class="terminal-style-preview-line">{{terminalPreviewLine}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.themeMode}}</text>
|
||||
<view class="segment-control">
|
||||
<block wx:for="{{shellThemeModeOptions}}" wx:key="value">
|
||||
<view
|
||||
class="segment-item {{shellThemeModeIndex === index ? 'active' : ''}}"
|
||||
data-key="shellThemeMode"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.themePreset}}</text>
|
||||
<scroll-view class="pill-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="pill-row">
|
||||
<block wx:for="{{shellThemePresetOptions}}" wx:key="value">
|
||||
<view
|
||||
class="pill-chip {{shellThemePresetIndex === index ? 'active' : ''}}"
|
||||
data-key="shellThemePreset"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.shellBgColor}}</text>
|
||||
<view class="input color-trigger" data-key="shellBgColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.shellBgColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'shellBgColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.shellBgColor === item.value ? 'active' : ''}}"
|
||||
data-key="shellBgColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.shellTextColor}}</text>
|
||||
<view class="input color-trigger" data-key="shellTextColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.shellTextColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'shellTextColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.shellTextColor === item.value ? 'active' : ''}}"
|
||||
data-key="shellTextColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field color-field">
|
||||
<text>{{copy.fields.shellAccentColor}}</text>
|
||||
<view class="input color-trigger" data-key="shellAccentColor" bindtap="onToggleColorPanel">
|
||||
<view class="color-bar">
|
||||
<view class="color-bar-fill" style="background: {{form.shellAccentColor}};"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{activeColorPanelKey === 'shellAccentColor'}}" class="color-palette-grid">
|
||||
<block wx:for="{{colorPaletteOptions}}" wx:key="value">
|
||||
<view
|
||||
class="palette-swatch-wrap {{form.shellAccentColor === item.value ? 'active' : ''}}"
|
||||
data-key="shellAccentColor"
|
||||
data-color="{{item.value}}"
|
||||
bindtap="onPickPaletteColor"
|
||||
>
|
||||
<view class="palette-swatch" style="background: {{item.value}};"></view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field pill-field">
|
||||
<text>{{copy.fields.shellFontFamily}}</text>
|
||||
<view class="field-stack">
|
||||
<scroll-view class="pill-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="pill-row">
|
||||
<block wx:for="{{shellFontFamilyOptions}}" wx:key="value">
|
||||
<view
|
||||
class="pill-chip font-pill {{shellFontFamilyIndex === index ? 'active' : ''}}"
|
||||
data-key="shellFontFamily"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.shellFontSize}}</text>
|
||||
<view class="field-inline-row">
|
||||
<text class="field-hint field-hint-inline">{{copy.hints.shellFontSizeReconnect}}</text>
|
||||
<input
|
||||
class="input field-inline-input"
|
||||
type="number"
|
||||
value="{{form.shellFontSize}}"
|
||||
data-key="shellFontSize"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.shellLineHeight}}</text>
|
||||
<view class="field-stack">
|
||||
<input class="input" type="number" value="{{form.shellLineHeight}}" data-key="shellLineHeight" bindinput="onInput" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.unicode11}}</text>
|
||||
<switch checked="{{form.unicode11}}" color="#67d1ff" data-key="unicode11" bindchange="onSwitch" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.shellActivationDebugOutline}}</text>
|
||||
<view class="field-stack">
|
||||
<text class="field-hint">{{copy.hints.shellActivationDebugOutline}}</text>
|
||||
</view>
|
||||
<switch
|
||||
checked="{{form.shellActivationDebugOutline}}"
|
||||
color="#67d1ff"
|
||||
data-key="shellActivationDebugOutline"
|
||||
bindchange="onSwitch"
|
||||
/>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.showVoiceInputButton}}</text>
|
||||
<view class="field-stack">
|
||||
<text class="field-hint">{{copy.hints.showVoiceInputButton}}</text>
|
||||
</view>
|
||||
<switch
|
||||
checked="{{form.showVoiceInputButton}}"
|
||||
color="#67d1ff"
|
||||
data-key="showVoiceInputButton"
|
||||
bindchange="onSwitch"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.ttsTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.ttsDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.ttsSpeakableMaxChars}}</text>
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
value="{{form.ttsSpeakableMaxChars}}"
|
||||
data-key="ttsSpeakableMaxChars"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.ttsSegmentMaxChars}}</text>
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
value="{{form.ttsSegmentMaxChars}}"
|
||||
data-key="ttsSegmentMaxChars"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.shellBufferTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.shellBufferDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.shellBufferMaxEntries}}</text>
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
value="{{form.shellBufferMaxEntries}}"
|
||||
data-key="shellBufferMaxEntries"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.shellBufferMaxBytes}}</text>
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
value="{{form.shellBufferMaxBytes}}"
|
||||
data-key="shellBufferMaxBytes"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.shellBufferSnapshotMaxLines}}</text>
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
value="{{form.shellBufferSnapshotMaxLines}}"
|
||||
data-key="shellBufferSnapshotMaxLines"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{activeTab === 'connection'}}" class="settings-sections">
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.connectionTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.connectionDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.autoReconnect}}</text>
|
||||
<switch checked="{{form.autoReconnect}}" color="#67d1ff" data-key="autoReconnect" bindchange="onSwitch" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.reconnectLimit}}</text>
|
||||
<input class="input" type="number" value="{{form.reconnectLimit}}" data-key="reconnectLimit" bindinput="onInput" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.backgroundSessionKeepAliveMinutes}}</text>
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
value="{{form.backgroundSessionKeepAliveMinutes}}"
|
||||
data-key="backgroundSessionKeepAliveMinutes"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.defaultAuthType}}</text>
|
||||
<view class="segment-control">
|
||||
<block wx:for="{{defaultAuthTypeOptions}}" wx:key="value">
|
||||
<view
|
||||
class="segment-item {{defaultAuthTypeIndex === index ? 'active' : ''}}"
|
||||
data-key="defaultAuthType"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.defaultPort}}</text>
|
||||
<input class="input" type="number" value="{{form.defaultPort}}" data-key="defaultPort" bindinput="onInput" />
|
||||
</view>
|
||||
<view class="field wide">
|
||||
<text>{{copy.fields.defaultProjectPath}}</text>
|
||||
<input class="input" value="{{form.defaultProjectPath}}" placeholder="{{copy.placeholders.defaultProjectPath}}" data-key="defaultProjectPath" bindinput="onInput" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.defaultTimeoutSeconds}}</text>
|
||||
<input class="input" type="number" value="{{form.defaultTimeoutSeconds}}" data-key="defaultTimeoutSeconds" bindinput="onInput" />
|
||||
</view>
|
||||
<view class="field">
|
||||
<text>{{copy.fields.defaultHeartbeatSeconds}}</text>
|
||||
<input class="input" type="number" value="{{form.defaultHeartbeatSeconds}}" data-key="defaultHeartbeatSeconds" bindinput="onInput" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.aiConnectionTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.aiConnectionDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.aiDefaultProvider}}</text>
|
||||
<view class="segment-control">
|
||||
<block wx:for="{{aiProviderOptions}}" wx:key="value">
|
||||
<view
|
||||
class="segment-item {{aiDefaultProviderIndex === index ? 'active' : ''}}"
|
||||
data-key="aiDefaultProvider"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field pill-field">
|
||||
<text>{{copy.fields.aiCodexSandboxMode}}</text>
|
||||
<view class="field-stack">
|
||||
<scroll-view class="pill-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="pill-row">
|
||||
<block wx:for="{{aiCodexSandboxOptions}}" wx:key="value">
|
||||
<view
|
||||
class="pill-chip {{aiCodexSandboxModeIndex === index ? 'active' : ''}}"
|
||||
data-key="aiCodexSandboxMode"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field pill-field">
|
||||
<text>{{copy.fields.aiCopilotPermissionMode}}</text>
|
||||
<view class="field-stack">
|
||||
<scroll-view class="pill-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="pill-row">
|
||||
<block wx:for="{{aiCopilotPermissionOptions}}" wx:key="value">
|
||||
<view
|
||||
class="pill-chip {{aiCopilotPermissionModeIndex === index ? 'active' : ''}}"
|
||||
data-key="aiCopilotPermissionMode"
|
||||
data-index="{{index}}"
|
||||
bindtap="onPillSelect"
|
||||
>{{item.label}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.syncTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.syncDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.syncConfigEnabled}}</text>
|
||||
<view class="field-stack">
|
||||
<text class="field-hint">{{copy.hints.syncConfigLine1}}</text>
|
||||
<text class="field-hint">{{copy.hints.syncConfigLine2}}</text>
|
||||
</view>
|
||||
<switch
|
||||
checked="{{form.syncConfigEnabled}}"
|
||||
color="#67d1ff"
|
||||
data-key="syncConfigEnabled"
|
||||
bindchange="onSwitch"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{activeTab === 'log'}}" class="settings-sections">
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.recordTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.recordDesc}}</text>
|
||||
</view>
|
||||
<view class="field-grid">
|
||||
<view class="field">
|
||||
<text>{{copy.fields.logRetentionDays}}</text>
|
||||
<input class="input" type="number" value="{{form.logRetentionDays}}" data-key="logRetentionDays" bindinput="onInput" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="settings-section">
|
||||
<view class="settings-section-head">
|
||||
<text class="settings-section-title">{{copy.sections.voiceCategoryTitle}}</text>
|
||||
<text class="settings-section-desc">{{copy.sections.voiceCategoryDesc}}</text>
|
||||
</view>
|
||||
|
||||
<view class="category-create-row">
|
||||
<input
|
||||
class="input category-create-input"
|
||||
value="{{newVoiceRecordCategory}}"
|
||||
placeholder="{{copy.placeholders.newVoiceRecordCategory}}"
|
||||
maxlength="12"
|
||||
bindinput="onVoiceRecordCategoryInput"
|
||||
/>
|
||||
<button class="btn category-create-btn" bindtap="onAddVoiceRecordCategory">{{copy.buttons.addVoiceRecordCategory}}</button>
|
||||
</view>
|
||||
|
||||
<text class="settings-inline-label">{{copy.fields.voiceCategoryList}}</text>
|
||||
|
||||
<view
|
||||
class="voice-category-grid {{voiceCategoryDragActive ? 'dragging' : ''}}"
|
||||
catchtouchmove="onVoiceRecordCategoryDragMove"
|
||||
catchtouchend="onVoiceRecordCategoryDragEnd"
|
||||
catchtouchcancel="onVoiceRecordCategoryDragEnd"
|
||||
>
|
||||
<view
|
||||
wx:for="{{voiceRecordCategoryCards}}"
|
||||
wx:key="category"
|
||||
class="voice-category-card {{item.isSelected ? 'is-selected' : ''}} {{item.dragging ? 'is-dragging' : ''}}"
|
||||
style="{{item.dragStyle}}"
|
||||
data-category="{{item.category}}"
|
||||
bindtap="onSelectVoiceRecordCategory"
|
||||
catchlongpress="onStartVoiceRecordCategoryDrag"
|
||||
>
|
||||
<view class="voice-category-card-head">
|
||||
<text class="voice-category-card-name">{{item.category}}</text>
|
||||
<text wx:if="{{item.isDefault}}" class="voice-category-card-badge">{{copy.labels.defaultBadge}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="voice-category-actions">
|
||||
<button
|
||||
class="btn secondary compact-btn"
|
||||
disabled="{{!selectedVoiceRecordCategory || form.voiceRecordDefaultCategory === selectedVoiceRecordCategory}}"
|
||||
bindtap="applySelectedVoiceRecordCategoryAsDefault"
|
||||
>{{copy.buttons.setDefaultCategory}}</button>
|
||||
<button
|
||||
class="btn danger compact-btn"
|
||||
disabled="{{!selectedVoiceRecordCategory}}"
|
||||
bindtap="removeSelectedVoiceRecordCategory"
|
||||
>{{copy.buttons.removeSelectedCategory}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<bottom-nav page="settings" />
|
||||
</view>
|
||||
459
apps/miniprogram/pages/settings/index.wxss
Normal file
459
apps/miniprogram/pages/settings/index.wxss
Normal file
@@ -0,0 +1,459 @@
|
||||
.settings-page {
|
||||
/* 统一设置项标签列和控件列的基线,避免不同控件各用一套尺寸。 */
|
||||
--settings-label-width: 220rpx;
|
||||
--settings-field-gap: 16rpx;
|
||||
--settings-control-height: 64rpx;
|
||||
--settings-color-trigger-padding-y: 10rpx;
|
||||
--settings-color-trigger-padding-x: 14rpx;
|
||||
--settings-color-bar-height: 24rpx;
|
||||
}
|
||||
|
||||
.settings-tabs {
|
||||
display: flex;
|
||||
gap: 8rpx;
|
||||
padding: 16px 32rpx 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.settings-page .page-content {
|
||||
padding-top: 16rpx;
|
||||
}
|
||||
|
||||
.settings-tab-btn {
|
||||
border: 1rpx solid var(--btn-border);
|
||||
background: var(--btn-bg);
|
||||
color: var(--btn-text);
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
font-size: 24rpx;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.settings-tab-btn.active {
|
||||
background: var(--btn-bg-strong);
|
||||
border-color: var(--btn-border-strong);
|
||||
color: var(--btn-text);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.settings-panel {
|
||||
padding-bottom: 16rpx;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.settings-header-actions {
|
||||
justify-content: space-between;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.settings-sections {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.settings-page .field-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.settings-page .field {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: var(--settings-field-gap);
|
||||
min-height: var(--settings-control-height);
|
||||
}
|
||||
|
||||
.settings-page .field.wide {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.settings-page .field > text {
|
||||
width: var(--settings-label-width);
|
||||
min-width: var(--settings-label-width);
|
||||
max-width: var(--settings-label-width);
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 22rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.settings-page .field .input,
|
||||
.settings-page .field .picker-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-page .field .btn {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.settings-page .field switch {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.settings-section {
|
||||
border: 1rpx solid var(--surface-border);
|
||||
background: var(--surface);
|
||||
border-radius: 16rpx;
|
||||
padding: 14rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14rpx;
|
||||
}
|
||||
|
||||
.settings-section-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.settings-section-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.settings-section-desc {
|
||||
font-size: 22rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.terminal-style-preview {
|
||||
width: 100%;
|
||||
border: 1rpx solid var(--surface-border);
|
||||
border-radius: 14rpx;
|
||||
background: var(--surface);
|
||||
padding: 12rpx 14rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.terminal-style-preview-line {
|
||||
display: block;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.terminal-style-preview-prompt {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.picker-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.settings-page .field.pill-field {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.settings-page .field .field-stack {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
/* 设置页提示文案跟随主题色,避免浅色主题下提示几乎不可见。 */
|
||||
.settings-page .field .field-hint {
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
margin-top: 0;
|
||||
color: var(--muted);
|
||||
font-size: 18rpx;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
/* 字号提示放在输入框前方,同一行展示,避免单独占一行拉大纵向间距。 */
|
||||
.settings-page .field .field-inline-row {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.settings-page .field .field-hint.field-hint-inline {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.settings-page .field .field-inline-input {
|
||||
flex: 0 0 128rpx;
|
||||
width: 128rpx;
|
||||
min-width: 128rpx;
|
||||
}
|
||||
|
||||
.segment-control {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: var(--settings-control-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* gap 与外侧留白必须同值;否则激活态外扩 ring 会让端侧可见间距更窄。 */
|
||||
padding: 6rpx;
|
||||
border-radius: 999rpx;
|
||||
border: 1rpx solid var(--btn-border);
|
||||
background: var(--icon-btn-bg);
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.segment-item {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 50rpx;
|
||||
border-radius: 999rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
line-height: 1;
|
||||
color: var(--muted);
|
||||
font-weight: 500;
|
||||
transition:
|
||||
background 140ms ease,
|
||||
color 140ms ease,
|
||||
box-shadow 140ms ease;
|
||||
}
|
||||
|
||||
.segment-item.active {
|
||||
background: var(--accent-bg-strong);
|
||||
color: var(--text);
|
||||
font-weight: 700;
|
||||
box-shadow: 0 0 0 2rpx var(--accent-ring);
|
||||
}
|
||||
|
||||
.pill-chip {
|
||||
min-height: 52rpx;
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 999rpx;
|
||||
border: 1rpx solid var(--btn-border);
|
||||
background: var(--icon-btn-bg);
|
||||
color: var(--btn-text);
|
||||
font-size: 22rpx;
|
||||
line-height: 1.1;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.2rpx;
|
||||
transition:
|
||||
background 140ms ease,
|
||||
border-color 140ms ease,
|
||||
color 140ms ease,
|
||||
box-shadow 140ms ease;
|
||||
}
|
||||
|
||||
.pill-chip.active {
|
||||
border-color: var(--accent-border);
|
||||
background: var(--accent-bg-strong);
|
||||
color: var(--text);
|
||||
font-weight: 700;
|
||||
box-shadow:
|
||||
0 0 0 2rpx var(--accent-ring),
|
||||
0 8rpx 18rpx var(--accent-shadow);
|
||||
}
|
||||
|
||||
.pill-scroll {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
min-height: 56rpx;
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pill-row {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
min-width: 100%;
|
||||
min-height: 56rpx;
|
||||
padding: 2rpx 2rpx 4rpx;
|
||||
}
|
||||
|
||||
.pill-chip.font-pill {
|
||||
max-width: 260rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.settings-page .field.color-field {
|
||||
flex-wrap: wrap;
|
||||
row-gap: 8rpx;
|
||||
}
|
||||
|
||||
.settings-page .field.color-field .color-trigger {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: var(--settings-color-trigger-padding-y) var(--settings-color-trigger-padding-x);
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
|
||||
.color-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.color-bar {
|
||||
width: 100%;
|
||||
height: var(--settings-color-bar-height);
|
||||
border-radius: 999rpx;
|
||||
overflow: hidden;
|
||||
border: 1rpx solid var(--btn-border);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.color-bar-fill {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.color-palette-grid {
|
||||
width: calc(100% - var(--settings-label-width) - var(--settings-field-gap));
|
||||
margin-left: calc(var(--settings-label-width) + var(--settings-field-gap));
|
||||
margin-top: 8rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10rpx;
|
||||
}
|
||||
|
||||
.palette-swatch-wrap {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
padding: 3rpx;
|
||||
border-radius: 10rpx;
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid transparent;
|
||||
}
|
||||
|
||||
.palette-swatch-wrap.active {
|
||||
border-color: var(--btn-border-strong);
|
||||
background: var(--btn-bg-strong);
|
||||
}
|
||||
|
||||
.palette-swatch {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid rgba(0, 0, 0, 0.16);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.category-create-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.category-create-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.category-create-btn {
|
||||
flex: 0 0 128rpx;
|
||||
}
|
||||
|
||||
.settings-inline-label {
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.voice-category-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.voice-category-grid.dragging {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.voice-category-card {
|
||||
width: calc((100% - 24rpx) / 3);
|
||||
min-width: 0;
|
||||
border: 1rpx solid var(--surface-border);
|
||||
border-radius: 16rpx;
|
||||
background: var(--surface);
|
||||
padding: 16rpx 14rpx;
|
||||
transition:
|
||||
transform 180ms ease,
|
||||
border-color 140ms ease,
|
||||
background 140ms ease,
|
||||
box-shadow 140ms ease,
|
||||
opacity 140ms ease;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.voice-category-card.is-selected {
|
||||
border-color: rgba(91, 210, 255, 0.72);
|
||||
background: rgba(91, 210, 255, 0.14);
|
||||
box-shadow: 0 6rpx 18rpx rgba(42, 92, 182, 0.22);
|
||||
}
|
||||
|
||||
.voice-category-card.is-dragging {
|
||||
transition: none;
|
||||
opacity: 0.72;
|
||||
box-shadow: 0 12rpx 28rpx rgba(0, 0, 0, 0.28);
|
||||
}
|
||||
|
||||
.voice-category-card-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.voice-category-card-name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: var(--text);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.voice-category-card-badge {
|
||||
flex: 0 0 auto;
|
||||
padding: 4rpx 10rpx;
|
||||
border-radius: 999rpx;
|
||||
background: rgba(91, 210, 255, 0.2);
|
||||
color: var(--text);
|
||||
font-size: 18rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.voice-category-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.compact-btn {
|
||||
min-width: 132rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user