上传图片视频app选择媒体"/>
uniapp上传图片视频app选择媒体
app上传媒体
因为uniapp开发app是无法同时选择图片和视频的,只能分开调用图片选择和视频选择
图片选择的api:uni.chooseImage
视频选择的api:uni.chooseVideo
选择图片和视频的组件:
<template><!-- 适用于新建 getUrlList方法为父组件获取的图片加视频的数组集合--><view class="bodyClass"><!-- 显示图片视频 --><view class="" style="display: flex;flex-wrap: wrap;"><viewstyle="position: relative;height: 151rpx;width: 151rpx;border: 1px solid rgba(209, 209, 209, 0.6);border-radius: 8rpx;margin: 0 20rpx 20rpx 0;"v-for="(item,index) in imageList" :key="index"><image :src="item" mode="aspectFill" style="height: 151rpx;width: 151rpx;"@click="previewImage(imageList,index)"></image><uni-icons color="#A4A4A4" type="clear" size="20"style="position: absolute;right: -15rpx;top: -15rpx;z-index: 999;" @click="delImg(index)"></uni-icons></view><view class=""style="position: relative;height: 151rpx;width: 151rpx;border: 1px solid rgba(209, 209, 209, 0.6);border-radius: 8rpx;margin: 0 20rpx 20rpx 0;"v-for="(item2,index2) in vedioList"
更多推荐
uniapp上传图片视频app选择媒体
发布评论