|
|
@@ -21,6 +21,14 @@
|
|
|
@click="viewImg(item)"
|
|
|
:style="{ width: size + 'rpx', height: size + 'rpx' }"
|
|
|
:mode="imgMode"
|
|
|
+ v-if="!prefixShow"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ :src="`${constant.imgUrl}/${item}`"
|
|
|
+ @click="viewImg(item)"
|
|
|
+ :style="{ width: size + 'rpx', height: size + 'rpx' }"
|
|
|
+ :mode="imgMode"
|
|
|
+ v-if="prefixShow"
|
|
|
/>
|
|
|
</li>
|
|
|
<li
|
|
|
@@ -114,10 +122,16 @@ export default {
|
|
|
isStorage: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ // 是否需要拼接路径 true 需要 false 不需要
|
|
|
+ prefixShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ constant: this.$constant,
|
|
|
resultData: {},
|
|
|
showImgList: [],
|
|
|
base64ImgList: [],
|
|
|
@@ -187,8 +201,13 @@ export default {
|
|
|
picAdd({
|
|
|
...params
|
|
|
}).then(res => {
|
|
|
+ let imgArr
|
|
|
if (res.code === 1) {
|
|
|
- let imgArr = [res.data.url];
|
|
|
+ if(this.prefixShow) {
|
|
|
+ imgArr = [res.data.shortUrl]
|
|
|
+ } else {
|
|
|
+ imgArr = [res.data.url];
|
|
|
+ }
|
|
|
that.showImgList = [...that.showImgList, ...imgArr];
|
|
|
that.resultData = res.data;
|
|
|
this.$emit("currentUpload", imgArr);
|
|
|
@@ -202,9 +221,17 @@ export default {
|
|
|
uploadPic({
|
|
|
...params
|
|
|
}).then(res => {
|
|
|
+ let imgArr
|
|
|
+ console.log(this.prefixShow)
|
|
|
if (res.code === 1) {
|
|
|
- let imgArr = [res.data.url];
|
|
|
+ if(this.prefixShow) {
|
|
|
+ console.log(11111, res.data.shortUrl)
|
|
|
+ imgArr = [res.data.shortUrl]
|
|
|
+ } else {
|
|
|
+ imgArr = [res.data.url];
|
|
|
+ }
|
|
|
that.showImgList = [...that.showImgList, ...imgArr];
|
|
|
+ console.log(222, that.showImgList)
|
|
|
that.resultData = res.data;
|
|
|
this.$emit("currentUpload", imgArr);
|
|
|
this.$emit("getResult", that.showImgList);
|