Commit 3f42f449 by 肖康

x

parent 15e7e49c
......@@ -3,9 +3,36 @@ var tag={
hbisAct:0,//是否画布区域
isClick:0,
init:function(){
if($("#templateid").val()){
//编辑
tag.getInfo();
}else{
//新增
tag.editUi();
}
tag.handle();
},
getInfo:function(){
$.ajax({
url : '/ajax/getTemplateDetail?t_id='+$("#templateid").val(),
type: 'get',
success: function(resp) {
if (resp.err_code == 0) {
$(".designName").val(resp.data.template_name)
var abobj=eval('('+resp.data.template_extend.attribute+')');
$(".tag-border").val(abobj.lableBorder);
$(".tag-bgm").val(abobj.lableBg);
$(".tag-size").val(abobj.lableSize);
$(".edit-box").html(resp.data.template_extend.html);
tag.editUi();
}
},
error: function(err) {
console.log(err)
}
})
},
editUi:function(){
$("body").attr("onselectstart","return false");
// 基本实例化:
......@@ -359,7 +386,10 @@ var tag={
$(".edit-con .huabuitem").removeClass("act");
$(".edit-con").removeClass("init-border");
obj.htmlp=String($(".edit-box").html());
obj.designName=$(".designName").val()
obj.designName=$(".designName").val();
if($("#templateid").val()){
obj.t_id =$("#templateid").val()
}
$.ajax({
url : '/ajax/add_template',
type: 'post',
......
<input type="hidden" id="templateid" value='{{Request::input("t_id")}}'/>
<div class="tag-content">
<div class="tag-tools">
<div class="tips">请拖动此处标签制作工具到下方编辑区域编辑!</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment