refactor: 完善小程序品牌组件视觉层

This commit is contained in:
que01 committed 2026-09-20 12:05:42 +08:00
1 parent e4adfc6b13
commit 8872316ad3
17 files changed
+72 -10

No files matched your search

@@ -0,0 +1 @@
Component({ options: { addGlobalClass: true } });
@@ -0,0 +1 @@
{ "component": true }
@@ -0,0 +1 @@
<view class="card"><slot /></view>
@@ -0,0 +1,7 @@
.card {
padding: 28rpx;
background: var(--brand-color-surface);
border: 1rpx solid rgba(122, 74, 43, 0.1);
border-radius: var(--brand-radius-card);
box-shadow: 0 8rpx 24rpx rgba(122, 74, 43, 0.06);
}
@@ -0,0 +1,11 @@
Component({
properties: {
message: { type: String, value: "暂时无法加载内容" },
actionText: { type: String, value: "重新加载" },
},
methods: {
retry() {
this.triggerEvent("retry");
},
},
});
@@ -0,0 +1 @@
{ "component": true }
@@ -0,0 +1 @@
<view class="error"><text class="message">{{message}}</text><button class="retry" bindtap="retry">{{actionText}}</button></view>
@@ -0,0 +1,20 @@
.error {
padding: 72rpx 32rpx;
display: flex;
flex-direction: column;
align-items: center;
color: var(--brand-color-muted);
}
.message {
margin-bottom: 24rpx;
font-size: 28rpx;
}
.retry {
margin: 0;
padding: 0 28rpx;
color: var(--brand-color-primary);
background: var(--brand-color-subtle);
border-radius: 999rpx;
font-size: 26rpx;
line-height: 68rpx;
}
@@ -1 +1 @@
<view class="field"><view wx:if="{{label}}" class="label">{{label}}<text wx:if="{{required}}" class="required"> *</text></view><t-textarea wx:if="{{type === 'textarea'}}" value="{{value}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" bind:change="handleChange" bind:blur="handleBlur" /><t-input wx:else value="{{value}}" type="{{type}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" bind:change="handleChange" bind:blur="handleBlur" /></view>
<view class="field"><view wx:if="{{label}}" class="label">{{label}}<text wx:if="{{required}}" class="required"> *</text></view><view class="field-control"><t-textarea wx:if="{{type === 'textarea'}}" value="{{value}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" bind:change="handleChange" bind:blur="handleBlur" /><t-input wx:else value="{{value}}" type="{{type}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" bind:change="handleChange" bind:blur="handleBlur" /></view></view>
@@ -10,9 +10,21 @@
.required {
color: var(--brand-color-primary);
}
.field-control {
padding: 4rpx 20rpx;
background: var(--brand-color-surface);
border: 1rpx solid #eadfce;
border-radius: var(--brand-radius-control);
}
t-input,
t-textarea {
--td-input-bg-color: var(--brand-color-surface);
--td-input-border-color: #eadfce;
--td-input-border-radius: var(--brand-radius-control);
--td-input-vertical-padding: 20rpx;
--td-input-bg-color: transparent;
--td-input-border-color: transparent;
--td-input-default-text-color: var(--brand-color-text);
--td-input-placeholder-text-color: #a98f7b;
--td-textarea-background-color: transparent;
--td-textarea-border-color: transparent;
--td-textarea-text-color: var(--brand-color-text);
--td-textarea-placeholder-color: #a98f7b;
}