|
@@ -7,12 +7,12 @@
|
|
<view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
|
|
<view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
|
|
<view
|
|
<view
|
|
v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.picUrl.substring(item.picUrl.length-4)=='jpeg' ">
|
|
v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.picUrl.substring(item.picUrl.length-4)=='jpeg' ">
|
|
- <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
|
|
|
|
|
|
+ <image :src="loadImgSrcLocalhost(item)" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
|
|
@click="showPhoto(index)">
|
|
@click="showPhoto(index)">
|
|
</image>
|
|
</image>
|
|
</view>
|
|
</view>
|
|
<view v-else>
|
|
<view v-else>
|
|
- <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
|
|
|
|
|
|
+ <video :src="loadImgSrcLocalhost(item)" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
|
|
</view>
|
|
</view>
|
|
<view @click="remove(index)"
|
|
<view @click="remove(index)"
|
|
style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
|
|
style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
|
|
@@ -77,10 +77,10 @@
|
|
_this.$modal.msg(data.msg)
|
|
_this.$modal.msg(data.msg)
|
|
} else {
|
|
} else {
|
|
if (_this.progress === 100) {
|
|
if (_this.progress === 100) {
|
|
- _this.imgArr.push(data.data.url)
|
|
|
|
|
|
+ _this.imgArr.push(data.fileName)
|
|
_this.$modal.msg('上传成功!')
|
|
_this.$modal.msg('上传成功!')
|
|
_this.photo = false;
|
|
_this.photo = false;
|
|
- this.$emit('updateImg',_this.imgArr);
|
|
|
|
|
|
+ _this.$emit('updateImg',_this.imgArr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -91,7 +91,7 @@
|
|
complete: res => {
|
|
complete: res => {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
_this.uploading = false;
|
|
_this.uploading = false;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
task.onProgressUpdate(res => {
|
|
task.onProgressUpdate(res => {
|
|
@@ -105,13 +105,13 @@
|
|
_this.loading = true
|
|
_this.loading = true
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
choosevideo() {
|
|
choosevideo() {
|
|
let _this = this;
|
|
let _this = this;
|
|
console.log('视频')
|
|
console.log('视频')
|
|
@@ -133,10 +133,10 @@
|
|
} else {
|
|
} else {
|
|
//上传成功
|
|
//上传成功
|
|
if (_this.progress === 100) {
|
|
if (_this.progress === 100) {
|
|
- _this.imgArr.push(data.data.url)
|
|
|
|
|
|
+ _this.imgArr.push(data.fileName)
|
|
_this.$modal.msg('上传成功!')
|
|
_this.$modal.msg('上传成功!')
|
|
_this.photo = false;
|
|
_this.photo = false;
|
|
- this.$emit('updateImg',_this.imgArr);
|
|
|
|
|
|
+ _this.$emit('updateImg',_this.imgArr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -160,7 +160,7 @@
|
|
_this.loading = true
|
|
_this.loading = true
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -186,8 +186,8 @@
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
-</style>
|
|
|
|
|
|
+</style>
|