Files
doodle-mini/miniprogram/pages/index/index.wxml
T

69 lines
2.3 KiB
Plaintext

<view class="page-container">
<view class="wrapper">
<text class="wrapper-title">自定义涂鸦卡</text>
<word-input bind:onConfirm="onConfirmInput" />
<view class="word-card-box">
<block
wx:for="{{cardList}}"
wx:for-item="item"
wx:for-index="index">
<view class="word-card-list" wx:if="{{index % 2 === 0}}">
<word-card
key="{{index}}"
word="{{item.word}}"
color="{{item.color}}"
bind:onDelete="deleteWordCard"
bind:onColorTap="onColorTap" />
<word-card
wx:if="{{cardList[index + 1]}}"
key="{{index + 1}}"
word="{{cardList[index + 1].word}}"
color="{{cardList[index + 1].color}}"
bind:onDelete="deleteWordCard"
bind:onColorTap="onColorTap" />
</view>
</block>
</view>
</view>
<view
id="previewWrapper"
class="wrapper {{cardList.length > 0 ? '' : 'hidden'}}">
<text class="wrapper-title">预览打印效果</text>
<view id="canvasWrapper" class="canvas-wrapper">
<canvas
type="2d"
id="canvasContent"
class="canvas-content"
style="width:{{boxWidth}}px;height:{{boxHeight}}px" />
</view>
</view>
<view class="empty"></view>
<color-picker
show="{{showColorPopup}}"
currentColor="{{currentColor}}"
bind:onClose="onCloseColorPopup"
bind:onChange="onChangeColor" />
</view>
<view class="btn-area">
<toy-button
type="green"
bind:click="exportToPrint"
width="680rpx"
disabled="{{cardList.length <= 0}}"
icon="download"
icon-class-prefix="toy-icon">
下载打印
</toy-button>
<!-- <toy-button
type="green"
width="680rpx"
disabled="{{cardList.length <= 0}}"
icon="download"
icon-class-prefix="toy-icon">
下载打印
</toy-button> -->
</view>
<introduction-popup
wx:if="{{showIntroductionPopup}}"
bind:onClose="onCloseIntroductionPopup" />