mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
优化打包为小程序时巡检图片的bug
Signed-off-by: java110 <928255095@qq.com>
This commit is contained in:
parent
f0b05be2b2
commit
5658df9a7e
@ -142,7 +142,7 @@
|
||||
var tempFilePaths = upImgRes.tempFilePaths[0]
|
||||
that.imgList.push(tempFilePaths);
|
||||
that.$forceUpdate();
|
||||
//#ifdef H5
|
||||
|
||||
TanslateImage.translate(tempFilePaths, (base64) => {
|
||||
let _objData = {
|
||||
uploadFile: base64,
|
||||
@ -152,19 +152,6 @@
|
||||
that.photos.push(res);
|
||||
})
|
||||
})
|
||||
//#endif
|
||||
|
||||
//#ifndef H5
|
||||
factory.base64.urlTobase64(tempFilePaths).then(function(base64) {
|
||||
let _objData = {
|
||||
uploadFile: base64,
|
||||
communityId: that.communityId
|
||||
}
|
||||
uploadImageAsync(_objData, that).then((res) => {
|
||||
that.photos.push(res);
|
||||
})
|
||||
});
|
||||
//#endif
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uploadImageAsync ref="vcUploadRef" :communityId="communityId" :maxPhotoNum="uploadImage.maxPhotoNum" :canEdit="uploadImage.canEdit" :title="uploadImage.imgTitle" @sendImagesData="sendImagesData" style="margin-top: 30rpx;"></uploadImageAsync>
|
||||
<uploadImageAsync ref="vcUploadRef" :communityId="communityId" :sourceType="sourceType" :maxPhotoNum="uploadImage.maxPhotoNum" :canEdit="uploadImage.canEdit" :title="uploadImage.imgTitle" @sendImagesData="sendImagesData" style="margin-top: 30rpx;"></uploadImageAsync>
|
||||
|
||||
<view class="cu-form-group margin-top" v-if="mapKey">
|
||||
<view class="title">当前位置</view>
|
||||
@ -86,19 +86,17 @@
|
||||
maxPhotoNum: 4,
|
||||
imgTitle: '巡检图片',
|
||||
canEdit: true
|
||||
}
|
||||
},
|
||||
sourceType:[ 'camera']
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
uploadImageAsync
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
this.java110Context.onLoad();
|
||||
|
||||
let that = this;
|
||||
|
||||
this.mapKey = conf.QQMapKey;
|
||||
wx.getLocation({
|
||||
type: 'gcj02',
|
||||
@ -198,45 +196,7 @@
|
||||
this.patrolTypeName = selected.name;
|
||||
this.patrolType = selected.statusCd;
|
||||
},
|
||||
removePhoto: function(e) {
|
||||
let _imgList = [];
|
||||
this.imgList.forEach(function(item, index) {
|
||||
if (index != e) {
|
||||
_imgList.push(item);
|
||||
}
|
||||
});
|
||||
let _photos = [];
|
||||
this.photos.forEach(function(item, index) {
|
||||
if (index != e) {
|
||||
_photos.push(item);
|
||||
}
|
||||
});
|
||||
this.photos = _photos;
|
||||
this.imgList = _imgList;
|
||||
},
|
||||
deleteImage: function(e) {
|
||||
let imageArr = this.$data.imgList;
|
||||
imageArr.splice(e, 1);
|
||||
this.photos.splice(e, 1);
|
||||
},
|
||||
ChooseImage: function(e) {
|
||||
let that = this;
|
||||
wx.chooseImage({
|
||||
count: 4, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['camera'], //手机拍照
|
||||
success: (res) => {
|
||||
|
||||
that.$data.imgList.push(res.tempFilePaths[0]);
|
||||
var tempFilePaths = res.tempFilePaths[0]
|
||||
|
||||
TanslateImage.translate(tempFilePaths, (url) => {
|
||||
that.photos.push(url);
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_submitExcuteInspection: function() {
|
||||
let _that = this;
|
||||
uni.showLoading({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user