first.wxml 4.5 KB
<view wx-if="{{pages_types}}">
  <!-- 视频 -->
  <view class="video" wx:if="{{today_data.video_file}}"> 
      <video src="{{today_data.video_file}}" show-center-play-btn="{{true}}" show-progress="{{false}}" show-fullscreen-btn="{{true}}"></video>
  </view>
  <!-- 音频 -->
  <view class="audio" wx:if="{{today_data.audio_file}}" >
      <!-- <audio controls src="http://m10.music.126.net/20210728150904/ef325f8ac68a3710a2c7cfec82a70096/ymusic/045e/000b/0f0f/34bf44037a7a4cb160928e5a21c314a0.mp3"></audio>   -->
      
      <view style="width:686rpx;margin:0 auto">
          <slider-audio  audio-src="{{today_data.audio_file}}" id="audio" audioName="{{today_data.title}}"></slider-audio>
      </view>
  </view>

  <!-- 播放音频 -->
  <view class="audio_play" bindtap="PlayState" wx:if="{{today_data.audio_file && today_data.type != 3}}">
    <image class="audio_img" src="../../img/ic_voice56@2x.png"></image>
  </view>

  <!-- 文本 -->
  <view class="essay" wx:if="{{today_data.text}}">
      <text>{{today_data.text}}</text>
  </view>

  <!-- 第三方外部连接  -->
  <view class="essay"  wx:if="{{today_data.web_url}}" bindtap="web_url" data-webUrl="{{today_data.web_url}}">
      <image src="{{webImg}}"></image>
    <image src="../../img/ic_play@2x.png" mode="widthFix"></image>
  </view>
  <!-- 图片 -->
  <view class="image" wx:if="{{today_data.image.length != 0}}">
      <swiper indicator-dots
          autoplay interval="{{2000}}" >
          <block wx:for="{{today_data.image}}" wx:key="index">
            <swiper-item>
              <image src="{{item}}" mode="widthFix"></image>
            </swiper-item>
          </block>
        </swiper>
  </view>

  <!-- 音频录制  -->
  <view class="recording"  wx:if="{{today_data.type == 3}}">
      <view class="art">
        <!-- //录音状态 0未录音 1开始录音 2录音完成  3播放录音 -->
          <view>
            <image src="/img/ic_voice40@2x.png" bindtap="PlayState" wx:if="{{today_data.audio_file && today_data.type == 3}}"></image> 
          </view>
          <image src="/img/ic_rec_n@2x.png" wx:if="{{soundType != 1 }}" bindtap="startRecord"></image> 
          <image src="/img/ic_rec_s@2x.png" wx:if="{{soundType == 1}}" bindtap="stopRecord"></image>
          <image src="/img/ic_play_u@2x.png" wx:if="{{soundType == 0 || soundType == 1}}"></image>
          <image src="/img/ic_play_n@2x.png" wx:if="{{soundType == 2}}"  bindtap="play_voice" ></image>
          <image src="/img/play.png" wx:if="{{soundType == 3}}" bindtap="pause_voice"></image>
      </view>
  </view>

  <!-- 上传图片 -->
  <view class='ui_uploader_cell' wx:if="{{today_data.type == 2}}">
      <!-- 根据已选择的图片临时路径数组展示图片-->
      <view class='ui_uploader_item' wx:for="{{imglist}}" wx:key="index">
        <!-- 删除-->
        <icon class='ui_uploader_item_icon' bindtap='clearImg' data-index="{{index}}" type="clear" size="20"
          color="red" />
        <!-- 图片-->
        <image bindtap='showImg' data-index="{{index}}" src=' {{http_url}}{{item}}'></image>
      </view>
      <!-- 上传按钮+框 -->
      <view class='ui_uploader' bindtap='upload' wx:if="{{showUpload}}">
        <image src="../../img/upload.png"></image>
      </view>
    </view>

  <view class="porogress">
      <text>{{current}}</text>
      <text>/</text>
      <text>{{Count}}</text>
  </view>

  <view class="box-end" bindtap="gotoday">{{current != Count ? 'Next' : ' 完成打卡'}}</view>

  <view class="alter" wx:if="{{alterType}}">
    <view class="mask">
        <image src="/img/img_star@2x.png"></image>
    </view>
    <view class="denglu" wx:if="alterType">
        <view>恭喜你</view>
        <view wx:if="{{alterData.score}}">获得积分<text>{{alterData.score}}</text> </view>
        <view class="text_bar"> 
          <view>
            <view>
              <text>{{alterData.score}}</text>
              <text>分</text>
            </view>
            <text>今日学习时长</text>
          </view>
          <view>
            <view>
              <text>{{alterData.readwords}}</text>
              <text>个</text>
            </view>
            <text>打卡单词</text>
          </view>
          <view>
            <view>
              <text>{{alterData.readbook}}</text>
              <text>本</text>
            </view>
            <text>打卡英语书</text>
          </view>
        </view>
        <text>{{alterData.Happy}}</text>
        <view class="button" bindtap="gototram">开心收下</view>
    </view>
  </view>
</view>