<mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
    <view slot="info" class="container main">
        <view class="zero one">
            <input type="text" value="{{searchInfo.name}}" bindconfirm="search" placeholder="请输入关键词" />
        </view>
        <view class="zero two">
            <scroll-view scroll-y="true" class="scroll-view">
                <view class="list-scroll-view">
                    <view class="list" wx:for="{{list}}" wx:key="item">
                        <view class="name">{{item.match_time}}</view>
                        <view class="other">
                            <view class="other_1">
                                <text>赛事名称：</text>
                                <text>{{item.match_name}}</text>
                            </view>
                            <view class="other_1">
                                <text>赛事组别：</text>
                                <text>{{item.grouping_name}}</text>
                            </view>
                            <view class="other_1">
                                <text>组内项目：</text>
                                <text>{{item.project_name}}</text>
                            </view>
                            <view class="other_1">
                                <text>赛事场地：</text>
                                <text>{{item.ground_name}}</text>
                            </view>
                            <view class="other_1">
                                <text>比赛状态：</text>
                                <text>{{item.status=='0'?'已安排':item.status=='1'?'待开赛':item.status=='2'?'已开赛':item.status=='3'?'已结束':'暂无'}}</text>
                            </view>
                        </view>
                        <view class="btn">
                            <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
                            <button type="primary" size="mini" bindtap="toScore" data-item="{{item}}">赛事管理</button>
                            <button type="primary" size="mini" bindtap="toChange" data-item="{{item}}" wx:if="{{item.score_one==16||item.score_two==16}}">更换场地</button>
                        </view>
                    </view>
                </view>
            </scroll-view>
        </view>
    </view>
</mobile-main>
<e-dialog dialog="{{dialog}}" bind:toClose="toClose">
    <view slot="info">
        <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
            <view class="one_1">
                <text class="text">赛事名称：</text>
                <text class="text1">{{info.match_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">赛事组别：</text>
                <text class="text1">{{info.grouping_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">比赛项目：</text>
                <text class="text1">{{info.project_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">赛事场地：</text>
                <text class="text1">{{info.ground_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">选手1：</text>
                <text class="text1">{{info.player_one_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">选手2：</text>
                <text class="text1">{{info.player_two_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">裁判名称：</text>
                <text class="text1">{{info.referee_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">选手1的比分纪录：</text>
                <text class="text1">{{info.score_one||0}}分</text>
            </view>
            <view class="one_1">
                <text class="text">选手2的比分纪录：</text>
                <text class="text1">{{info.score_two||0}}分</text>
            </view>
            <view class="one_1">
                <text class="text">胜者：</text>
                <text class="text1">{{info.winner_name||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">比赛时间：</text>
                <text class="text1">{{info.match_time||'暂无'}}</text>
            </view>
            <view class="one_1">
                <text class="text">比赛状态：</text>
                <text class="text1">{{info.status=='0'?'已安排':info.status=='1'?'待开赛':info.status=='2'?'已开赛':info.status=='3'?'已结束':'暂无'}}</text>
            </view>
        </view>
        <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
            <form catchsubmit="onSubmit">
                <view class="content" style="display: none;">
                    <view class="label">数据id</view>
                    <view class="value">
                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
                    </view>
                </view>
                <view class="content">
                    <view class="label">比赛状态</view>
                    <view class="value">
                        <picker bindchange="statusChange" name="status" value="{{form.status}}" range-key='label' range="{{statusList}}">
                            <view class="input">{{form.status=='0'?'已安排':form.status=='1'?'待开赛':form.status=='2'?'已开赛':form.status=='3'?'已结束':'请选择'}}</view>
                        </picker>
                    </view>
                </view>
                <view class="content" wx:if="{{form.is_change=='0'}}">
                    <view class="label">选手一比分{{form.player_one_name}}</view>
                    <view class="value">
                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
                    </view>
                </view>
                <view class="content" wx:if="{{form.is_change=='0'}}">
                    <view class="label">选手二比分{{form.player_two_name}}</view>
                    <view class="value">
                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
                    </view>
                </view>
                <view class="content" wx:if="{{form.is_change=='1'}}">
                    <view class="label">选手二比分{{form.player_two_name}}</view>
                    <view class="value">
                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
                    </view>
                </view>
                <view class="content" wx:if="{{form.is_change=='1'}}">
                    <view class="label">选手一比分{{form.player_one_name}}</view>
                    <view class="value">
                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
                    </view>
                </view>
                <view class="content">
                    <view class="label">胜者</view>
                    <view class="value">
                        <radio-group name="winner">
                            <label>
                                <radio value="{{form.player_one}}" checked="{{form.player_one==form.winner?true:false}}" />{{form.player_one_name}}
                            </label>
                            <label>
                                <radio value="{{form.player_two}}" checked="{{form.player_two==form.winner?true:false}}" />{{form.player_two_name}}
                            </label>
                        </radio-group>
                    </view>
                </view>
                <view class="btn">
                    <button type="primary" size="mini" form-type="submit">提交保存</button>
                </view>
            </form>
        </view>
    </view>
</e-dialog>