xz_mini/pages/newsDetail/newsDetail.wxml

89 lines
3.9 KiB
Plaintext
Raw Normal View History

<wxs src="/utils/utils.wxs" module="format"></wxs>
2023-07-27 14:28:57 +08:00
<!-- 是否需要关注公众号 -->
<view wx:if="{{isPublicCode}}" class="page-mask" catch:touchmove="move">
<view class="mask-hint">关注公众号即可阅读</view>
<view class="mask-btn" bind:tap="goAttention">去关注</view>
</view>
<view wx:if="{{newsBean}}">
2023-07-27 14:28:57 +08:00
<!-- newsContentType 1 文章 2图片 3音频 4视频 5PDF 6链接 -->
<!-- 文章 -->
<view wx:if="{{newsBean.newsContentType=='1'}}">
<view class="news-title">{{newsBean.newsContentTitle}}</view>
<view class="news-attr-box">
<view class="news-attr">新闻来源:{{newsBean.newsContentResource}}</view>
<view class="news-attr">发布时间:{{newsBean.newsContentPublishTime}}</view>
</view>
<view class="news-content">
<rich-text nodes="{{newsBean.newsContentContent}}"></rich-text>
</view>
</view>
<!-- 图片 -->
<view wx:elif="{{newsBean.newsContentType=='2'}}">
<view class="img-box" style="height: {{pageHeight}}px;">
<swiper autoplay="true" interval="10000" style="width: 100%;height: {{pageHeight}}px;">
<swiper-item class="swiper-item" wx:for="{{newsBean.fileList}}" wx:for-item="item" wx:key="index">
<image style="width: 100%;height: 500rpx;" src="{{imgUrl+item.contentFileFileId}}" mode="aspectFit"></image>
<view class="item-txt">
<custom-content content="{{item.contentFileText}}" maxline="2" position="right" foldable="true"></custom-content>
</view>
</swiper-item>
</swiper>
</view>
</view>
<!-- 音频 -->
<view wx:elif="{{newsBean.newsContentType=='3'}}">
<view class="audio-box">
<view class="audio-img">
<image class="img-bg" src="/images/ic_audio_bg.png" mode="scaleToFill"></image>
<image class="img-loading" wx:if="{{!canPlay}}" src="/images/loading-small.gif" mode="scaleToFill"></image>
</view>
<view class="progress">
<view class="current">{{format.formatDuration(currentTime)}}</view>
<slider class="slider" block-size="{{16}}" value="{{sliderValue}}" bindchange="handleSliderChange" max="{{totalValue}}"></slider>
<view class="duration">{{format.formatDuration(duration)}}</view>
</view>
<view class="option">
<image class="btn btn-prev" src="/images/play_prev.png" bindtap="preAudio"> </image>
<image class="btn btn-pause" src="{{isPlaying?'/images/play_pause.png':'/images/play_resume.png'}}" bindtap="playAudio"> </image>
<image class="btn btn-next" src="/images/play_next.png" bindtap="nextAudio"> </image>
</view>
<view class="category-title">目录</view>
<view class="video-category">
<view class="category-item {{index==currentAudioIndex? 'category-item-sel':''}}" wx:for="{{newsBean.fileList}}" wx:for-item="item" wx:key="index" bindtap="setAudioUrl" data-index="{{index}}" data-item="{{item}}">
<view>{{index+1}}</view>
</view>
</view>
</view>
<view class="flex desc-box">
<view>|</view>
<view style="margin-left: 10rpx;color: #242424;">详情</view>
</view>
<view class="desc">{{currentAudioDesc}}</view>
</view>
<!-- 视频 -->
<view wx:elif="{{newsBean.newsContentType=='4'}}">
<view class="video-box">
<video src="{{currentVideoUrl}}"></video>
<view class="category-title">目录</view>
<view class="video-category">
<view class="category-item {{index==currentVideoIndex? 'category-item-sel':''}}" wx:for="{{newsBean.fileList}}" wx:for-item="item" wx:key="index" bindtap="setVideoUrl" data-index="{{index}}" data-item="{{item}}">
<view>{{index+1}}</view>
</view>
</view>
</view>
<view class="flex desc-box">
<view>|</view>
<view style="margin-left: 10rpx;color: #242424;">详情</view>
</view>
<view class="desc">{{currentDesc}}</view>
</view>
<!-- PDF -->
<view wx:elif="{{newsBean.newsContentType=='5'}}">
<web-view src="{{newsBean.newsContentLink}}"></web-view>
</view>
<!-- 链接 -->
<view wx:elif="{{newsBean.newsContentType=='6'}}">
<web-view src="{{newsBean.newsContentContent}}"></web-view>
</view>
</view>
<page-loading wx:else></page-loading>