31 lines
4.3 KiB
Plaintext
31 lines
4.3 KiB
Plaintext
<view wx:if="{{visible}}" class="product-selector-mask" bindtap="close" catchtouchmove="stopEvent">
|
||
<view class="product-selector-sheet" catchtap="stopEvent">
|
||
<view class="product-selector-head">
|
||
<view><text class="product-selector-title">{{mode === 'manual' ? '手动录入作品' : title}}</text><text wx:if="{{mode === 'manual'}}" class="product-selector-subtitle">名称和价格必填,可补充更多信息</text></view>
|
||
<view class="product-selector-close" bindtap="close" aria-label="关闭作品选择"></view>
|
||
</view>
|
||
<block wx:if="{{mode === 'list'}}">
|
||
<view class="product-selector-search"><text class="product-selector-search-icon"></text><input value="{{keyword}}" bindinput="onSearch" placeholder="{{placeholder}}" confirm-type="search" /></view>
|
||
<scroll-view class="product-selector-scroll" scroll-y enhanced show-scrollbar="{{false}}">
|
||
<view wx:if="{{loading}}" class="product-selector-state">正在加载作品...</view>
|
||
<view wx:elif="{{errorText}}" class="product-selector-state error">{{errorText}}<button class="product-selector-retry" bindtap="retry">重新加载</button></view>
|
||
<view wx:elif="{{items.length === 0}}" class="product-selector-state">{{emptyText}}</view>
|
||
<view wx:else class="product-selector-list">
|
||
<view wx:for="{{items}}" wx:key="id" class="product-selector-item {{selectedId == item.id ? 'selected' : ''}}" data-index="{{index}}" bindtap="selectItem">
|
||
<image wx:if="{{item.coverImage}}" class="product-selector-cover" src="{{item.coverImage}}" mode="aspectFill"></image><view wx:else class="product-selector-cover placeholder">图</view>
|
||
<view class="product-selector-copy"><view class="product-selector-name-row"><text class="product-selector-name">{{item.title}}</text><text class="product-selector-price">{{item.priceText || (item.price == null ? '价格待定' : '¥' + item.price)}}</text></view><text class="product-selector-meta">{{item.durationText || '时长待定'}} · {{item.artistText || '全部员工'}}</text><view class="product-selector-tags"><text wx:for="{{item.tagList}}" wx:for-item="tag" wx:key="*this">{{tag}}</text></view></view><text class="product-selector-check">{{selectedId == item.id ? '✓' : '›'}}</text>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
<view class="product-selector-footer"><button class="product-selector-action" bindtap="openManual">+ 手动录入作品</button></view>
|
||
</block>
|
||
<block wx:else>
|
||
<scroll-view class="product-selector-scroll manual" scroll-y enhanced show-scrollbar="{{false}}">
|
||
<view class="manual-product-card"><view class="manual-product-grid"><input value="{{manualForm.title}}" data-field="title" bindinput="onManualInput" placeholder="作品名称" /><input value="{{manualForm.price}}" data-field="price" bindinput="onManualInput" type="digit" placeholder="价格" /></view><view wx:if="{{showManualExtra}}" class="manual-product-more" bindtap="toggleMore">{{manualMoreExpanded ? '⌃ 收起更多信息' : '⌄ 补充更多信息'}}</view></view>
|
||
<view wx:if="{{showManualExtra && manualMoreExpanded}}" class="manual-product-extra"><textarea value="{{manualForm.description}}" data-field="description" bindinput="onManualInput" placeholder="作品描述(选填)"></textarea><input value="{{manualForm.tags}}" data-field="tags" bindinput="onManualInput" placeholder="标签,多个用逗号分隔(选填)" /><input value="{{manualForm.targetAudience}}" data-field="targetAudience" bindinput="onManualInput" placeholder="适合人群(选填)" /><input value="{{manualForm.precautions}}" data-field="precautions" bindinput="onManualInput" placeholder="注意事项(选填)" /><view class="manual-product-image-row"><image wx:if="{{manualImageUrl}}" src="{{manualImageUrl}}" class="manual-product-image" mode="aspectFill"></image><view wx:else class="manual-product-image placeholder">图</view><button bindtap="chooseImage" loading="{{manualImageUploading}}">上传图片</button><button wx:if="{{manualImageUrl}}" bindtap="removeImage">移除</button></view></view>
|
||
</scroll-view>
|
||
<view class="product-selector-footer manual-footer"><button class="product-selector-confirm" bindtap="confirmManual">使用此作品</button><button class="product-selector-back" bindtap="backToList">‹ 返回作品列表</button></view>
|
||
</block>
|
||
</view>
|
||
</view>
|