<view style="height:{{CustomBar}}px;" class="headBox">
    <view class="cu-bar fixed bg-white ev-fr-start" bindtap="BackPage" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;">
        <text class="cuIcon-back padding-lr-sm"></text>
        <view class="action">新建课程</view>
    </view>
</view>
<view class="ev-mainBody margin-top" style="padding-bottom:{{30 + StatusBar}}px;height: {{displayArea.windowHeight  - 144}}px;overflow: auto;">
    <view class="ev-fr cardBox courseNameBox">
        <view>
            <view class="padding courseName">课程名称</view>
            <input class="margin-lr" value="{{sname}}" type="text" bindfocus="nameAutoComplete" bindconfirm="courseNameConfirm" bindinput="courseNameChange" placeholder="请输入课程名称" />
        </view>
        <image class="backgroundImg" mode="heightFix" src="/images/courseBG.png" />
    </view>
    <view wx:if="{{!nameAutoComplete}}">
        <view wx:for="{{courseList}}" wx:if="{{roomAutoComplete == null || roomAutoComplete == index}}" wx:key="index" class="cardBox courseInfoBox animation-slide-right">
            <view class="delCourseBox" data-id="{{item.usercourse_id}}" data-index="{{index}}" bind:tap="delCourse">
                <text class="cuIcon-delete" style="color:#92979D;font-size:18px"></text>
            </view>
            <view class="cu-form-group padding-tb ev-fr-start">
                <view class="title">教室</view>
                <view style="width: {{displayArea.windowWidth / 1.6}}px;">
                    <input placeholder="请输入听课教室" data-index="{{index}}" bindblur="roomConfirm" bindconfirm="roomConfirm" bindinput="roomChange" value="{{item.classroom}}" name="input"></input>
                </view>
            </view>
            <view wx:if="{{roomAutoComplete !== index}}" data-index="{{index}}" data-target="weeksModal" bind:tap="showModal" class="cu-form-group padding-tb animation-slide-right">
                <view class="title">周数</view>
                <input placeholder="请选择上课周数" value="{{item.attend.length == 50?'全部':item.attend}}" disabled name="input"></input>
                <text class="cuIcon-right padding-lr-sm"></text>
            </view>
            <view wx:if="{{roomAutoComplete !== index}}" data-index="{{index}}" data-target="sectionModal" bind:tap="showModal" class="cu-form-group padding-tb animation-slide-right">
                <view class="title">节数</view>
                <input placeholder="请选择上课节数" value="周{{item.days}}:从第{{item.nums}}节-到{{item.enum}}节课" disabled name="input"></input>
                <text class="cuIcon-right padding-lr-sm"></text>
            </view>
            <view wx:if="{{roomAutoComplete !== index}}" class="cu-form-group padding-tb animation-slide-right">
                <view class="title">老师</view>
                <input placeholder="请输入上课老师姓名" bindblur="tNameConfirm" bindconfirm="tNameConfirm" data-index="{{index}}" value="{{item.tname}}" name="input"></input>
            </view>
        </view>
    </view>
    <view wx:if="{{nameAutoComplete || roomAutoComplete !== null}}" bind:tap="closeKeyboard" style="height:80vh">
        <view wx:for="{{autocompleList}}" class="autocomple" wx:key="index">
            <!-- 模糊搜索关键词高亮
            <rich-text nodes="{{item.nodeData}}"></rich-text> -->
            <view bind:tap="compleChoose" data-name="{{item.sname}}">{{item.sname}}</view>
        </view>
    </view>
</view>
<view wx:if="{{!(roomAutoComplete !== null || nameAutoComplete)}}" class="ev-fr buttonBottom animation-slide-bottom" style="height: {{50 + StatusBar}}px;">
    <button bind:tap="addCourse" class="cu-btn block courseBtn" style="background: #08d8d1;" type="">
        添加其他时段
    </button>
    <button bind:tap="saveButton" class="cu-btn block bg-blue courseBtn" type="">保存</button>
