Commit bd78e43b by 李长胜
2 parents cb4cf966 f098803b
...@@ -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>
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
closeListPoup(done) { closeListPoup(done) {
this.$emit('update:show', false) this.$emit('update:show', false)
this.$emit('update:isEdit', false) this.$emit('update:isEdit', false)
this.form ={} this.form = {}
done() done()
}, },
close() { close() {
...@@ -152,17 +152,21 @@ export default { ...@@ -152,17 +152,21 @@ export default {
this.$emit('update:show', false) this.$emit('update:show', false)
this.$emit('update:isEdit', false) this.$emit('update:isEdit', false)
this.$refs.ruleForm.resetFields() this.$refs.ruleForm.resetFields()
this.form = {}
// console.log("???????????");
}, },
upLoadImg(file) { upLoadImg(file) {
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) {
...@@ -171,7 +175,7 @@ export default { ...@@ -171,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({
...@@ -184,6 +188,7 @@ export default { ...@@ -184,6 +188,7 @@ export default {
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
document.getElementById('dialogIcon').value = ''
}) })
} }
} }
...@@ -305,13 +310,6 @@ export default { ...@@ -305,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;
} }
...@@ -327,6 +325,5 @@ export default { ...@@ -327,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
...@@ -7,8 +7,8 @@ export default { ...@@ -7,8 +7,8 @@ export default {
carTableParams: { carTableParams: {
listName: 'data.list', listName: 'data.list',
tableOption: true, tableOption: true,
rowClassName: ({ row, rowIndex }) => { rowStyle: ({ row, rowIndex }) => {
return row.status == 0 ? 'opacity' : '' return row.status == 0 ? {opacity:0.5} : ''
}, },
tableColumns: [{ tableColumns: [{
label: '权益名称', label: '权益名称',
...@@ -62,6 +62,8 @@ export default { ...@@ -62,6 +62,8 @@ export default {
getCarList() { getCarList() {
this.$apis.carEquityManageApi.getCarList({pageSize: this.$refs.carTable.page.pageSize, pageNum: this.$refs.carTable.page.pageNum}).then(({ data }) => { this.$apis.carEquityManageApi.getCarList({pageSize: this.$refs.carTable.page.pageSize, pageNum: this.$refs.carTable.page.pageNum}).then(({ data }) => {
this.carTableData = data.list || [] this.carTableData = data.list || []
this.$refs.carTable.refreshTable()
}) })
}, },
......
...@@ -9,8 +9,8 @@ export default { ...@@ -9,8 +9,8 @@ export default {
tags: [], tags: [],
goodsTableData: [], goodsTableData: [],
goodsTableParams: { goodsTableParams: {
rowClassName: ({ row, rowIndex }) => { rowStyle: ({ row, rowIndex }) => {
return row.status == 0 ? 'opacity' : '' return row.status == 0 ? {opacity:0.5} : ''
}, },
tableOption: true, tableOption: true,
tableColumns: [{ tableColumns: [{
......
...@@ -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 = ''
}) })
} }
} }
......
...@@ -255,9 +255,6 @@ export default { ...@@ -255,9 +255,6 @@ export default {
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
.opacity {
opacity: 0.5;
}
.tableBtn { .tableBtn {
width: 40px; width: 40px;
} }
......
...@@ -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,30 +606,6 @@ export default { ...@@ -606,30 +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-uploader-icon {
font-size: 14px;
color: #8c939d;
width: 40px;
height: 30px;
line-height: 30px;
text-align: center;
}
.avatar {
width: 40px;
height: 30px;
display: block;
}
.baseinformation { .baseinformation {
width: 100%; width: 100%;
height: 28px; height: 28px;
...@@ -670,7 +646,7 @@ export default { ...@@ -670,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;
} }
...@@ -769,7 +745,12 @@ export default { ...@@ -769,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!