|
@@ -33,8 +33,10 @@
|
|
|
:on-success="handleAvatarSuccess"
|
|
|
:before-upload="beforeUpload"
|
|
|
>
|
|
|
- <img v-if="form.businessLicenseImage" :src="form.businessLicenseImage" class="avatar">
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
|
+ <div v-loading="businessImgLoading" class="avatar">
|
|
|
+ <img v-if="form.businessLicenseImage" :src="form.businessLicenseImage" @error="reloadAvatarImage" @load="loadAvatarSucess">
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
|
+ </div>
|
|
|
<div slot="tip" class="el-upload__tip_club">注意:请上传jpg/png格式的图片,最大不超过5M</div>
|
|
|
</el-upload>
|
|
|
</div>
|
|
@@ -49,8 +51,10 @@
|
|
|
:on-success="handleDoorwaySuccess"
|
|
|
:before-upload="beforeUpload"
|
|
|
>
|
|
|
- <img v-if="form.headpic" :src="form.headpic" class="avatar">
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
|
+ <div v-loading="headImgLoading" class="avatar">
|
|
|
+ <img v-if="form.headpic" :src="form.headpic" @error="reloadDoorwayImage" @load="loadDoorwaySucess">
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
|
+ </div>
|
|
|
<div slot="tip" class="el-upload__tip_club">注意:请上传jpg/png格式的图片,最大不超过5M</div>
|
|
|
</el-upload>
|
|
|
</div>
|
|
@@ -76,12 +80,13 @@ export default {
|
|
|
components: { City },
|
|
|
data() {
|
|
|
return {
|
|
|
- action: `${this.baseUrl}/formData/MultiPictareaddData`,
|
|
|
userID: this.$route.query.userID,
|
|
|
clubID: this.$route.query.clubID,
|
|
|
dialogImageUrl: '',
|
|
|
dialogVisible: false,
|
|
|
isRequest: false,
|
|
|
+ businessImgLoading: false,
|
|
|
+ headImgLoading: false,
|
|
|
form: {
|
|
|
name: '',
|
|
|
linkMan: '',
|
|
@@ -195,14 +200,33 @@ export default {
|
|
|
},
|
|
|
// 上传图标事件
|
|
|
handleAvatarSuccess(response, file) {
|
|
|
- setTimeout(() => {
|
|
|
+ this.$nextTick(() => {
|
|
|
this.form.businessLicenseImage = response.data
|
|
|
- }, 1000)
|
|
|
+ })
|
|
|
},
|
|
|
- handleDoorwaySuccess(response, file) {
|
|
|
+ reloadAvatarImage() {
|
|
|
+ this.businessImgLoading = true
|
|
|
setTimeout(() => {
|
|
|
+ this.form.businessLicenseImage = this.form.businessLicenseImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
|
|
|
+ }, 1000 * 2)
|
|
|
+ },
|
|
|
+ loadAvatarSucess() {
|
|
|
+ this.businessImgLoading = false
|
|
|
+ },
|
|
|
+ // 上传图标事件
|
|
|
+ handleDoorwaySuccess(response, file) {
|
|
|
+ this.$nextTick(() => {
|
|
|
this.form.headpic = response.data
|
|
|
- }, 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ reloadDoorwayImage() {
|
|
|
+ this.headImgLoading = true
|
|
|
+ setTimeout(() => {
|
|
|
+ this.form.headpic = this.form.headpic.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
|
|
|
+ }, 1000 * 2)
|
|
|
+ },
|
|
|
+ loadDoorwaySucess() {
|
|
|
+ this.headImgLoading = false
|
|
|
},
|
|
|
// 对上传图片的大小、格式进行限制
|
|
|
beforeUpload(file) {
|
|
@@ -246,6 +270,11 @@ export default {
|
|
|
height: 148px;
|
|
|
display: block;
|
|
|
}
|
|
|
+.avatar img {
|
|
|
+ width: 148px;
|
|
|
+ height: 148px;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
.el-form-item__label{
|
|
|
text-align: right !important;
|
|
|
}
|