Commit bd78e43b by 李长胜
2 parents cb4cf966 f098803b
......@@ -37,7 +37,7 @@
</div>
<div>
<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" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
......@@ -144,7 +144,7 @@ export default {
closeListPoup(done) {
this.$emit('update:show', false)
this.$emit('update:isEdit', false)
this.form ={}
this.form = {}
done()
},
close() {
......@@ -152,17 +152,21 @@ export default {
this.$emit('update:show', false)
this.$emit('update:isEdit', false)
this.$refs.ruleForm.resetFields()
this.form = {}
// console.log("???????????");
},
upLoadImg(file) {
let fileName = file.name
if (file.name.lastIndexOf('.') === -1) {
this.$message.info('路径不正确')
document.getElementById('dialogIcon').value = ''
return false
}
let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName + '|') === -1) {
this.$message.info('图片格式不正确')
document.getElementById('dialogIcon').value = ''
return false
}
// if (fileSize < 3145728) {
......@@ -171,7 +175,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = img => {
console.log(file)
let type = fileName.split('.')[1]
let type = fileName.split('.')[fileName.split('.').length - 1]
let imgUrl = img.target.result.split(',')[1]
this.$apis.commonApi
.upLoadImg({
......@@ -184,6 +188,7 @@ export default {
} else {
this.$message.error(message)
}
document.getElementById('dialogIcon').value = ''
})
}
}
......@@ -305,13 +310,6 @@ export default {
color: #333333;
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 {
margin-left: 40px;
}
......@@ -327,6 +325,5 @@ export default {
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #e6e6e6;
text-align: center;
}
</style>
\ No newline at end of file
......@@ -7,8 +7,8 @@ export default {
carTableParams: {
listName: 'data.list',
tableOption: true,
rowClassName: ({ row, rowIndex }) => {
return row.status == 0 ? 'opacity' : ''
rowStyle: ({ row, rowIndex }) => {
return row.status == 0 ? {opacity:0.5} : ''
},
tableColumns: [{
label: '权益名称',
......@@ -62,6 +62,8 @@ export default {
getCarList() {
this.$apis.carEquityManageApi.getCarList({pageSize: this.$refs.carTable.page.pageSize, pageNum: this.$refs.carTable.page.pageNum}).then(({ data }) => {
this.carTableData = data.list || []
this.$refs.carTable.refreshTable()
})
},
......
......@@ -9,8 +9,8 @@ export default {
tags: [],
goodsTableData: [],
goodsTableParams: {
rowClassName: ({ row, rowIndex }) => {
return row.status == 0 ? 'opacity' : ''
rowStyle: ({ row, rowIndex }) => {
return row.status == 0 ? {opacity:0.5} : ''
},
tableOption: true,
tableColumns: [{
......
......@@ -36,7 +36,7 @@
</el-form-item>
<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">
<img :src="ruleForm.goodsImage" class="avatar" />
<i class="el-icon-delete-solid uploader-del-icon" @click.stop="delImg"></i>
......@@ -303,12 +303,14 @@ export default {
let fileName = file.name
if (file.name.lastIndexOf('.') === -1) {
this.$message.info('路径不正确')
document.getElementById('goodsIconId').value = ''
return false
}
let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName + '|') === -1) {
this.$message.info('图片格式不正确')
document.getElementById('goodsIconId').value = ''
return false
}
// if (fileSize < 3145728) {
......@@ -317,7 +319,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = img => {
console.log(file)
let type = fileName.split('.')[1]
let type = fileName.split('.')[fileName.split('.').length - 1]
let imgUrl = img.target.result.split(',')[1]
this.$apis.commonApi
.upLoadImg({
......@@ -329,6 +331,7 @@ export default {
} else {
this.$message.error(message)
}
document.getElementById('goodsIconId').value = ''
})
}
}
......
......@@ -255,9 +255,6 @@ export default {
width: 40px;
height: 40px;
}
.opacity {
opacity: 0.5;
}
.tableBtn {
width: 40px;
}
......
......@@ -75,9 +75,9 @@
<el-radio-group v-model="ruleForm.effectiveType">
<el-radio label="1" @change="e => controlSwitch(e, 'disable')">永久有效</el-radio>
<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>
天内有效
<span style="margin-left:10px">天内有效</span>
</el-radio>
</el-radio-group>
</el-form-item>
......@@ -606,30 +606,6 @@ export default {
margin-top: 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 {
width: 100%;
height: 28px;
......@@ -670,7 +646,7 @@ export default {
.imgCtn {
width: 300px;
text-align: center;
padding: 3px;
padding: 1px;
height: 100px;
margin-right: 20px;
}
......@@ -769,7 +745,12 @@ export default {
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #e6e6e6;
text-align: center;
}
.addCardsDialog .el-radio {
color: #606266;
font-weight: 500;
cursor: pointer;
margin-right: 20px;
}
</style>
\ 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!