<My_card custom-class='box'>
    <view class="label">素材标题</view>
    <input class="input base" bindinput='titleInput' value="{{content.title}}" placeholder-style='font-size: 28rpx;' placeholder='请输入标题' />
    <!-- 富文本 -->
    <My_richText show="{{editRichText}}" bindcallback='getRichText' />

    <view class="label">素材分类</view>
    <navigator class="category base" url="#" bindtap="openSelect">
        <view>{{activeName||"请选择素材分类"}}</view>
        <van-icon name="arrow-down" />
    </navigator>

    <block wx:if="{{uploadType=='richtext'}}">
        <view class="label">上传图文</view>
        <view class="input base" style="display: flex; justify-content: space-between; color: #999;">
            {{content.content==''?'请编辑文本':'浏览已编辑文本'}} <text style="color: #3874F6;" catchtap="openEditRichText">编辑/预览</text>
        </view>
    </block>


    <van-popup show="{{ selectShow }}" position="top" bind:close="onClose">
        <!-- 分类选择 -->
        <van-tree-select items="{{ items }}" main-active-class='main-active' content-active-class='content-active' main-active-index="{{ mainActiveIndex }}" active-id="{{content.sat_sharematerial_classid}}" bind:click-nav="onClickNav" bind:click-item="onClickItem" />
    </van-popup>

    <block wx:if="{{uploadType!='richtext'}}">
        <view class="label">上传{{uploadType=='image'?'图片':'视频'}}<text>已上传{{detailsData.attinfos.length}}个</text></view>
        <view class="file-list">
            <view class="file-box" wx:for="{{detailsData.attinfos}}" data-item="{{item}}" bindtap="openFile">
                <view class="delete" catchtap="deleteFile" data-item="{{item}}" data-index="{{index}}">
                    <van-icon class="icon" name="clear" />
                </view>
                <image wx:if="{{item.fileType=='image'}}" src="{{item.cover}}" mode="aspectFit" />
                <image wx:elif="{{item.fileType=='video'}}" style="width: 100rpx; height: 100rpx;" src="../../static/image/file/video.png" />
            </view>
            <My_upload accept='{{uploadType}}' binduploadCallback='getFile'>
                <navigator url="#" class="file-box upload-file">
                    <view>
                        <view class="iconfont icon-a-tuiguangsucaishangchuan1"></view>
                        <view>上传{{uploadType=='image'?'图片':'视频'}}</view>
                    </view>
                </navigator>
            </My_upload>
        </view>
    </block>
</My_card>

<view class="but-bom">
    <van-button custom-class='upload' disabled='{{!content.title}}' loading='{{loading}}' loading-text="保存中..." bindtap="submit">提交</van-button>
</view>
<view style="height: 130rpx;" />