<view class="roll">
  <!-- 导航 -->
  <view class="nav">
    <view bindtap="navSwitch" data-index="0" class="{{navState==0 ? 'nav-switch-style':''}}">投票内容设置</view>
    <view bindtap="navSwitch" data-index="1" class="{{navState==1 ? 'nav-switch-style':''}}">投票规则设置</view>
  </view>
  <swiper bindchange="bindchange" current="{{navState}}" class="swp" style="width: 750rpx;  display: block; box-sizing: border-box">
    <block>
      <swiper-item style="width: 750rpx;  display: block; box-sizing: border-box; left: 0rpx; top: 0rpx; position: absolute">
        <!-- 内容页 -->
        <view class="maincon">
          <view class="imgbox">
            <view class="box_text" wx:if="{{!imgSrc}}" style="width: 720rpx; height: 600rpx; box-sizing: border-box; display: block">请上传封面</view>
            <view wx:if="{{imgSrc}}" class="code_box">
              <image class="code_img" src="{{imgSrc}}" name="votepage"></image>
              <!-- <view class="code_img" bindtap="previewImg">
                      <image class="uploading-icon" src="{{item}}"></image>
              </view>  -->
              <!--<view class="img_info">
        <view class="img_info_title">文件路径</view>
        <view class="img_info_detail">{{imgSrc}}</view>
      </view>-->
            </view>
          </view>
          <view class="button" bindtap="uploadImg" wx:if="{{!haveGetImgSrc}}">上传投票封面</view>
          <!-- <view class="button" bindtap="chooseImg" wx:if="{{!haveGetImgSrc}}">上传投票封面</view> -->
          <view class="button_clear" bindtap="clearImgSrc" wx:if="{{haveGetImgSrc}}">清空</view>

          <!--详情-->
          <view class="message">
            <view class="toupiaomingcheng" style="flex-direction:row;">
              <text>投票名称：</text>
              <input type="text" class="votename" placeholder="请输入投票名称" name="votename" bindinput="getvotename"/>
            </view>
            <view class="toupiaomingcheng" style="flex-direction:row;">
              <text>投票描述：</text>
              <view class="text-box">
                <!-- <text>{{votedetail}}</text> -->
                <textarea style="position: relative; left: 1rpx; top: 0rpx" class="votedetail" placeholder="请输入投票描述\(500字内\)" name="votedetail" maxlength="500" bindinput="getvotedetail" />
              </view>
            </view>
            <view class="toupiaomingcheng" style="flex-direction:row;">
              <text>添加选项</text>
              <!-- 选项 -->
              <view class="ops" wx:for="{{options}}" wx:key="{{index}}">
                <view class="opup">
                  <text class="opsid" name="opsid" data-index="{{index}}" >{{index+1}}</text>
                  <input type="text" placeholder="请输入选项名称" class="opsname" data-index="{{index}}" value="{{opsname[index]}}" bindinput="getopsname" name="opsname" data-tag="opsname" name="opsname" />
                </view>

                <view class="text-box1" hidden="{{opdhidden}}">
                  <text>{{currentInput}}</text>
                  <textarea class="votedetail1" placeholder="请输入选项描述\(200字内\)" maxlength="200" bindinput="getopsdetail" name="opsdetail" data-index="{{index}}" data-tag="opsdetail" value="{{opsdetail[index]}}" name="opsdetail" />
                </view>

                <view class="outter">
                  <view class="upload-video">
                    <block wx:if="{{opsvideo != ''}}">
                      <video src="{{opsvideo}}" class="img-li" name="opsvideo" data-index="{{index}}"></video>
                      <image class="icon-deletes" src="../../images/删除.png" bindtap="deleteVideo"></image>
                    </block>
                  </view>
                  <block>
                    <view class="img-li" wx:if="{{opsimage != ''}}"  wx:key="{{index}}"> 
                    <!-- wx:for="{{opsimage}}" -->

                      <view class="img-li" bindtap="previewImg">
                        <image class="uploading-icon" src="{{opsimage[index]}}"  name="opsimage" data-index="{{index}}" ></image>
                      </view>
                      <image class="icon-delete" src="../../images/删除.png" bindtap="deleteImg"></image>

                    </view>
                  </block>
                </view>
                <view class="opbtn">
                  <button class="addopsdetail" bindtap="adddetail">添加描述</button>
                  <button class="addopsadd" bindtap="addfujian">添加附件</button>
                   <!-- wx:if="{{imgList.length<=8}}"  wx:if="{{opsimage.length<=1}}"   wx:if="{{opsimage.length>1}}"-->
                   <!-- <button class="addopsadd" >附件已满</button> -->
                  <button class="delops" bindtap="deleteoptions" data-index="{{index}}">删除</button>
                </view>
              </view>

              <button class="addopsbtn" bindtap="addoptions" data-index="{{index}}">
                <image src="../../images/添加默认.png" class="addbtnimg"></image>
                <text class="addbtn">添加选项</text>
              </button>
            </view>
