提交 b9f19ca3 authored 作者: 吴德鹏's avatar 吴德鹏

优化落地页商品排序

上级 5505d8f2
...@@ -52,9 +52,10 @@ ...@@ -52,9 +52,10 @@
<br/> <br/>
<Form-item label="答案" prop="answer" style="width: 800px"> <Form-item label="答案" prop="answer" style="width: 800px">
<!-- 加载编辑器的容器 --> <!-- 加载编辑器的容器 -->
<script id="container" name="content" type="text/plain"> <!-- <script id="container" name="content" type="text/plain">-->
</script> <!-- </script>-->
<!--<i-input v-model="tbCfProblem.answer" placeholder="答案"/>--> <!--<i-input v-model="tbCfProblem.answer" placeholder="答案"/>-->
<textarea v-model="tbCfProblem.answer" style="width: 600px;height: 300px;"></textarea>
</Form-item> </Form-item>
<Form-item label="是否展示" prop="enableFlag" style="width: 800px"> <Form-item label="是否展示" prop="enableFlag" style="width: 800px">
<i-select placeholder="请选择" v-model="tbCfProblem.enableFlag"> <i-select placeholder="请选择" v-model="tbCfProblem.enableFlag">
......
...@@ -5,7 +5,7 @@ $(function () { ...@@ -5,7 +5,7 @@ $(function () {
{label: 'problemId', name: 'problemId', index: 'problem_id', key: true, hidden: true}, {label: 'problemId', name: 'problemId', index: 'problem_id', key: true, hidden: true},
{label: '问题明细', name: 'question', index: 'question', width: 80}, {label: '问题明细', name: 'question', index: 'question', width: 80},
{label: '类型 ', name: 'type', index: 'type', width: 80, formatter: typeFormat}, {label: '类型 ', name: 'type', index: 'type', width: 80, formatter: typeFormat},
{label: '答案', name: 'answer', index: 'answer', width: 80, formatter: contentFormat}, // {label: '答案', name: 'answer', index: 'answer', width: 80, formatter: contentFormat},
{label: '是否展示', name: 'enableFlag', index: 'enable_flag', width: 80, formatter: validFormat}, {label: '是否展示', name: 'enableFlag', index: 'enable_flag', width: 80, formatter: validFormat},
{label: '排序', name: 'sort', index: 'sort', width: 80}, {label: '排序', name: 'sort', index: 'sort', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}], {label: '创建时间', name: 'createTime', index: 'create_time', width: 80}],
...@@ -17,25 +17,25 @@ $(function () { ...@@ -17,25 +17,25 @@ $(function () {
* 增加修改的编辑器 * 增加修改的编辑器
* @type {UE.ui.Editor|*} * @type {UE.ui.Editor|*}
*/ */
var ue = UE.getEditor('container'); // var ue = UE.getEditor('container');
//
/** // /**
* 获取文本框内容 // * 获取文本框内容
* @returns {*|String|void} // * @returns {*|String|void}
*/ // */
function getContent() { // function getContent() {
var htmlContent = ue.getContent(); // var htmlContent = ue.getContent();
return htmlContent; // return htmlContent;
} // }
//
/** // /**
* 显示内容 // * 显示内容
* @param content // * @param content
*/ // */
function showContent(problemId) { // function showContent(problemId) {
$('#contentModal').modal('show'); // $('#contentModal').modal('show');
vm.getInfo(problemId, true); // vm.getInfo(problemId, true);
}; // };
let vm = new Vue({ let vm = new Vue({
...@@ -93,8 +93,8 @@ let vm = new Vue({ ...@@ -93,8 +93,8 @@ let vm = new Vue({
vm.getInfo(problemId); vm.getInfo(problemId);
}, },
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
var answer = getContent(); // var answer = getContent();
vm.tbCfProblem.answer = encodeURI(answer); // vm.tbCfProblem.answer = encodeURI(answer);
let url = vm.tbCfProblem.problemId == null ? "../tbcfproblem/save" : "../tbcfproblem/update"; let url = vm.tbCfProblem.problemId == null ? "../tbcfproblem/save" : "../tbcfproblem/update";
Ajax.request({ Ajax.request({
url: url, url: url,
...@@ -103,7 +103,7 @@ let vm = new Vue({ ...@@ -103,7 +103,7 @@ let vm = new Vue({
contentType: "application/json", contentType: "application/json",
successCallback: function (r) { successCallback: function (r) {
alert('操作成功', function (index) { alert('操作成功', function (index) {
ue.setContent(""); // ue.setContent("");
vm.reload(); vm.reload();
}); });
} }
...@@ -135,9 +135,9 @@ let vm = new Vue({ ...@@ -135,9 +135,9 @@ let vm = new Vue({
async: true, async: true,
successCallback: function (r) { successCallback: function (r) {
console.log(r) console.log(r)
r.tbCfProblem.answer = decodeURI(r.tbCfProblem.answer); // r.tbCfProblem.answer = decodeURI(r.tbCfProblem.answer);
vm.tbCfProblem = r.tbCfProblem; vm.tbCfProblem = r.tbCfProblem;
ue.setContent(vm.tbCfProblem.answer); // ue.setContent(vm.tbCfProblem.answer);
if (!!isShowDetail) { if (!!isShowDetail) {
var answer = "无内容,请点击修改,添加内容"; var answer = "无内容,请点击修改,添加内容";
if (!!vm.tbCfProblem.answer) { if (!!vm.tbCfProblem.answer) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论