图片裁剪后过于模糊问题修复

This commit is contained in:
donqi 2022-08-03 11:13:35 +08:00
parent ff8b497c04
commit e33e775380
1 changed files with 8 additions and 6 deletions

View File

@ -204,7 +204,7 @@
</view> </view>
</view> </view>
</view> </view>
<ksp-cropper mode="fixed" :width="cropWidth" :height="cropHeight" :maxWidth="1024" :maxHeight="1024" :url="url2Crop" <ksp-cropper mode="fixed" :width="cropWidth" :height="cropHeight" :maxWidth="cropWidth" :maxHeight="cropHeight" :url="url2Crop"
@cancel="oncancel" @ok="onok"></ksp-cropper> @cancel="oncancel" @ok="onok"></ksp-cropper>
<view class="cu-bar bg-white solid-top"> <view class="cu-bar bg-white solid-top">
<view class="action text-black"> <view class="action text-black">
@ -272,9 +272,10 @@
coverImgList: [], coverImgList: [],
videoList: [] videoList: []
}, },
sysInfo: null,
url2Crop: '', url2Crop: '',
cropWidth: 200, cropWidth: 0,
cropHeight: 300, cropHeight: 0,
curImgListField: '', curImgListField: '',
categoryList: [], categoryList: [],
categoryMultiIndex: [0, 0], categoryMultiIndex: [0, 0],
@ -327,7 +328,8 @@
this.loadData(goodId); this.loadData(goodId);
}, },
methods: { methods: {
async loadData(goodId) { async loadData(goodId) {
this.sysInfo = uni.getSystemInfoSync();
this.curUserInfo = this.$request.getCurUserInfo(); this.curUserInfo = this.$request.getCurUserInfo();
this.checkBankAndCertify(); this.checkBankAndCertify();
this.loadCategoryList(); this.loadCategoryList();
@ -489,8 +491,8 @@
} }
}, },
chooseImgList(e, imgListField, cropWidth, cropHeight) { chooseImgList(e, imgListField, cropWidth, cropHeight) {
this.cropWidth = cropWidth && cropWidth > 0 ? cropWidth : 200; this.cropWidth = cropWidth && cropWidth > 0 ? cropWidth : this.sysInfo.windowWidth * 2;
this.cropHeight = cropHeight && cropHeight > 0 ? cropHeight : 300; this.cropHeight = cropHeight && cropHeight > 0 ? cropHeight : this.sysInfo.windowWidth * 2 * 1.5;
uni.chooseImage({ uni.chooseImage({
count: 1, //9 count: 1, //9
sizeType: ['original', 'compressed'], // sizeType: ['original', 'compressed'], //