<!--pages/home/xx/xz/xz.wxml-->
<view class="bgt1"></view>
<view class="xinfo">
    <scroll-view scroll-y enhanced="{{true}}" show-scrollbar="{{false}}" class="xinfo-content">
        <view class="xinfo-yl-title" wx:if="{{Preview}}">
            To: {{to}}
        </view>
        <view class="xinfo-title" wx:if="{{!Preview}}">
            <view class="title-to">
                <view class="text">To:</view>
                <t-input model:value="{{to}}" />
            </view>
            <view class="title-form">
                <view class="text">From:</view>
                <t-input model:value="{{from}}"/>
            </view>
        </view>
        <!-- 信件文本 -->
        <view class="xinfo-main">
            <t-textarea autosize="true" model:value="{{content}}" placeholder="信件正文" />
        </view>
        <!-- 信件语音 -->
        <view class="{{Preview ? 'xinfo-ltqp-yl' : 'xinfo-ltqp'}}" wx:for="{{audioList}}" wx:key="index" bindtap="listen" data-url="{{item}}">
            <image class="xinfo-yuying" src="https://wish-assets.windymuse.com.cn/xy/%E8%AF%AD%E9%9F%B3.png"></image>
            <view class="xinfo-ltqp-text">{{item.extra.duration}}</view>
            <t-icon class="xinfo-close" name="close-circle" size="48rpx" wx:if="{{!Preview}}" bindtap="ClearYl" data-id="{{item.resourceId}}"/>
        </view>
        <!-- 信件图片 -->
        <view class="{{Preview ? 'xinfo-img-yl' : 'xinfo-img'}}" wx:for="{{imgList}}" wx:key="index">
            <image src="{{item.img}}" mode="widthFix"></image>
            <view class="xinfo-img-close" bindtap="ClearImg" data-id="{{item.resourceId}}">
                <t-icon name="close-circle" size="48rpx" wx:if="{{!Preview}}"/>
            </view>
        </view>
        
        <view class="xinfo-yl-form" wx:if="{{Preview}}">
            From: {{from}}
        </view>

        <view class="xinfo-yl" wx:if="{{Preview}}"></view>
    </scroll-view>
</view>
<view class="bgt2" wx:if="{{showBtn}}">
    <view class="bgt2-btn1" bindtap="goBack">
        <image src="https://wish-assets.windymuse.com.cn/xy/iconPark-return%401x.png"></image>
    </view>
    <view class="bgt2-btn2" bindtap="openSound" wx:if="{{!Preview}}">音讯</view>
    <view class="bgt2-btn3" bindtap="addImg" wx:if="{{!Preview}}">画像</view>
    <view class="bgt2-btn4" bindtap="openPreview" wx:if="{{!Preview}}">预览</view>
    <view class="bgt2-btn5" bindtap="openShowSend" wx:if="{{!Preview}}">寄出</view>
    <view class="bgt2-yz"></view>
</view>

<view class="taost" wx:if="{{showImgBig}}">
    <view class="taost-box">
        <view class="taost-box-text">图片太大了</view>
        <view class="taost-box-text">请上传5M以内的图片</view>
        <view class="taost-box-btn" bindtap="closeShowImgBig">好的</view>
    </view>
</view>

<view class="sound" wx:if="{{showSound}}">
    <view class="sound-box">
        <view class="sound-box-top">
            <view bindtap="closeSound">取消</view>
            <view bindtap="addSound">添加</view>
        </view>
        <view class="sound-box-time">{{soundTime}}</view>
        <view class="sound-box-img" wx:if="{{showSoundImg}}"></view>
        <view class="sound-box-img2" wx:if="{{!showSoundImg}}">
            <image wx:for="{{35}}" wx:key="index" src="https://wish-assets.windymuse.com.cn/xy/iconPark-acoustic%20Copy%203%401x.png"/>
        </view>
        <view class="sound-box-btn">
            <view class="btn1" wx:if="{{btn1}}" bindtap="startSound">
                <view class="btn-being"></view>
            </view>
            <view class="btn1" wx:if="{{btn2}}" bindtap="endSound">
                <view class="btn-have"></view>
            </view>
            <view class="btn1" wx:if="{{btn3}}" bindtap="playVoice">
                <view class="btn-over"></view>
            </view>
            <view class="btn1" wx:if="{{btn4}}" bindtap="stopVoice">
                <view class="btn-video"></view>
            </view>
        </view>
    </view>
</view>

<view class="taost" wx:if="{{showSoundMore}}">
    <view class="taost-box">
        <view class="taost-box-text">最多只能添加</view>
        <view class="taost-box-text">3条语言</view>
        <view class="taost-box-btn" bindtap="closeShowSoundMore">好的</view>
    </view>
</view>

<view class="taost" wx:if="{{showImgToast}}">
    <view class="taost-box">
        <view class="taost-box-text">最多只能上传</view>
        <view class="taost-box-text">9张图片</view>
        <view class="taost-box-btn" bindtap="closeShowImgToast">好的</view>
    </view>
</view>

<view class="taost" wx:if="{{showSend}}">
    <view class="taost-box">
        <view class="taost-box-text">确定要寄出吗？</view>
        <view class="taost-box-text">信件寄出后，再次使用晶石激活</view>
        <view class="taost-box-text">将直接提示打开信件</view>
        <view class="Send-btn">
            <view class="taost-box-btn" bindtap="closeShowSend">取消</view>
            <view class="taost-box-btn" bindtap="already">确定</view>       
        </view>
    </view>
</view>

<view class="already" wx:if="{{showAlready}}">
    <view class="already-top"></view>
    <view class="already-img"></view>
    <view class="already-text">
        <view class="already-text1">你的信件已打包好！</view>
        <view class="already-text1">快把晶石送给收信人吧！</view>
        <view class="already-text3">收信人首次将晶石贴近手机</view>
        <view class="already-text2">将会提示打开信件</view>
        <view class="already-text2">点击OK回到未激活初始页面</view>
        <view class="already-text2">如果误打开信件，需要再次寄出哦！</view>
        <view class="already-btn">
            <view class="btn" bindtap="modify">修改</view>
            <view class="btn" bindtap="logout">OK</view>
        </view>
    </view>
    <view class="already-bom"></view>
</view>
