Files
doodle-mini/miniprogram/components/shape-picker/shape-picker.wxml
T
2025-08-07 17:36:04 +08:00

47 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<van-popup
show="{{ show }}"
bind:close="onClose"
custom-class="shape-picker-popup">
<view class="shape-picker-container">
<text class="shape-picker-title"
>选择形状{{ currentShapeKey ? '' : '(多选)' }}</text
>
<view class="shape-options-wrapper">
<view class="shape-options">
<view
wx:for="{{shapes}}"
wx:key="id"
class="shape-option {{item.checked ? 'selected' : '' }}"
bindtap="onSelectShape"
data-index="{{index}}"
data-shape="{{item.id}}">
<view class="shape-svg-container">
<image
class="shape-svg"
src="{{ item.svgDataUrl }}"
mode="aspectFit" />
<!-- 多选模式下显示选中标记 -->
<view wx:if="{{ item.checked }}" class="selected-icon">
<toy-icon
name="ic_check"
size="24"
color="#93d333" />
</view>
</view>
<text class="shape-name">{{item.name}}</text>
</view>
</view>
</view>
<view class="btn-area">
<toy-button
type="primary"
bind:click="onChange"
width="400rpx"
disabled="{{ currentShapeKey ? !selectedShape : selectedShapes.length === 0 }}">
确认选择{{ !currentShapeKey && selectedShapes.length > 0 ? ''
+ selectedShapes.length + '个)' : '' }}
</toy-button>
</view>
</view>
</van-popup>