import compressImage from '@/common/imageutil.js'(文章最后);
const device = uni.getSystemInfoSync();
<!-- 图片上传 -->
<wslimg title="图片上传" :num="40" :dataList="dataList" @chooseImg="chooseImg" @close="close($event)"></wslimg>
<view style="color: #00BFFF;padding: 10upx;"><progress :percent="percent" show-info strock-width="10"></progress><!-- <text style="color: #00BFFF;margin-left: 48%;">{
{percent}}%</text> --></view>
<view class="btn-logout" hover-class="btn-logout-hover" @tap="uploadImg()">
<text>开始上传</text>
</view>
chooseImg() {
uni.chooseImage({
sourceType: ["camera", "album"],
sizeType: ['original'],
count: this.num - this.dataList.length,
success: async (res) => {
const tempFilePaths = res.t

本文介绍了一种在不同平台(iOS和安卓)上优化图片压缩和上传的方法,通过使用plus.zip.compressImage函数根据设备信息和图片方向调整压缩参数,实现高质量但体积更小的图片上传,适用于小程序和跨平台应用。

4519

被折叠的 条评论
为什么被折叠?



