<!--packageI/newMedia/newMediaPublish/newMediaPublish.wxml-->

<view class="page" wx:if="{{type!='video' && type!='advideo'}}">
  <title-box>
    <view slot="title">上传封面</view>
  </title-box>
  <view class="cover-box">
    <yz-uploader bind:updateImages="updateFaceImage" customStyle="width:340rpx;height:453rpx;background: #fafafa;border: dashed 2rpx #e5e5e5;"
      customBoxStyle="padding:0;" max_count="{{1}}">
    </yz-uploader>
    <view class="proposal">建议尺寸：340*453px</view>
  </view>

  <view class="title" style="padding-top:40rpx;">
    <template is="title"></template>
  </view>

  <title-box wx:if="{{type=='audio'}}">
    <view slot="title">上传音频文件</view>
  </title-box>

  <view class="audio-player" wx:if="{{type=='audio'}}">
    <audio-play bind:successUp="successUpAudio" audioSrc="{{audioUrl}}" openUpload="{{true}}"  ></audio-play>
  </view>

 

  <view class="textarea" wx:if="{{type!='audio'}}">
    <textarea placeholder="添加正文" maxlength="-1" model:value="{{textarea}}"></textarea>
  </view>
  <view class="imageList" wx:if="{{type=='news'}}">
    <yz-uploader bind:updateImages="updateNewImageList" 
      customStyle="width:210rpx;height:210rpx;margin:0;"
      customIconStyle="background: #fafafa;border: dashed 2rpx #e5e5e5;" customImgStyle="border:none;"
      customBoxStyle="padding:0;display: grid;grid-template-columns: repeat(3, 1fr);grid-row-gap: 20rpx;">
    </yz-uploader>
  </view>

</view>


<view class="page" wx:if="{{type=='video' || type=='advideo'}}">
  <view class="title">
    <template is="title"></template>
  </view>
  <view class="videoContent">
    <yz-upVideo bind:beforeUp="beforeUpVideo" bind:successUp="successUpVideo" width="310rpx" height="400rpx"
      limit="{{setting.video_length}}" videoUrl="{{videoUrl}}"></yz-upVideo>
    <yz-uploader bind:updateImages="updateFaceImage" customStyle="width:310rpx;height:400rpx;border:none;background: #fafafa;"
      customBoxStyle="padding:0;" max_count="{{1}}" isSlot="{{true}}">
      <view class="back_img">
        <image src="../../../image/uppictures.png" mode='widthFix' />
      </view>
      <view class="tips">提示：上传的视频封面图尽量和视频高度一致</view>
    </yz-uploader>
  </view>

  <view class="formItems" wx:if="{{type=='advideo'}}">
    <view class="formItem">
      <title-box>
        <view slot="title">流量值单价</view>
        <input slot="desc" type="number" model:value="{{stream_univalent}}" placeholder="请输入流量值"  />
      </title-box>
    </view>
    <view class="desc">最低值{{setting.min_stream_hour}}流量值/小时</view>
    <view class="formItem">
      <title-box>
        <view slot="title">按投放时间(小时)</view>
        <input slot="desc" type="number" model:value="{{duration}}" placeholder="请输入投放时间" />
      </title-box>
    </view>
    <view class="formItem">
      <title-box required="{{false}}">
        <view slot="title">链接</view>
        <input slot="desc" type="text" model:value="{{link}}" placeholder="请输入链接" />
      </title-box>
    </view>
  </view>

</view>


<view style="height:calc(150rpx + env(safe-area-inset-bottom))"></view>
<view class="sendBtns">
  <view class="sendBtn buttonActive" bindtap="send">提交</view>
</view>

<shortcut-menu path="publish" ></shortcut-menu>


<!-- <van-popup show="{{ true }}" closeable round bind:close="closePopup" custom-style="width: 550rpx;height: 566rpx;" class="fail-popup">
  <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/new_media/fail_popup_bg.png" mode="widthFix" ></image>
  <view class="fail-prompt">
    发布内容包含以下禁止文字：
    <view class="fail-keywords">最大 最强最强最强最强最强最强最强</view>
  </view>
</van-popup> -->


<van-popup show="{{ failPopup }}" custom-style="background:transparent;">
  <view class="fail-popup">
    <view class="fail-popup-wrapper">
      <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/new_media/fail_popup_bg.png" mode="widthFix"></image>
      <view class="fail-prompt">
        {{errorData.msg}}
        <view class="fail-keywords">
          <block wx:for="{{errorData.data.title}}">{{item+" "}}</block>
          <block wx:for="{{errorData.data.content}}">{{item+" "}}</block>
        </view>
      </view>
    </view>
    <icon bindtap="setFailPopup" class="close iconfont icon-adsystem_icon_cancle"></icon>
  </view>
</van-popup>

<template name="title">
  <title-box>
    <view slot="title">标题</view>
    <input slot="desc" type="text" model:value="{{title}}" placeholder="请输入标题" />
  </title-box>
</template>







