Commit f098803b by zhouzy

1

1 parent 4f3dd5db
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</div> </div>
<div> <div>
<el-form-item label="图标" required prop="equityIcon"> <el-form-item label="图标" required prop="equityIcon">
<el-upload action="#" class="avatar-uploader" :show-file-list="false" :before-upload="upLoadImg"> <el-upload action="#" class="avatar-uploader" :show-file-list="false" :before-upload="upLoadImg" id="dialogIcon">
<img v-if="form.equityIcon" :src="form.equityIcon" class="avatar" /> <img v-if="form.equityIcon" :src="form.equityIcon" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
...@@ -159,12 +159,14 @@ export default { ...@@ -159,12 +159,14 @@ export default {
let fileName = file.name let fileName = file.name
if (file.name.lastIndexOf('.') === -1) { if (file.name.lastIndexOf('.') === -1) {
this.$message.info('路径不正确') this.$message.info('路径不正确')
document.getElementById('dialogIcon').value = ''
return false return false
} }
let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf' let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase() let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName + '|') === -1) { if (AllImgExt.indexOf(extName + '|') === -1) {
this.$message.info('图片格式不正确') this.$message.info('图片格式不正确')
document.getElementById('dialogIcon').value = ''
return false return false
} }
// if (fileSize < 3145728) { // if (fileSize < 3145728) {
...@@ -173,7 +175,7 @@ export default { ...@@ -173,7 +175,7 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = img => { reader.onload = img => {
console.log(file) console.log(file)
let type = fileName.split('.')[1] let type = fileName.split('.')[fileName.split('.').length - 1]
let imgUrl = img.target.result.split(',')[1] let imgUrl = img.target.result.split(',')[1]
this.$apis.commonApi this.$apis.commonApi
.upLoadImg({ .upLoadImg({
...@@ -186,6 +188,7 @@ export default { ...@@ -186,6 +188,7 @@ export default {
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
document.getElementById('dialogIcon').value = ''
}) })
} }
} }
...@@ -307,13 +310,6 @@ export default { ...@@ -307,13 +310,6 @@ export default {
color: #333333; color: #333333;
line-height: 28px; line-height: 28px;
} }
.equityDialog .el-dialog__footer {
padding: 10px 20px 20px;
text-align: center;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #e6e6e6;
}
.buttonBtn .el-button + .el-button { .buttonBtn .el-button + .el-button {
margin-left: 40px; margin-left: 40px;
} }
...@@ -329,6 +325,5 @@ export default { ...@@ -329,6 +325,5 @@ export default {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid #e6e6e6; border-top: 1px solid #e6e6e6;
text-align: center;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</el-form-item> </el-form-item>
<el-form-item label="商品图片" :required="ruleForm.appearance == 1" prop="goodsImage"> <el-form-item label="商品图片" :required="ruleForm.appearance == 1" prop="goodsImage">
<el-upload action="" class="avatar-uploader" :show-file-list="false" :before-upload="upLoadImg"> <el-upload action="" class="avatar-uploader" :show-file-list="false" :before-upload="upLoadImg" id="goodsIconId">
<template v-if="ruleForm.goodsImage"> <template v-if="ruleForm.goodsImage">
<img :src="ruleForm.goodsImage" class="avatar" /> <img :src="ruleForm.goodsImage" class="avatar" />
<i class="el-icon-delete-solid uploader-del-icon" @click.stop="delImg"></i> <i class="el-icon-delete-solid uploader-del-icon" @click.stop="delImg"></i>
...@@ -303,12 +303,14 @@ export default { ...@@ -303,12 +303,14 @@ export default {
let fileName = file.name let fileName = file.name
if (file.name.lastIndexOf('.') === -1) { if (file.name.lastIndexOf('.') === -1) {
this.$message.info('路径不正确') this.$message.info('路径不正确')
document.getElementById('goodsIconId').value = ''
return false return false
} }
let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf' let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase() let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName + '|') === -1) { if (AllImgExt.indexOf(extName + '|') === -1) {
this.$message.info('图片格式不正确') this.$message.info('图片格式不正确')
document.getElementById('goodsIconId').value = ''
return false return false
} }
// if (fileSize < 3145728) { // if (fileSize < 3145728) {
...@@ -317,7 +319,7 @@ export default { ...@@ -317,7 +319,7 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = img => { reader.onload = img => {
console.log(file) console.log(file)
let type = fileName.split('.')[1] let type = fileName.split('.')[fileName.split('.').length - 1]
let imgUrl = img.target.result.split(',')[1] let imgUrl = img.target.result.split(',')[1]
this.$apis.commonApi this.$apis.commonApi
.upLoadImg({ .upLoadImg({
...@@ -329,6 +331,7 @@ export default { ...@@ -329,6 +331,7 @@ export default {
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
document.getElementById('goodsIconId').value = ''
}) })
} }
} }
......
<template> <template>
<div class="equity-wrap"> <div class="equity-wrap">
<div class="tableTitleFirst">汽车权益</div> <div class="tableTitle">汽车权益</div>
<div class="equity-wrap contain"> <div class="equity-wrap contain">
<el-button type="primary" size="small" @click="addEquity(1)"> <el-button type="primary" size="small" @click="addEquity(1)">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
...@@ -270,9 +270,6 @@ export default { ...@@ -270,9 +270,6 @@ export default {
.tableTitle { .tableTitle {
margin: 20px 40px; margin: 20px 40px;
} }
.tableTitleFirst{
margin: 0px 40px 20px 40px;
}
.el-table__fixed-right-patch { .el-table__fixed-right-patch {
position: absolute; position: absolute;
top: -1px; top: -1px;
......
...@@ -75,9 +75,9 @@ ...@@ -75,9 +75,9 @@
<el-radio-group v-model="ruleForm.effectiveType"> <el-radio-group v-model="ruleForm.effectiveType">
<el-radio label="1" @change="e => controlSwitch(e, 'disable')">永久有效</el-radio> <el-radio label="1" @change="e => controlSwitch(e, 'disable')">永久有效</el-radio>
<el-radio label="2" @change="e => controlSwitch(e, 'input')"> <el-radio label="2" @change="e => controlSwitch(e, 'input')">
领取时起 <span style="margin-right:10px">领取时起</span>
<el-input-number v-model="effectiveNum" controls-position="right" :min="1" :max="999" id="month" :disabled="ruleForm.effectiveType !== '2'" size="mini" change=""></el-input-number> <el-input-number v-model="effectiveNum" controls-position="right" :min="1" :max="999" id="month" :disabled="ruleForm.effectiveType !== '2'" size="mini" change=""></el-input-number>
天内有效 <span style="margin-left:10px">天内有效</span>
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
...@@ -606,22 +606,6 @@ export default { ...@@ -606,22 +606,6 @@ export default {
margin-top: 20px; margin-top: 20px;
margin-right: 20px; margin-right: 20px;
} }
/* 弹窗界面样式 */
.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 {
width: 40px;
height: 30px;
display: block;
}
.baseinformation { .baseinformation {
width: 100%; width: 100%;
height: 28px; height: 28px;
...@@ -662,7 +646,7 @@ export default { ...@@ -662,7 +646,7 @@ export default {
.imgCtn { .imgCtn {
width: 300px; width: 300px;
text-align: center; text-align: center;
padding: 3px; padding: 1px;
height: 100px; height: 100px;
margin-right: 20px; margin-right: 20px;
} }
...@@ -761,7 +745,12 @@ export default { ...@@ -761,7 +745,12 @@ export default {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid #e6e6e6; border-top: 1px solid #e6e6e6;
text-align: center; }
.addCardsDialog .el-radio {
color: #606266;
font-weight: 500;
cursor: pointer;
margin-right: 20px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!