|
@@ -135,13 +135,47 @@ export default {
|
|
|
// 原生H5拍照图片
|
|
// 原生H5拍照图片
|
|
|
// url: base64
|
|
// url: base64
|
|
|
getImg(base64) {
|
|
getImg(base64) {
|
|
|
|
|
+ if (this.objectType == '' || this.objectType == null) {
|
|
|
|
|
+ this.$toast('请选择类型!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// 图片名称:用户名-时间戳
|
|
// 图片名称:用户名-时间戳
|
|
|
let username = localStorage.getItem('nickName');
|
|
let username = localStorage.getItem('nickName');
|
|
|
let imgName = username + '-' + new Date().getTime();
|
|
let imgName = username + '-' + new Date().getTime();
|
|
|
uploadAliOss(base64, imgName)
|
|
uploadAliOss(base64, imgName)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
- debugger;
|
|
|
|
|
- addH5Photo();
|
|
|
|
|
|
|
+ if (res.url && res.url.indexOf('http') != -1) {
|
|
|
|
|
+ var form = {
|
|
|
|
|
+ fileUrl: res.url,
|
|
|
|
|
+ collectionItemId: this.collectionId,
|
|
|
|
|
+ objectType: this.objectType,
|
|
|
|
|
+ storeGroupId: this.storeGroupId,
|
|
|
|
|
+ taskId: this.taskId,
|
|
|
|
|
+ visitsId: localStorage.getItem('visitId'),
|
|
|
|
|
+ visitModel: this.visitModel,
|
|
|
|
|
+ visitSource: '1',
|
|
|
|
|
+ locationRemark: '',
|
|
|
|
|
+ parentCollectionId: this.parentCollectionId || '',
|
|
|
|
|
+ secondCollectionId: this.secondCollectionId || '',
|
|
|
|
|
+ firstCollectionId: this.firstCollectionId || '',
|
|
|
|
|
+ fourthCollectionId: this.fourthCollectionId || '',
|
|
|
|
|
+ thirdCollectionId: this.thirdCollectionId || '',
|
|
|
|
|
+ deviceCode: this.deviceCode, //设备编号
|
|
|
|
|
+ putInCode: this.putInCode, //投放编号
|
|
|
|
|
+ };
|
|
|
|
|
+ this.controller = null;
|
|
|
|
|
+ // 需要图匠校验的添加参数和loading
|
|
|
|
|
+ if (this.photoIdentifyType) {
|
|
|
|
|
+ form.photoIdentifyType = this.photoIdentifyType;
|
|
|
|
|
+ this.progress();
|
|
|
|
|
+ this.controller = new AbortController(); //取消请求
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.toastLoading(0, '上传中...', true);
|
|
|
|
|
+ }
|
|
|
|
|
+ addH5Photo(form, this.controller ? this.controller.signal : null)
|
|
|
|
|
+ .then((res) => {})
|
|
|
|
|
+ .catch((error) => {});
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
console.log('err:' + err);
|
|
console.log('err:' + err);
|