40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
<view class="container">
|
||
<view class="header-tip">
|
||
<view class="title">🎲 天选打工人</view>
|
||
<text class="subtitle">输入名字,看看今天谁去拿外卖</text>
|
||
</view>
|
||
|
||
<view class="input-area">
|
||
<input class="input" placeholder="输入名字 (如: 小明)" value="{{newName}}" bindinput="onInput" bindconfirm="addName" />
|
||
<view class="btn-add" bindtap="addName">添加</view>
|
||
</view>
|
||
|
||
<view class="list-container">
|
||
<view class="list-header">候选名单 ({{names.length}})</view>
|
||
<scroll-view scroll-y class="list-area">
|
||
<view class="name-list">
|
||
<block wx:for="{{names}}" wx:key="*this">
|
||
<view class="name-item color-{{index % 5}}">
|
||
<text class="name-text">{{item}}</text>
|
||
<view class="btn-delete" bindtap="removeName" data-index="{{index}}">×</view>
|
||
</view>
|
||
</block>
|
||
<view wx:if="{{names.length === 0}}" class="empty-tip">
|
||
<text class="empty-icon">🍃</text>
|
||
<text>还没有候选人,快去添加吧~</text>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
</view>
|
||
|
||
<view class="result-area">
|
||
<view class="result-box {{isRolling ? 'rolling' : ''}}">
|
||
<text class="result-label">🎉 天选之人</text>
|
||
<text class="result-text">{{result || '?'}}</text>
|
||
</view>
|
||
<button class="btn-start" hover-class="btn-start-hover" bindtap="startDraw" disabled="{{isRolling || names.length < 2}}">
|
||
{{isRolling ? '🤞 随机抽取中...' : '🚀 开始抽取'}}
|
||
</button>
|
||
</view>
|
||
</view>
|