Commit af3d0138 by 前端

添加兑换码限制

1 parent 694adfc1
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
item.attContent = JSON.parse(item.attContent) item.attContent = JSON.parse(item.attContent)
} }
}) })
preview.length>0&&this.$refs.welcome.updateList(preview) preview.length > 0 && this.$refs.welcome.updateList(preview)
}) })
this.dialogVisible = true this.dialogVisible = true
} }
...@@ -374,9 +374,17 @@ export default { ...@@ -374,9 +374,17 @@ export default {
return return
} }
const previewList = this.autoSend && this.$refs.welcome.previewList ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : [] const previewList = this.autoSend && this.$refs.welcome.previewList ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : []
const attachmentList = previewList.map(item => { const attachmentList = previewList.map(item => {
if (item.attType == 1) { if (item.attType == 1) {
item.attContent = item.attContent.replace(/(@昵称|#兑换码)/g, '[$1]') item.attContent = item.attContent.replace(/(@昵称|#兑换码)/g, '[$1]')
if (item.attContent.match(/#兑换码/g).length > 10) {
this.$message({
message: '兑换码已达上限',
type: 'error'
})
return
}
} else if (item.attType == 7) { } else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent) item.attContent = JSON.stringify(item.attContent)
} }
...@@ -416,7 +424,6 @@ export default { ...@@ -416,7 +424,6 @@ export default {
if(!util.isShowBtn(null,'兑换码')) { if(!util.isShowBtn(null,'兑换码')) {
this.btnList.splice(-1) this.btnList.splice(-1)
} }
} }
} }
</script> </script>
...@@ -598,7 +605,7 @@ export default { ...@@ -598,7 +605,7 @@ export default {
.import-link { .import-link {
display: flex; display: flex;
cursor: pointer; cursor: pointer;
margin-bottom:8px; margin-bottom: 8px;
.upload-btn { .upload-btn {
position: relative; position: relative;
display: inline-block; display: inline-block;
...@@ -635,14 +642,14 @@ export default { ...@@ -635,14 +642,14 @@ export default {
} }
.gl-form-min /deep/.el-form .welcome-box { .gl-form-min /deep/.el-form .welcome-box {
width: 100% !important; width: 100% !important;
.add-btn:nth-last-child(1){ .add-btn:nth-last-child(1) {
padding-right:0px; padding-right: 0px;
} }
.text-num{ .text-num {
color: #999999; color: #999999;
} }
} }
.gl-form-page .el-form { .gl-form-page .el-form {
padding-left: 0px !important;; padding-left: 0px !important;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!