Files
doodle-mini/miniprogram/pages/shapePrint/index.wxml
T
2025-07-08 17:07:23 +08:00

63 lines
1.7 KiB
Plaintext

<view class="container">
<!-- 形状卡片预览区 -->
<view class="card-container">
<view wx:for="{{shapeCards}}" wx:key="index" class="shape-card">
<image
src="{{item.svgData}}"
mode="aspectFit"
class="shape-image" />
<view
class="color-box"
style="background-color:{{item.fillColor}}"></view>
</view>
</view>
<!-- 控制面板 -->
<view class="control-panel">
<slider
min="1"
max="5"
value="{{columns}}"
bindchange="setColumns"
show-value />
<text>布局列数: {{columns}}</text>
<button
bindtap="generateImage"
type="primary"
loading="{{isGenerating}}">
生成图片
</button>
<button
bindtap="saveToAlbum"
wx:if="{{generatedImage}}"
type="warn"
plain>
保存到相册
</button>
</view>
<!-- 预览区域 -->
<image
wx:if="{{generatedImage}}"
src="{{generatedImage}}"
class="preview-image"
bindtap="previewFullImage" />
<!-- 背景选择器 -->
<view class="bg-picker">
<text class="label">背景颜色:</text>
<radio-group bindchange="setBackground">
<radio
wx:for="{{backgrounds}}"
wx:key="value"
value="{{item.value}}"
color="{{item.color}}"
checked="{{bgColor === item.value}}">
{{item.name}}
</radio>
</radio-group>
</view>
</view>