</view>
<view class="cu-modal bottom-modal {{modalName=='weeksModal'?'show':''}}" bindtap="hideModal">
    <view class="cu-dialog bg-white" style="border-radius: 20px 20px 0 0;overflow: hidden;" catchtap>
        <view class="cu-bar ev-fr margin-lr margin-tb-xs">
            <text class="title">本节课上课周数</text>
            <button class="cu-btn bg-white weeksBtn {{ChooseWeek == 0?'weeksBtnC':''}}" bindtap="ChooseWeeks" data-value="0">
                全选
            </button>
            <button class="cu-btn bg-white weeksBtn {{ChooseWeek == 1?'weeksBtnC':''}}" bindtap="ChooseWeeks" data-value="1">
                单周
            </button>
            <button class="cu-btn bg-white weeksBtn {{ChooseWeek == 2?'weeksBtnC':''}}" bindtap="ChooseWeeks" data-value="2">
                双周
            </button>
        </view>
        <view class="grid col-5 padding-sm bg-white solid-top solid-bottom">
            <view wx:for="{{checkbox}}" class="padding-xs" wx:key="index">
                <button class="cu-btn bg-white WeekCheck {{item.checked?'WeekChecked':''}}" bindtap="ChooseCheckbox" data-value="{{item.value}}">
                    {{item.value}}
                </button>
            </view>
        </view>
        <view class="ev-fr buttonBottom" style="height: {{30 + StatusBar}}px;position: initial;">
            <button bind:tap="hideModal" class="cu-btn block courseBtn" style="color:#282B2F" type="">
                取消
            </button>
            <button bind:tap="saveWeek" class="cu-btn block bg-blue courseBtn" type="">保存</button>
        </view>
    </view>
</view>
<view class="cu-modal bottom-modal {{modalName=='sectionModal'?'show':''}}" bindtap="hideModal">
    <view class="cu-dialog bg-white" style="border-radius: 20px 20px 0 0;overflow: hidden;" catchtap>
        <view class="cu-bar ev-fr-start margin-lr margin-tb-xs">
            <view class="title">{{multiArray[0][courseTime[0]]}}</view>
            <view class="padding-lr-sm">
                从第{{multiArray[1][courseTime[1]].value}}-到第{{multiArray[2][courseTime[2]].value}}节课
            </view>
            <view class="text-blue">
                {{multiArray[1][courseTime[1]].startTime}}-{{multiArray[2][courseTime[2]].endTime}}
            </view>
        </view>
        <picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;" value="{{courseTime}}" bindchange="sectionChange">
            <picker-view-column>
                <view wx:for="{{multiArray[0]}}" wx:key="index" style="line-height: 50px; text-align: center;">
                    {{item}}
                </view>
            </picker-view-column>
            <picker-view-column>
                <view wx:for="{{multiArray[1]}}" class="ev-fr-start" wx:key="index" style="line-height: 50px; text-align: center;">
                    从第{{item.value}}节
                    <view class="classTime padding-left-sm">{{item.startTime}}</view>
                </view>
            </picker-view-column>
            <picker-view-column>
                <view wx:for="{{multiArray[2]}}" class="ev-fr-start" wx:key="index" style="line-height: 50px; text-align: center;">
                    到第{{item.value}}节
                    <view class="classTime padding-left-sm">{{item.endTime}}</view>
                </view>
            </picker-view-column>
        </picker-view>
        <view class="ev-fr buttonBottom" style="height: {{30 + StatusBar}}px;position: initial;">
            <button bind:tap="hideModal" class="cu-btn block courseBtn" style="color:#282B2F" type="">
                取消
            </button>
            <button bind:tap="saveCourseNum" class="cu-btn block bg-blue courseBtn" type="">
                保存
            </button>
        </view>
    </view>
</view>