|
@@ -218,7 +218,27 @@ export default {
|
|
|
async submitForm() {
|
|
async submitForm() {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
if (this.fileList.length > 0) {
|
|
if (this.fileList.length > 0) {
|
|
|
- const waitUpload = await self.uploadFile(this.fileList[0].url, 0);
|
|
|
|
|
|
|
+ uni.getImageInfo({
|
|
|
|
|
+ src:self.fileList[0].url,
|
|
|
|
|
+ success(res) {
|
|
|
|
|
+ let canvasWidth = res.width //图片原始长宽
|
|
|
|
|
+ let canvasHeight = res.height
|
|
|
|
|
+ if(canvasWidth>1000||canvasHeight>1000){
|
|
|
|
|
+ uni.compressImage({
|
|
|
|
|
+ src: self.fileList[0].url,
|
|
|
|
|
+ quality: 75,
|
|
|
|
|
+ width:"50%",
|
|
|
|
|
+ height:"50%",
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ console.log(res.tempFilePath,66)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }else{
|
|
|
|
|
+ //无需压缩
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ // const waitUpload = await self.uploadFile(dataURL, 0);
|
|
|
}
|
|
}
|
|
|
var data = {
|
|
var data = {
|
|
|
userId: this.form.userId,
|
|
userId: this.form.userId,
|