<view class="sh">
<text class="smallhelper" decode="true">&lt;-------- 向左滑动设置投票&gt;</text>
</view>
          </view>
        </view>
        <!-- 底部固定
        <view class="bt" style="position: fixed; left: 0rpx; top: 960rpx">
          <view class="btbt">
            <button class="save">保存投票</button>
            <button class="post">发布投票</button>
          </view>
        </view> -->

      </swiper-item>
      <swiper-item class="swi2">
        <!-- 规则页 -->
        <scroll-view :scroll-y="true" :style="{height: clientHeight?clientHeight+'px':'auto'}">
          <view class="setting">
            <view class="tui-picker-content1">
              <view class="tui-picker-name">投票开始时间</view>
              <picker mode="multiSelector" value="{{dateTime1}}" bindchange="changeDateTime1" bindcolumnchange="changeDateTimeColumn1" range="{{dateTimeArray1}}">
                <view class="tui-picker-detail">
                  {{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}}
                </view>
              </picker>
            </view>

            <view class="tui-picker-content">
              <view class="tui-picker-name">投票结束时间</view>
              <picker mode="multiSelector" value="{{dateTime2}}" bindchange="changeDateTime2" bindcolumnchange="changeDateTimeColumn2" range="{{dateTimeArray2}}">
                <view class="tui-picker-detail">
                  {{dateTimeArray2[0][dateTime2[0]]}}-{{dateTimeArray2[1][dateTime2[1]]}}-{{dateTimeArray2[2][dateTime2[2]]}} {{dateTimeArray2[3][dateTime2[3]]}}:{{dateTimeArray2[4][dateTime2[4]]}}
                </view>
              </picker>

            </view>
            <!-- <view class="blocker"></view> -->
            <!-- 开关设置 -->
            <view class="ifunname">
              投票者是否匿名
              <switch class="tui-fr" color="#007aff" checked="{{isunname}}" bindchange="changeSwitch4" name="isunname" />
            </view>

            <view class="ifunname1">
              <view>投票是否公示热门</view>
              <switch class="tui-fr" color="#5ea6e9" checked="{{canhot}}" bindchange="changeSwitch4" name="canhot" />
            </view>

            <view class="ifunname2">
              <view>投票是否可转发</view>
              <switch class="tui-fr" color="#5ea6e9" checked="{{canshare}}" bindchange="changeSwitch4" name="canshare" />
            </view>

            <view class="ifunname3">
              <view>投票结果是否公开</view>
              <switch class="tui-fr" color="#5ea6e9" checked="{{ispublic}}" bindchange="changeSwitch4" name="ispublic" />
            </view>

            <view class="ifunname4">
              <view>每人每天投票次数</view>
              <input class="weui-inputset" type="number" placeholder="请输入投票数" name="setvotes" bindinput="getsetvotes" />
            </view>

            <view class="ifunname5">
              <view>是否可对单一选项重复投票</view>
              <switch class="tui-fr" color="#5ea6e9" checked="{{canvotes}}" bindchange="changeSwitch4" name="canvotes" />
            </view>

          </view>

          <view class="bt">
            <view class="btbt">
              <button class="save">保存投票</button>
              <button class="post"  bindtap="postvote">发布投票</button>
            </view>
          </view>
          <!-- <view class="btnblocker"></view> -->

        </scroll-view>
      </swiper-item>

    </block>
  </swiper>
</view>