Commit f6d1a6db authored by 罗超's avatar 罗超

1

parent 1da1bec1
......@@ -158,9 +158,9 @@
class="is-required"
prop="BigIco"
>
<el-button @click="openImageChoose(1)" size="small"
<!-- <el-button @click="openImageChoose(1)" size="small"
>选择大奖章</el-button
>
> -->
<div
class="app-gallery-item"
style="
......@@ -170,18 +170,30 @@
border: none;
"
>
<img
<!-- <img
v-if="!addMsg.BigIco || addMsg.BigIco == ''"
src="../../assets/img/default.png"
style="width: 80px; height: 80px"
alt=""
/>
<img
/> -->
<!-- <img
v-else
style="width: 80px; height: 80px"
:src="addMsg.BigIco"
alt=""
/>
/> -->
<el-upload
class="avatar-uploader"
action
:show-file-list="false"
:http-request="UploadBig"
>
<i
v-if="!addMsg.BigIco || addMsg.BigIco == ''"
class="el-icon-plus avatar-uploader-icon"
></i>
<img v-else :src="addMsg.BigIco" class="avatar" />
</el-upload>
</div>
</el-form-item>
<el-form-item
......@@ -190,9 +202,9 @@
class="is-required"
prop="SmallIco"
>
<el-button @click="openImageChoose(2)" size="small"
<!-- <el-button @click="openImageChoose(2)" size="small"
>选择小奖章</el-button
>
> -->
<div
class="app-gallery-item"
style="
......@@ -202,7 +214,7 @@
border: none;
"
>
<img
<!-- <img
v-if="!addMsg.SmallIco || addMsg.SmallIco == ''"
src="../../assets/img/default.png"
style="width: 80px; height: 80px"
......@@ -213,7 +225,19 @@
style="width: 80px; height: 80px"
:src="addMsg.SmallIco"
alt=""
/>
/> -->
<el-upload
class="avatar-uploader"
action
:show-file-list="false"
:http-request="UploadSmall"
>
<i
v-if="!addMsg.SmallIco || addMsg.SmallIco == ''"
class="el-icon-plus avatar-uploader-icon"
></i>
<img v-else :src="addMsg.SmallIco" class="avatar" />
</el-upload>
</div>
</el-form-item>
<el-form-item
......@@ -222,7 +246,7 @@
class="is-required"
prop="YearInfo"
>
<el-select
<!-- <el-select
v-model="addMsg.YearInfo"
filterable
placeholder="请选择"
......@@ -234,7 +258,13 @@
:value="item.name"
>
</el-option>
</el-select>
</el-select> -->
<el-input
v-model="addMsg.YearInfo"
placeholder="年份"
type="number"
style="width: 400px"
></el-input>
</el-form-item>
</el-form>
</div>
......@@ -476,6 +506,27 @@ export default {
});
}
},
//选择图片
UploadBig(file) {
this.UploadFileToTencent(this.FileType().UserImg, file.file, (res) => {
if (res.resultCode == 1) {
this.addMsg.BigIco = res.FileUrl;
}
});
},
UploadSmall(file) {
console.log(494, file.file);
const isLt1M = file.file.size / 1024 / 1024 < 1;
if (!isLt1M) {
this.$message.error("上传头像图片大小不能超过 1MB!");
return;
}
this.UploadFileToTencent(this.FileType().UserImg, file.file, (res) => {
if (res.resultCode == 1) {
this.addMsg.SmallIco = res.FileUrl;
}
});
},
},
mounted() {},
};
......@@ -533,4 +584,27 @@ export default {
.brandClassification .el-form-item__content {
line-height: 0;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
}
.avatar {
width: 80px;
height: 80px;
display: block;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment