Authored by weiqingting

提交

var $ = require('jquery'),
common = require('../common/common');
// module;
var ENUM = {};
// common.util.__ajax({
// url:'/guang/article/getEnumList',
// async:false
// },function(res){
// ENUM=res.data;
// });
console.log(ENUM);
/*获取数据ViewModel*/
var ViewModel = {};
var param = location.href.slice(location.href.indexOf("contentEdit")).match(/\/\d+/g);
if(param&&param.length==1){
param[0]=param[0].replace(/\//,'');
common.util.__ajax({
url:'/guang/article/getArticleDetail',
data:{
id:param[0]
},
async:false
},function(res){
console.log(res.data);
ViewModel=res.data;
});
}
console.log("ViewModel",ViewModel);
var edit = new common.edit(".modal-body", {
bucket: "goodsimg"
... ... @@ -103,7 +114,7 @@ var Bll = {
$(selecter).html(common.util.__template2($("#" + templater).html(), data));
},
Tags: []
}
}
//获取品牌
Bll.getBrands();
... ... @@ -113,7 +124,7 @@ $(document).on('click', '.brand-index', function() {
});
/*渲染页面*/
$("#panel-body").html(common.util.__template2($("#tempalte1").html(), ENUM));
$("#panel-body").html(common.util.__template2($("#tempalte1").html(), ViewModel));
/*渲染品牌*/
// Bll.Brdata=ENUM.brands;
// Bll.renderBrandPic(Bll.Brdata);
... ...
... ... @@ -613,7 +613,7 @@ exports.res = [
view:'pages/guang/contentEdit',
src:'/guang/contentEdit',
data:{
action:"/ajax/guang/article/updateArticle"
action:"/ajax/guang/article/addArticle"
},
params:[
{name:"id",type:"String"}
... ... @@ -622,17 +622,12 @@ exports.res = [
{
route:'/guang/article/getArticleDetail',
method:'POST',
src:'/guang/article/getArticleDetail',
src:'/guang/article/getDetail',
params:[
{name:"id",type:"Number"}
]
},
{
route:'/guang/article/getEnumList',
method:'POST',
url:'/EnumListRest/getEnumList'
},
{
route:'/guang/tags/getList',
method:'POST',
url:'/guang/tags/getList'
... ...
... ... @@ -266,10 +266,9 @@
<script type="text/template" id="template_content">
<!-- 文本内容 -->
[[each modules as module index]]
<li class="custom-group text" data-index="[[index]]">
<li class="custom-group" data-index="[[index]]">
[[if module.template_name=='text']]
<div class="con">[[module.data.text]]</div>
[[else if module.template_name=='singleImage']]
<div class="list">
<img src="[[module.data[0].src]]" title="[[module.data[0].title]]">
... ... @@ -311,8 +310,6 @@
</ul>
</div>
{{> resource/taoyu2}}
[[/if]]
<div class="actions-box">
<div class="actions-wrap">
... ...