|
@@ -151,16 +151,126 @@
|
|
|
.select2-choice{
|
|
|
width: 200px
|
|
|
}
|
|
|
+
|
|
|
+ .red {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ .upload {
|
|
|
+ position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ background: #D0EEFF;
|
|
|
+ border: 1px solid #99D3F5;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 4px 12px;
|
|
|
+ color: #1E88C7;
|
|
|
+ text-decoration: none;
|
|
|
+ text-indent: 0;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-left: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 52px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upload input {
|
|
|
+ position: absolute;
|
|
|
+ width: 170px;
|
|
|
+ font-size: 20px;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ opacity: 0;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upload:hover {
|
|
|
+ background: #AADFFD;
|
|
|
+ border-color: #78C3F3;
|
|
|
+ color: #004974;
|
|
|
+ text-decoration: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .add-submit {
|
|
|
+ position: relative;
|
|
|
+ display: inline;
|
|
|
+ background: #D0EEFF;
|
|
|
+ border: 1px solid #99D3F5;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 4px 12px;
|
|
|
+ color: #1E88C7;
|
|
|
+ text-decoration: none;
|
|
|
+ text-indent: 0;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-left: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 52px;
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .add-submit input {
|
|
|
+ position: absolute;
|
|
|
+ width: 50px;
|
|
|
+ font-size: 20px;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ opacity: 0;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .add-submit:hover {
|
|
|
+ background: #AADFFD;
|
|
|
+ border-color: #78C3F3;
|
|
|
+ color: #004974;
|
|
|
+ text-decoration: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .upload-loading{
|
|
|
+ display: none;
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ .upload-loading img{
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ margin: 0 auto 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ #file-list-display {
|
|
|
+ width: 600px;
|
|
|
+ height: auto;
|
|
|
+ float: left;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ #file-list-display p {
|
|
|
+ line-height: 30px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333333;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ #file-list-display p .del {
|
|
|
+ color: #2fa4e7;
|
|
|
+ font-size: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .Main-content{
|
|
|
+ height: 100px;
|
|
|
+ }
|
|
|
</style>
|
|
|
<script type="text/javascript">
|
|
|
$(document).ready(function() {
|
|
|
//$("#name").focus();
|
|
|
$("#inputForm").validate({
|
|
|
submitHandler: function(form){
|
|
|
- var status = $("#status").val();
|
|
|
+ var status = $("input[name='status']:checked").val();
|
|
|
var commodityType = $("#commodityType").val();
|
|
|
// 计算空数据条数
|
|
|
-
|
|
|
var propertyArr = [];
|
|
|
var name = $("#name").val();
|
|
|
var alias = $("#alias").val();
|
|
@@ -226,12 +336,87 @@
|
|
|
}
|
|
|
}
|
|
|
$("#emptyNum").val(emptyNum);
|
|
|
+
|
|
|
+ // 检测敏感词
|
|
|
+ var propertyMap = new Map();
|
|
|
+ propertyMap.set("name", name);
|
|
|
+ propertyMap.set("alias", alias);
|
|
|
+ propertyMap.set("discription", discription);
|
|
|
+ propertyMap.set("productLink", productLink);
|
|
|
+ for (var i = 0; i <= 20; i++) {
|
|
|
+ var paramName = "\"paramList[" + i + "].name\"";
|
|
|
+ var contentName = "\"paramList[" + i + "].content\"";
|
|
|
+ var param = $('input[name=' + paramName + ']').val();
|
|
|
+ var content = $('input[name=' + contentName + ']').val();
|
|
|
+ if ( param === undefined || param === '') {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ propertyMap.set("param" + i, param);
|
|
|
+ propertyMap.set("content" + i, content);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ propertyMap.set("advantage", advantage);
|
|
|
+ propertyMap.set("disadvantage", disadvantage);
|
|
|
+ propertyMap.set("principle", principle);
|
|
|
+ propertyMap.set("seoKeyword", seoKeyword);
|
|
|
+ propertyMap.set("brand", brand);
|
|
|
+ propertyMap.set("producePlace", producePlace);
|
|
|
+ propertyMap.set("company", company);
|
|
|
+ propertyMap.set("adaptiveMan", adaptiveMan);
|
|
|
+ propertyMap.set("unAdaptiveMan", unAdaptiveMan);
|
|
|
+ propertyMap.set("aroundOperation", aroundOperation);
|
|
|
+ if (2 == commodityType) {
|
|
|
+ propertyMap.set("authLink", authLink);
|
|
|
+ }
|
|
|
+ for (var i = 0; i <= 20; i++) {
|
|
|
+ var questionName = "\"questionList[" + i + "].question\"";
|
|
|
+ var answerName = "\"questionList[" + i + "].answer\"";
|
|
|
+ var question = $('input[name=' + questionName + ']').val();
|
|
|
+ var answer = $('input[name=' + answerName + ']').val();
|
|
|
+ if (question === undefined || question === '') {
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ propertyMap.set("question" + i, question);
|
|
|
+ propertyMap.set("answer" + i, answer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var sensitiveWords = '${sensitiveWords}';
|
|
|
+ const mint = new MintFilter(sensitiveWords.split('|'));
|
|
|
+ var filterSync = '';
|
|
|
+ var touchWords = '';
|
|
|
+ var touchNum = 0;
|
|
|
+ propertyMap.forEach(function (value,key,map) {
|
|
|
+ filterSync = mint.filterSync(value);
|
|
|
+ filterSync.words.forEach(word=>{
|
|
|
+ touchWords += touchWords === '' ? word : "," + word;
|
|
|
+ })
|
|
|
+ if (touchWords !== '') {
|
|
|
+ // 增加敏感词触发数量
|
|
|
+ touchNum++;
|
|
|
+ // 设置敏感词提示
|
|
|
+ $("#" + key + "SensitiveWords").text("敏感词:" + touchWords);
|
|
|
+ touchWords = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
if (1 == status && emptyNum > 0) {
|
|
|
var msg = "您还剩余" + emptyNum + "项未完善,将会导致用户对您产品/仪器的认识度不够,确认是否提交?";
|
|
|
top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
if (v == 'ok') {
|
|
|
- loading('正在提交,请稍等...');
|
|
|
- form.submit();
|
|
|
+ if (touchNum > 0) {
|
|
|
+ var msg = 1 == status?"当前发布内容存在敏感词,已为您标记在输入框下方," +
|
|
|
+ "请修改后,再进行保存发布,强行保存发布将会导致审核不通过!":
|
|
|
+ "当前内容存在敏感词,已为您标记在输入框下方,建议修改后再进行保存!否则," +
|
|
|
+ "将会影响发布时审核不通过!";
|
|
|
+ top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
+ if (v == 'ok') {
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ }
|
|
|
+ }, {buttonsFocus: 1, persistent: true});
|
|
|
+ } else{
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ }
|
|
|
}
|
|
|
}, {buttonsFocus: 1, persistent: true});
|
|
|
} else {
|
|
@@ -259,6 +444,7 @@
|
|
|
</ul><br/>
|
|
|
<form:form id="inputForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/save" method="post" class="form-horizontal">
|
|
|
<form:hidden path="id"/>
|
|
|
+ <form:hidden path="fileIds"/>
|
|
|
<form:hidden path="commodityType"/>
|
|
|
<form:hidden path="emptyNum"/>
|
|
|
<sys:message content="${message}"/>
|
|
@@ -269,18 +455,21 @@
|
|
|
<label class="control-label">${commodityType}名称:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="name" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="nameSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">${commodityType}别名:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="alias" htmlEscape="false" class="input-xlarge " placeholder="输入英文名或者其他名称"/>
|
|
|
+ <label id="aliasSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">${commodityType}概述:</label>
|
|
|
<div class="controls" style="width:812px">
|
|
|
<textarea type="text" id="discription" name="discription" style="position: relative;height: 100px; width: 450px;" >${cmBaikeProduct.discription}</textarea>
|
|
|
+ <label id="discriptionSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -296,6 +485,7 @@
|
|
|
<label class="control-label">${commodityType}链接:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="productLink" htmlEscape="false" class="input-xxlarge " placeholder="输入采美商城的相关商品详情链接,便于用户精准找到"/>
|
|
|
+ <label id="productLinkSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -312,6 +502,43 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="control-group">
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label keyClass">相关视频(各视频大小不超过50M,最多上传6个)</label>
|
|
|
+ </div>
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label">标题:</label>
|
|
|
+ <div class="controls">
|
|
|
+ <input id="fileTitle" style="width: 457px" htmlEscape="false" >
|
|
|
+ </div>
|
|
|
+ <label class="control-label" style="margin-top:10px">视频路径:</label>
|
|
|
+ <div class="controls" style="margin-top:10px">
|
|
|
+ <input id="uploadFileName" type="text" style="display: inline;" placeholder="支持mp4" disabled="true" class="input-xlarge required" />
|
|
|
+ <div class="upload">
|
|
|
+ <input type="file" name="file" id="productFile" accept=".mp4" >选择文件
|
|
|
+ </div>
|
|
|
+ <div class="add-submit">
|
|
|
+ <input id="addSubmit" type="button" value="上传"/>上传
|
|
|
+ </div>
|
|
|
+ <div class="upload-loading">
|
|
|
+ <img alt="gif" src="/static/images/upload.gif" width="32px" border="none">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group">
|
|
|
+ <div id='file-list-display' style="margin-left:180px">
|
|
|
+ <c:if test="${not empty cmBaikeProduct.videoList}">
|
|
|
+ <c:forEach items="${cmBaikeProduct.videoList}" var="videoFile" varStatus="statusIndex">
|
|
|
+ <p>${videoFile.fileTitle}
|
|
|
+ <span class="del"><a onclick="previewVideo('${videoFile.ossUrl}')">预览</a></span>
|
|
|
+ <span class="del" onclick="dataDelete(this,'${videoFile.id}')">删除</span>
|
|
|
+ </p>
|
|
|
+ </c:forEach>
|
|
|
+ </c:if>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div style="${cmBaikeProduct.commodityType eq 2?'':'display:none'}" >
|
|
|
<div class="control-group">
|
|
|
<label class="control-label titleClass">正品识别</label>
|
|
@@ -320,6 +547,7 @@
|
|
|
<label class="control-label">认证链接:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="authLink" htmlEscape="false" class="input-xxlarge " cssStyle="position: relative"/>
|
|
|
+ <label id="authLinkSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -343,42 +571,54 @@
|
|
|
<div class="controls paramRow" id="paramRow0">
|
|
|
<input name="paramList[0].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:型号">
|
|
|
+ <label id="param0SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[0].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content0SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow1">
|
|
|
<input name="paramList[1].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:性质类型">
|
|
|
+ <label id="param1SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[1].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content1SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(1)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow2">
|
|
|
<input name="paramList[2].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:成分">
|
|
|
+ <label id="param2SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[2].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content2SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(2)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow3">
|
|
|
<input name="paramList[3].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:规格">
|
|
|
+ <label id="param3SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[3].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content3SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(3)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow4">
|
|
|
<input name="paramList[4].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:性质类型">
|
|
|
+ <label id="param4SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[4].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content4SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(4)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
<div class="controls paramRow" id="paramRow5">
|
|
|
<input name="paramList[5].name" htmlEscape="false" class="input-small "
|
|
|
placeholder="例如:性质类型">
|
|
|
+ <label id="param5SensitiveWords" class="red"></label>
|
|
|
<input name="paramList[5].content" htmlEscape="false" class="input-xlarge "
|
|
|
placeholder="输入参数信息">
|
|
|
+ <label id="content5SensitiveWords" class="red"></label>
|
|
|
<a onclick="deleteParam(5)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -387,6 +627,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="advantage" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="advantageEditor" class="contentEditor">${cmBaikeProduct.advantage}</div>
|
|
|
+ <label id="advantageSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -394,6 +635,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="disadvantage" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="disadvantageEditor" class="contentEditor">${cmBaikeProduct.disadvantage}</div>
|
|
|
+ <label id="disadvantageSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -401,12 +643,14 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="principle" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="principleEditor" class="contentEditor">${cmBaikeProduct.principle}</div>
|
|
|
+ <label id="principleSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">SEO关键词:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="seoKeyword" htmlEscape="false" style="position: relative" class="input-xlarge"/>
|
|
|
+ <label id="seoKeywordSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -416,12 +660,14 @@
|
|
|
<label class="control-label">品牌:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="brand" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="brandSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">产地:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="producePlace" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="producePlaceSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -436,6 +682,7 @@
|
|
|
<label class="control-label">供应商:</label>
|
|
|
<div class="controls">
|
|
|
<form:input path="company" htmlEscape="false" class="input-xlarge "/>
|
|
|
+ <label id="companySensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" style="position: relative">
|
|
@@ -481,6 +728,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="adaptiveMan" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="adaptiveManEditor" class="contentEditor">${cmBaikeProduct.adaptiveMan}</div>
|
|
|
+ <label id="adaptiveManSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -488,6 +736,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="unAdaptiveMan" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="unAdaptiveManEditor" class="contentEditor">${cmBaikeProduct.unAdaptiveMan}</div>
|
|
|
+ <label id="unAdaptiveManSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
@@ -495,6 +744,7 @@
|
|
|
<div class="controls" style="width:812px">
|
|
|
<form:textarea path="aroundOperation" htmlEscape="false" class="input-xlarge hide" />
|
|
|
<div id="aroundOperationEditor" class="contentEditor">${cmBaikeProduct.aroundOperation}</div>
|
|
|
+ <label id="aroundOperationSensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" style="width: 1000px">
|
|
@@ -536,18 +786,21 @@
|
|
|
<label class="control-label">问题1:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[0].question" style="width: 550px" htmlEscape="false" class="input-xlarge ">
|
|
|
+ <label id="question0SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" id="answerRow0">
|
|
|
<label class="control-label">答:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[0].answer" style="width: 550px" htmlEscape="false" class="input-xlarge ">
|
|
|
+ <label id="answer0SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group" id="questionRow1">
|
|
|
<label class="control-label">问题2:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[1].question" style="width: 550px" htmlEscape="false" class="input-xlarge questionInput">
|
|
|
+ <label id="question1SensitiveWords" class="red"></label>
|
|
|
<a id="questionDelBtn1" onclick="deleteQuestion(1)" style="cursor: pointer">删除</a>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -555,6 +808,7 @@
|
|
|
<label class="control-label">答:</label>
|
|
|
<div class="controls">
|
|
|
<input name="questionList[1].answer" style="width: 550px" htmlEscape="false" class="input-xlarge questionInput">
|
|
|
+ <label id="answer1SensitiveWords" class="red"></label>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -596,6 +850,7 @@
|
|
|
|
|
|
<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
|
|
|
<script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
|
|
|
+<script type="text/javascript" src="${ctxStatic}/sensitiveWords/mint-filter.umd.js"></script>
|
|
|
<script>
|
|
|
var paramIndex = 6;
|
|
|
var questionIndex = 2;
|
|
@@ -715,7 +970,9 @@
|
|
|
while (index < paramListSize) {
|
|
|
$(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + index + "\">\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + index + "].name\" htmlEscape=\"false\" class=\"input-small \" placeholder=\"参数名称\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"param" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + index + "].content\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"输入参数信息\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"content" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a onclick=\"deleteParam(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>");
|
|
|
index = index + 1;
|
|
@@ -751,6 +1008,7 @@
|
|
|
" <label class=\"control-label\">问题" + (index+1) + ":</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + index + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"question" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a id=\"questionDelBtn" + index + "\" onclick=\"deleteQuestion(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>\n" +
|
|
@@ -758,6 +1016,7 @@
|
|
|
" <label class=\"control-label\">答:</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + index + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"answer" + index + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>");
|
|
|
index = index + 1;
|
|
@@ -781,6 +1040,106 @@
|
|
|
$('input[name="' + questionInput + '"]').val(questionArray[i]);
|
|
|
$('input[name="' + answerInput + '"]').val(answerArray[i]);
|
|
|
}
|
|
|
+
|
|
|
+ var fileIds = $("#fileIds").val();
|
|
|
+ //点击上传按钮后上传文件
|
|
|
+ $('#addSubmit').click(function () {
|
|
|
+ var fileIdArr = fileIds.split(',');
|
|
|
+ if (fileIdArr.length >= 7) {
|
|
|
+ alertx('最多上传6个视频');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var filesById = document.getElementById('productFile');
|
|
|
+ var files = $('#productFile');
|
|
|
+ var fileList = files.prop('files');
|
|
|
+ var fileTitle = $('#fileTitle').val();
|
|
|
+ var fileName = $('#uploadFileName').val();
|
|
|
+ if (fileTitle == '') {
|
|
|
+ alertx('请输入视频标题')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (files === '' || files.length == 0 || fileName == '') {
|
|
|
+ alertx('请选择上传文件');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $("#fileTitle").val("");
|
|
|
+ $("#uploadFileName").val("");
|
|
|
+ var data = new FormData();
|
|
|
+ var productId = $("#id").val();
|
|
|
+ data.append('file', fileList[0]);
|
|
|
+ data.append('fileTitle', fileTitle);
|
|
|
+ data.append('fileName', fileName);
|
|
|
+ data.append('productId', productId);
|
|
|
+ data.append('fileIds', fileIds);
|
|
|
+ $('.upload-loading').css("display", "inline");
|
|
|
+ $.ajax({
|
|
|
+ url: "${ctx}/baike/cmBaikeProduct/upload",
|
|
|
+ data: data,
|
|
|
+ type: "POST",
|
|
|
+ processData: false,
|
|
|
+ contentType: false,
|
|
|
+ dataType: "json",
|
|
|
+ success: function (res) {
|
|
|
+ if (res.success) {
|
|
|
+ filesById.value = '';
|
|
|
+ renderFileList(res.productFile);
|
|
|
+ $('.upload-loading').hide();
|
|
|
+ } else {
|
|
|
+ $.jBox.tip(res.msg, 'error');
|
|
|
+ $("#uploadFileName").val(fileName);
|
|
|
+ $('.upload-loading').hide();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ error: function (json) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ var fileList = [];
|
|
|
+ var files = document.getElementById("productFile"), renderFileList;
|
|
|
+ //选择上传文件后显示文件名称
|
|
|
+ files.addEventListener("change", function (event) {
|
|
|
+ var name = event.target.files[0].name;
|
|
|
+ console.log(name)
|
|
|
+ $('#uploadFileName').val(name);
|
|
|
+ });
|
|
|
+ var fileListDisplay = document.getElementById('file-list-display');
|
|
|
+ renderFileList = function (data) {
|
|
|
+ fileIds += data.id + ',';
|
|
|
+ console.log(fileIds);
|
|
|
+ $('#fileIds').val(fileIds);
|
|
|
+ fileList.push({fileTitle: data.fileTitle, id: data.id, ossUrl: data.ossUrl});
|
|
|
+ fileList.forEach(function (file, index) {
|
|
|
+ var fileDisplayEl = document.createElement("p");
|
|
|
+ var deleteFile = document.createElement("span");
|
|
|
+ var viewFile = document.createElement("span");
|
|
|
+ var viewFileUrl = document.createElement("a");
|
|
|
+ //预览链接
|
|
|
+ viewFileUrl.innerHTML = '预览';
|
|
|
+ viewFileUrl.setAttribute("onclick", "previewVideo('" + file.ossUrl + "')");
|
|
|
+ viewFileUrl.setAttribute("target", "_blank");
|
|
|
+ //预览按钮
|
|
|
+ viewFile.className = 'viewFile';
|
|
|
+ console.log(viewFile);
|
|
|
+ viewFile.setAttribute("class","del");
|
|
|
+ viewFile.appendChild(viewFileUrl);
|
|
|
+ //删除按钮
|
|
|
+ deleteFile.innerHTML = '删除';
|
|
|
+ deleteFile.className = 'deleteFile';
|
|
|
+ console.log(deleteFile);
|
|
|
+ deleteFile.setAttribute("class","del");
|
|
|
+ deleteFile.setAttribute("onclick", "dataDelete(this, " + file.id + ")");
|
|
|
+
|
|
|
+ fileDisplayEl.setAttribute("id", file.id);
|
|
|
+ fileDisplayEl.innerHTML = file.fileTitle;
|
|
|
+ fileDisplayEl.appendChild(viewFile);
|
|
|
+ fileDisplayEl.appendChild(deleteFile);
|
|
|
+ fileListDisplay.appendChild(fileDisplayEl);
|
|
|
+ });
|
|
|
+ fileList.splice(0, fileList.length);
|
|
|
+ };
|
|
|
})
|
|
|
|
|
|
//删除参数
|
|
@@ -792,7 +1151,9 @@
|
|
|
function addParam() {
|
|
|
$(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + paramIndex + "\">\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + paramIndex + "].name\" htmlEscape=\"false\" class=\"input-small \" placeholder=\"例如:性质类型\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"param" + paramIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<input name=\"paramList[" + paramIndex + "].content\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"输入参数信息\">\n" +
|
|
|
+ "\t\t\t\t<label id=\"content" + paramIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a onclick=\"deleteParam(" + paramIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>")
|
|
|
paramIndex = paramIndex + 1;
|
|
@@ -813,6 +1174,7 @@
|
|
|
" <label class=\"control-label\">问题" + (questionIndex+1) + ":</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + questionIndex + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"question" + questionIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
"\t\t\t\t<a id=\"questionDelBtn" + questionIndex + "\" onclick=\"deleteQuestion(" + questionIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>\n" +
|
|
@@ -820,6 +1182,7 @@
|
|
|
" <label class=\"control-label\">答:</label>\n" +
|
|
|
" <div class=\"controls\">\n" +
|
|
|
" <input name=\"questionList[" + questionIndex + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
|
|
|
+ "\t\t\t\t<label id=\"answer" + questionIndex + "SensitiveWords\" class=\"red\"></label>\n" +
|
|
|
" </div>\n" +
|
|
|
" </div>")
|
|
|
$("#questionDelBtn" + (questionIndex - 1)).attr("style", "display:none;cursor: pointer");
|
|
@@ -906,6 +1269,36 @@
|
|
|
function onlynum(obj) {
|
|
|
obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
}
|
|
|
+
|
|
|
+ //删除文件
|
|
|
+ function dataDelete(that, id) {
|
|
|
+ console.log($(that).text());
|
|
|
+ $(that).parent().remove();
|
|
|
+ var fileIds = $("#fileIds").val();
|
|
|
+ if (fileIds.indexOf(id)) {
|
|
|
+ fileIds = fileIds.replace(id + ',', '');
|
|
|
+ $("#fileIds").val(fileIds);
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: "${ctx}/baike/cmBaikeProduct/deleteFile",
|
|
|
+ data: {"fileId": id},
|
|
|
+ async: false,
|
|
|
+ type: "POST"
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function previewVideo(url) {
|
|
|
+ var url = "${ctx}/archive/cmProductArchiveContent/preview?url=" + encodeURIComponent(url);
|
|
|
+ var title = "视频播放";
|
|
|
+ top.$.jBox("iframe:" + url, {
|
|
|
+ iframeScrolling: 'yes',
|
|
|
+ width: 1000,
|
|
|
+ height: 750,
|
|
|
+ persistent: true,
|
|
|
+ title: title,
|
|
|
+ buttons: {"关闭": '-1'}
|
|
|
+ });
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|