优化店铺设置门店介绍展示

This commit is contained in:
2026-07-22 18:24:16 +08:00
parent ab008a351f
commit 6dcb426b93
3 changed files with 183 additions and 28 deletions
+19 -5
View File
@@ -27,6 +27,8 @@ const EXCEPTION_TYPES = [
{ value: 'CHANGE_SHIFT', label: '临时改班' }
]
const DEFAULT_SHOP_INTRO = '专注法式、晕染与手绘设计,适合想要温柔质感的客人。'
function copyWorkDays(days) {
if (Array.isArray(days)) {
return days.map(day => Number(day)).filter(day => day >= 1 && day <= 7).sort()
@@ -71,6 +73,10 @@ function resolveFirstImageUrl(urls) {
return Array.isArray(urls) ? String(urls[0] || '').trim() : ''
}
function introLength(value) {
return String(value || '').length
}
Page({
data: {
presets: PRESETS,
@@ -85,12 +91,13 @@ Page({
saving: false,
coverUploading: false,
coverImagePreviewUrl: '',
introLength: introLength(DEFAULT_SHOP_INTRO),
form: {
shopName: BRAND_CONFIG.defaultShopName,
startTime: '10:00',
endTime: '22:00',
defaultDuration: 60,
rule: '必须选择已有作品作为项目来源',
rule: DEFAULT_SHOP_INTRO,
schedulePresetType: 'EVERYDAY',
scheduleWorkDays: [1, 2, 3, 4, 5, 6, 7],
scheduleRemark: '',
@@ -131,6 +138,7 @@ Page({
}
this.setData({
form,
introLength: introLength(form.rule),
coverImagePreviewUrl: resolveFirstImageUrl(settings.coverImageUrls),
presetOptions: buildPresetOptions(form.schedulePresetType),
weekdayOptions: buildWeekdayOptions(form.scheduleWorkDays),
@@ -149,7 +157,13 @@ Page({
},
onInput(event) {
this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value })
const field = event.currentTarget.dataset.field
const value = event.detail.value
const nextData = { [`form.${field}`]: value }
if (field === 'rule') {
nextData.introLength = introLength(value)
}
this.setData(nextData)
},
async chooseCoverImage() {
@@ -268,10 +282,10 @@ Page({
})
},
explainBookingRule() {
explainShopIntro() {
wx.showModal({
title: '预约规则',
content: '这是店铺给员工看的预约备注或说明文案,不参与自动排班、容量或冲突校验。',
title: '门店介绍',
content: '这里会保存为门店介绍,并展示在用户端门店详情。预约时间、容量和冲突校验仍由店铺排班、特殊日期和员工排班控制。',
showCancel: false,
confirmText: '知道了'
})
+29 -5
View File
@@ -1,17 +1,24 @@
<view class="page no-tab">
<view wx:if="{{loading}}" class="loading-state">店铺设置加载中</view>
<block wx:else>
<view class="page-heading">
<text class="page-title">店铺设置</text>
<text class="page-subtitle">把门店气质写进第一眼</text>
</view>
<view class="cover-card">
<view wx:if="{{coverImagePreviewUrl}}" class="cover-preview">
<image src="{{coverImagePreviewUrl}}" mode="aspectFill"></image>
</view>
<view wx:else class="cover-preview cover-empty">
<text>店铺主图</text>
<text class="cover-empty-title">店铺封面</text>
<text class="cover-empty-desc">上传一张能代表风格的作品图</text>
</view>
<view class="cover-badge">门店封面</view>
<view class="cover-shade">
<view class="cover-copy">
<text class="cover-title">{{form.shopName || '店铺主图'}}</text>
<text class="cover-desc">我的页顶部展示这张图片</text>
<text class="cover-desc">{{form.rule || '色彩、手作与细节管理的预约空间'}}</text>
</view>
<view class="cover-actions">
<button class="cover-btn" loading="{{coverUploading}}" bindtap="chooseCoverImage">更换主图</button>
@@ -21,6 +28,12 @@
</view>
<view class="card form-card">
<view class="form-header">
<view>
<text class="form-kicker">门店档案</text>
<text class="form-title">展示给客户看的第一段介绍</text>
</view>
</view>
<view class="field"><text class="field-label">店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="请输入店铺名称" /></view>
<view class="field">
<view class="label-with-help">
@@ -32,10 +45,21 @@
</view>
<view class="field">
<view class="label-with-help">
<text class="field-label">预约规则</text>
<text class="help-badge" catchtap="explainBookingRule">?</text>
<text class="field-label">门店介绍</text>
<text class="help-badge" catchtap="explainShopIntro">?</text>
</view>
<view class="intro-editor">
<textarea
value="{{form.rule}}"
data-field="rule"
bindinput="onInput"
maxlength="120"
auto-height="{{false}}"
placeholder="写下门店风格、擅长方向、服务氛围"
placeholder-class="intro-placeholder"
></textarea>
<text class="intro-count">{{introLength}}/120</text>
</view>
<input value="{{form.rule}}" data-field="rule" bindinput="onInput" placeholder="例如:必须选择已有作品作为项目来源" />
</view>
</view>
+135 -18
View File
@@ -1,12 +1,40 @@
.page {
background:
linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(247, 240, 232, 0.96)),
linear-gradient(135deg, rgba(89, 121, 102, 0.14), rgba(181, 134, 86, 0.12));
}
.page-heading {
display: flex;
flex-direction: column;
gap: 8rpx;
margin: 4rpx 0 22rpx;
}
.page-title {
color: #2f2a25;
font-size: 36rpx;
font-weight: 900;
line-height: 1.25;
}
.page-subtitle {
color: #8a796a;
font-size: 23rpx;
line-height: 1.4;
}
.cover-card {
position: relative;
height: 300rpx;
margin-bottom: 24rpx;
height: 340rpx;
margin-bottom: 26rpx;
overflow: hidden;
border-radius: 22rpx;
background: linear-gradient(135deg, #7b9987, #c4996e);
box-shadow: 0 18rpx 36rpx rgba(83, 64, 44, 0.14);
border-radius: 28rpx;
background:
linear-gradient(135deg, rgba(73, 101, 85, 0.95), rgba(179, 131, 90, 0.95)),
radial-gradient(circle at 24% 22%, rgba(255, 245, 223, 0.28), transparent 36%);
box-shadow: 0 22rpx 46rpx rgba(83, 64, 44, 0.18);
}
.cover-preview,
@@ -17,10 +45,34 @@
.cover-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10rpx;
color: rgba(255, 255, 255, 0.82);
font-size: 34rpx;
}
.cover-empty-title {
font-size: 36rpx;
font-weight: 900;
}
.cover-empty-desc {
font-size: 23rpx;
font-weight: 600;
opacity: 0.86;
}
.cover-badge {
position: absolute;
top: 26rpx;
left: 28rpx;
z-index: 2;
padding: 8rpx 20rpx;
border-radius: 999rpx;
background: rgba(255, 244, 222, 0.88);
color: #5b4635;
font-size: 22rpx;
font-weight: 900;
}
@@ -34,8 +86,10 @@
align-items: flex-end;
justify-content: space-between;
gap: 20rpx;
padding: 28rpx;
background: linear-gradient(180deg, rgba(30, 24, 19, 0.08), rgba(30, 24, 19, 0.48));
padding: 30rpx;
background:
linear-gradient(180deg, rgba(30, 24, 19, 0.02), rgba(30, 24, 19, 0.6)),
linear-gradient(110deg, rgba(48, 70, 56, 0.36), transparent 58%);
}
.cover-copy {
@@ -50,7 +104,7 @@
.cover-title {
overflow: hidden;
font-size: 34rpx;
font-size: 40rpx;
font-weight: 900;
line-height: 1.25;
text-overflow: ellipsis;
@@ -59,8 +113,14 @@
.cover-desc {
margin-top: 8rpx;
font-size: 23rpx;
display: -webkit-box;
overflow: hidden;
max-width: 430rpx;
font-size: 24rpx;
line-height: 1.45;
opacity: 0.9;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.cover-actions {
@@ -75,17 +135,17 @@
display: flex;
align-items: center;
justify-content: center;
min-width: 154rpx;
min-height: 58rpx;
min-width: 164rpx;
min-height: 62rpx;
padding: 0 20rpx;
border-radius: 16rpx;
border-radius: 20rpx;
font-size: 24rpx;
font-weight: 900;
}
.cover-btn {
background: #fffdf8;
color: #72553b;
background: #fff8ed;
color: #6d4d35;
}
.cover-remove {
@@ -95,10 +155,37 @@
.form-card,
.rule-card {
padding: 10rpx 0;
padding: 12rpx 0;
overflow: hidden;
}
.form-card {
box-shadow: 0 18rpx 36rpx rgba(83, 64, 44, 0.08);
}
.form-header {
display: flex;
justify-content: space-between;
padding: 26rpx 26rpx 8rpx;
}
.form-header view {
display: flex;
flex-direction: column;
gap: 6rpx;
}
.form-kicker {
color: #92734f;
font-size: 22rpx;
font-weight: 900;
}
.form-title {
color: #8d8175;
font-size: 23rpx;
}
.field {
min-height: 108rpx;
padding: 12rpx 24rpx;
@@ -111,15 +198,45 @@
}
.field input,
.field-value {
.field-value,
.intro-editor {
min-height: 70rpx;
padding: 0 22rpx;
border: 1rpx solid #eadfd2;
border-radius: 18rpx;
background: #fffaf4;
background: #fff8f2;
line-height: 70rpx;
}
.intro-editor {
position: relative;
flex: 1;
min-height: 156rpx;
padding: 18rpx 22rpx 42rpx;
line-height: 1.5;
}
.intro-editor textarea {
width: 100%;
height: 104rpx;
color: #3d3128;
font-size: 26rpx;
line-height: 1.5;
}
.intro-placeholder {
color: #b4a79b;
}
.intro-count {
position: absolute;
right: 22rpx;
bottom: 12rpx;
color: #b2a396;
font-size: 20rpx;
line-height: 1;
}
.label-with-help {
display: flex;
align-items: center;