master
parent
228a298c6f
commit
abb95b0fc9
@ -0,0 +1,12 @@
|
||||
import {
|
||||
service
|
||||
} from "../../utils/service";
|
||||
|
||||
// 主页查询
|
||||
export function doAdd(data) {
|
||||
return service({
|
||||
url: "/platformCoupon/add",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<el-upload class="avatar-uploader" :limit="10" ref="upload" action="#" :show-file-list="false" :auto-upload="false" :on-change="handleChange">
|
||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imageUrl: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleChange(file, fileList) {
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
this.$emit('active-img', file.raw);
|
||||
// console.log('file', file);
|
||||
console.log('fileList', fileList);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
line-height: 150px;
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue