<view class="cu-form-group">
<view class="grid col-3 grid-square flex-sub">
<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage">
<image :src="imgList[index]"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
<view class="solids" @tap="ChooseImage" v-if="imgList.length<6">
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
//图片上传模块
ChooseImage() {
uni.chooseImage({
count: 6-_self.imgList.length,
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
//sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album','camera'], //从相册选择
success: (res) => {
if (_self.imgList.length !== 0) {
console.log('tempFilePaths',res.tempFilePaths)
_self.imgList = _self.imgList.concat(res.tempFilePaths[0])
uni.showToast({
title:res.tempFilePaths[0],
icon:"none",
duration: 2000
});
} else {
_self.imgList = res.tempFilePaths
uni.showToast({
title:_self.imgList[0],
icon:"none",
duration: 2000
});
}
console.log('item',_self.imgList)
}
});
},