<view v-show="imageList.length < 5" class=" flex flex-direction align-center justify-center uimg">
<view class="flex">
<image style="width: 37rpx;height: 30rpx;" src="/static/image/icon_order_xiangji.png" />
</view>
<view class="flex" style="color: #9B9B9B;font-size: 18rpx;" @tap="chooseImg">添加照片</view>
</view>
chooseImg() {
if (this.imageList.length >= 5) {
uni.showToast({
title: '最多上传5张',
});
return;
}
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: (res) => {
this.imageList = this.imageList.concat(res.tempFilePaths);
},
});
},
1***@163.com (作者)
您好 这里是直接调用的API,不涉及项目的其他内容,这里我上传了这个页面。
2022-01-20 16:33