|
|
@@ -9,16 +9,12 @@
|
|
|
<script>
|
|
|
import { ImagePreview } from 'vant';
|
|
|
import axios from 'axios';
|
|
|
-import { uploadImagev } from '@/api/index';
|
|
|
+import { addPhotoK } from '@/api/index';
|
|
|
import { getPosition, getTicketFun } from '@/utils/TXApiFun';
|
|
|
|
|
|
export default {
|
|
|
name: 'uploadImg',
|
|
|
props: {
|
|
|
- imgArr: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
itemData: {
|
|
|
type: Object,
|
|
|
default: {},
|
|
|
@@ -28,6 +24,14 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: true,
|
|
|
},
|
|
|
+ customerClueId: {
|
|
|
+ type: String | Number,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
+ customerClueItemId: {
|
|
|
+ type: String | Number,
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {};
|
|
|
@@ -64,29 +68,27 @@ export default {
|
|
|
localId: localIds, // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
|
isShowProgressTips: 1, // 默认为1,显示进度提示
|
|
|
success: (res) => {
|
|
|
- this.uploadImagev(res.serverId);
|
|
|
+ this.addPhotoK(res.serverId);
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- uploadImagev(meidaId) {
|
|
|
+ addPhotoK(meidaId) {
|
|
|
var form = {
|
|
|
mediaId: meidaId,
|
|
|
+ customerClueId: this.customerClueId,
|
|
|
+ customerClueItemId: this.customerClueItemId,
|
|
|
};
|
|
|
this.toastLoading(0, '加载中...', true);
|
|
|
- uploadImagev(form).then((res) => {
|
|
|
+ addPhotoK(form).then((res) => {
|
|
|
this.toastLoading().clear();
|
|
|
if (res.code == 200) {
|
|
|
- let imgArr = [];
|
|
|
- res.data.forEach((item) => {
|
|
|
- imgArr.push(item.url);
|
|
|
- });
|
|
|
this.$toast('上传成功!');
|
|
|
this.$emit('newimgarr', {
|
|
|
- fileUrl: imgArr.join(','),
|
|
|
- itemData: itemData,
|
|
|
+ fileUrl: res.data.url,
|
|
|
+ itemData: this.itemData,
|
|
|
});
|
|
|
} else {
|
|
|
this.$toast('上传失败!');
|
|
|
@@ -99,17 +101,16 @@ export default {
|
|
|
|
|
|
<style scoped>
|
|
|
.cameraDiv1 {
|
|
|
- position: relative;
|
|
|
- height: 20px;
|
|
|
+ height: 100%;
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
.cameraDiv1 img {
|
|
|
- position: absolute;
|
|
|
+ /* position: absolute;
|
|
|
width: 100%;
|
|
|
display: block;
|
|
|
height: 20px;
|
|
|
- top: 0;
|
|
|
+ top: 0; */
|
|
|
}
|
|
|
|
|
|
.imgPre {
|
|
|
@@ -138,12 +139,11 @@ export default {
|
|
|
}
|
|
|
|
|
|
.coverImg {
|
|
|
- text-align: right;
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- height: 20px;
|
|
|
+ height: 100%;
|
|
|
width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
margin: 0;
|
|
|
}
|
|
|
|