<script>
// 查看媒体文件，支持图片和视频
import MediaList from "./components/MediaList.vue";
const imgExts = ['png', 'jpg', 'jpeg', 'gif']
export default {
  name: "media",
  components: {MediaList},
  data(){
    return {
      pictureUrls:[]
    }
  },
  onLoad(options){
    // 打开此页面之前，请将需要查看的媒体文件列表放到 uni.MEDIA_LIST 中
    this.pictureUrls = uni.MEDIA_LIST || []
    if(!this.pictureUrls.length){
      return uni.showModal({
        title:this.$t('提示'),
        content: this.$t('暂无可查看内容'),
        showCancel:false,
        success(){
          uni.navigateBack()
        }
      })
    }
  }
};
</script>

<template>
  <media-list :value="pictureUrls" readonly></media-list>
</template>

<style scoped lang="scss">

</style>
