test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

5917 lines
171 KiB

define(['jquery.ui', '../../js/goods_selector.js'], function(ui, gSelector) {
var modal = {
sysinfo: null,
id: 0,
type: 1,
navs: {},
initnav: [],
data: {},
selected: 'page',
childid: null,
keyworderr: false,
};
jQuery.base64 = (function($) {
var _PADCHAR = "=",
_ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
_VERSION = "1.1";
function _getbyte64(s, i) {
var idx = _ALPHA.indexOf(s.charAt(i));
if(idx === -1) {
throw "Cannot decode base64"
}
return idx
}
function _decode_chars(y, x) {
while(y.length > 0) {
var ch = y[0];
if(ch < 0x80) {
y.shift();
x.push(String.fromCharCode(ch))
} else if((ch & 0x80) == 0xc0) {
if(y.length < 2) break;
ch = y.shift();
var ch1 = y.shift();
x.push(String.fromCharCode(((ch & 0x1f) << 6) + (ch1 & 0x3f)))
} else {
if(y.length < 3) break;
ch = y.shift();
var ch1 = y.shift();
var ch2 = y.shift();
x.push(String.fromCharCode(((ch & 0x0f) << 12) + ((ch1 & 0x3f) << 6) + (ch2 & 0x3f)))
}
}
}
function _decode(s) {
var pads = 0,
i, b10, imax = s.length,
x = [],
y = [];
s = String(s);
if(imax === 0) {
return s
}
if(imax % 4 !== 0) {
throw "Cannot decode base64"
}
if(s.charAt(imax - 1) === _PADCHAR) {
pads = 1;
if(s.charAt(imax - 2) === _PADCHAR) {
pads = 2
}
imax -= 4
}
for(i = 0; i < imax; i += 4) {
var ch1 = _getbyte64(s, i);
var ch2 = _getbyte64(s, i + 1);
var ch3 = _getbyte64(s, i + 2);
var ch4 = _getbyte64(s, i + 3);
b10 = (_getbyte64(s, i) << 18) | (_getbyte64(s, i + 1) << 12) | (_getbyte64(s, i + 2) << 6) | _getbyte64(s, i + 3);
y.push(b10 >> 16);
y.push((b10 >> 8) & 0xff);
y.push(b10 & 0xff);
_decode_chars(y, x)
}
switch(pads) {
case 1:
b10 = (_getbyte64(s, i) << 18) | (_getbyte64(s, i + 1) << 12) | (_getbyte64(s, i + 2) << 6);
y.push(b10 >> 16);
y.push((b10 >> 8) & 0xff);
break;
case 2:
b10 = (_getbyte64(s, i) << 18) | (_getbyte64(s, i + 1) << 12);
y.push(b10 >> 16);
break
}
_decode_chars(y, x);
if(y.length > 0) throw "Cannot decode base64";
return x.join("")
}
function _get_chars(ch, y) {
if(ch < 0x80) y.push(ch);
else if(ch < 0x800) {
y.push(0xc0 + ((ch >> 6) & 0x1f));
y.push(0x80 + (ch & 0x3f))
} else {
y.push(0xe0 + ((ch >> 12) & 0xf));
y.push(0x80 + ((ch >> 6) & 0x3f));
y.push(0x80 + (ch & 0x3f))
}
}
function _encode(s) {
if(arguments.length !== 1) {
throw "SyntaxError: exactly one argument required"
}
s = String(s);
if(s.length === 0) {
return s
}
var i, b10, y = [],
x = [],
len = s.length;
i = 0;
while(i < len) {
_get_chars(s.charCodeAt(i), y);
while(y.length >= 3) {
var ch1 = y.shift();
var ch2 = y.shift();
var ch3 = y.shift();
b10 = (ch1 << 16) | (ch2 << 8) | ch3;
x.push(_ALPHA.charAt(b10 >> 18));
x.push(_ALPHA.charAt((b10 >> 12) & 0x3F));
x.push(_ALPHA.charAt((b10 >> 6) & 0x3f));
x.push(_ALPHA.charAt(b10 & 0x3f))
}
i++
}
switch(y.length) {
case 1:
var ch = y.shift();
b10 = ch << 16;
x.push(_ALPHA.charAt(b10 >> 18) + _ALPHA.charAt((b10 >> 12) & 0x3F) + _PADCHAR + _PADCHAR);
break;
case 2:
var ch1 = y.shift();
var ch2 = y.shift();
b10 = (ch1 << 16) | (ch2 << 8);
x.push(_ALPHA.charAt(b10 >> 18) + _ALPHA.charAt((b10 >> 12) & 0x3F) + _ALPHA.charAt((b10 >> 6) & 0x3f) + _PADCHAR);
break
}
return x.join("")
}
return {
decode: _decode,
encode: _encode,
VERSION: _VERSION
}
}(jQuery));
modal.init = function(params) {
window.tpl = params.tpl;
modal.goods = '';
modal.headline = '';
modal.shop = '';
modal.optionInfo = '';
modal.attachurl = params.attachurl;
modal.type = params.type;
modal.diymenu = params.diymenu;
modal.diyadv = params.diyadv;
modal.menulist = params.menulist;
modal.advlist = params.advlist;
modal.data = params.data;
modal.id = params.id;
modal.diymenu = params.diymenu;
modal.diyadvs = params.diyadvs;
modal.merch = params.merch;
modal.plugins = params.plugins ? params.plugins : {};
modal.goodCate = params.goodCate;
modal.community_list = params.community_list;
if(modal.data) {
modal.type = modal.data.page.type;
modal.page = modal.data.page;
modal.items = modal.data.items
};
modal.optionInfoFun();
modal.initTpl();
modal.initPage();
modal.getNavs();
modal.initItems();
modal.initNavs();
modal.initSortable();
modal.initGotop();
modal.cubeFun();
$(".btn-save").unbind('click').click(function() {
var status = $(this).data('status');
var type = $(this).data('type');
if(status) {
tip.msgbox.err("正在保存,请稍候。。。");
return
}
if(type == 'preview') {
modal.save(true); //保存并且预览
} else if(type == 'save') {
modal.save(); //保存信息
} else if(type = 'savetemp') {
modal.initTemp(); //保存为模板
return
}
});
$("#page").unbind('click').click(function() {
$("#adv_title").html("本页面编辑");
//隐藏配置栏点击按钮
$("#nav_config").click();
$("#page_title").hide();
if(modal.selected == 'page') {
return
};
modal.selected = 'page';
modal.initPage()
});
$(".pageset").unbind('click').click(function() {
$("#page").trigger("click");
//隐藏配置栏点击按钮
$("#nav_config").click();
$("#page_title").hide();
});
};
modal.initNavs = function() {
/**
* search 搜索框组件 *** menu 菜单组件 *** banner 轮播图组件
* magic_cube 图片魔方组件 *** picturew 图片橱窗组件 *** pictures 图片展播组件
* richtext 富文本组件 *** title 标题组件 *** notice 公告组件
* line 辅助线组件 *** blank 辅助空白组件 *** rush_goods 抢购商品组件
* groupon_goods 团购商品组件 *** fightgroup_goods 拼团商品组件 *** bargain_goods 砍价商品组件
* public_goods 通用商品组件 *** coupon_goods 卡券商品组件 *** packages 大礼包商品组件
* discount_card 折扣卡商品组件 *** community 社群组件 *** shop 商户(商家信息)组件
* area_select 地区选择组件 *** options 选项卡组件 *** user_info 用户信息(定制)
* shop_join 商户入驻组件 *** jump_wxapp 公众号跳转小程序组件 *** recruit_statistics 求职-统计组件
* recruit_enterprise 求职-企业组件 *** recruit_recruit 求职 - 招聘信息组件 *** recruit_resume 求职-简历组件
* flow 流量主组件 *** dating_statistics 相亲交友 - 统计组件 *** dating_user 相亲交友 - 会员组件
* integral_goods 积分商品组件 *** citydelivery_goods 配送商品组件 *** housekeep 家政服务组件
*/
modal.getNavs();
//配置信息:0=所有内容(供开发者查看/无该页面配置信息时使用);1=自定义页面;2=商城首页;3=抢购首页;4=团购首页;5=卡券首页;6=拼团首页;7=砍价首页;8=好店首页;l4=活动首页;
//l5=求职招聘首页;l6=相亲交友首页;l7=家政服务首页
var navgroup = {
0: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'rush_goods', 'groupon_goods', 'bargain_goods', 'fightgroup_goods', 'activity_goods', 'coupon_goods','integral_goods','citydelivery_goods', 'public_goods', 'packages', 'discount_card', 'community', 'shop', 'area_select', 'options', 'headline', 'shop_join', 'user_info', 'jump_wxapp', 'recruit_statistics', 'recruit_enterprise', 'recruit_recruit', 'flow','dating_statistics','dating_user','house_keep'],
1: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'rush_goods', 'groupon_goods', 'bargain_goods', 'fightgroup_goods', 'activity_goods', 'coupon_goods','integral_goods','citydelivery_goods', 'public_goods', 'packages', 'discount_card', 'community', 'shop', 'area_select', 'options', 'headline', 'shop_join', 'user_info', 'jump_wxapp', 'recruit_statistics', 'recruit_enterprise', 'recruit_recruit', 'flow','dating_statistics','dating_user','house_keep'],
2: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'rush_goods', 'groupon_goods', 'bargain_goods', 'fightgroup_goods', 'activity_goods', 'coupon_goods','integral_goods','citydelivery_goods', 'public_goods', 'packages', 'discount_card', 'community', 'shop', 'area_select', 'options', 'headline', 'shop_join', 'user_info', 'jump_wxapp', 'recruit_statistics', 'recruit_enterprise', 'recruit_recruit', 'flow','dating_statistics','dating_user','house_keep'],
3: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'rush_goods', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'flow'],
4: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'groupon_goods', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'flow'],
5: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'coupon_goods', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'flow'],
6: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'fightgroup_goods', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'flow'],
7: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'bargain_goods', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'flow'],
8: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'community', 'area_select', 'shop', 'shop_join', 'options', 'user_info', 'jump_wxapp', 'flow'],
14: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'flow'],
15: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp', 'recruit_statistics', 'recruit_enterprise', 'recruit_recruit', 'flow'],
16: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp','dating_statistics','dating_user'],
17: ['search', 'menu', 'banner', 'magic_cube', 'picturew', 'pictures', 'richtext', 'title', 'notice', 'line', 'blank', 'community', 'area_select', 'options', 'user_info', 'jump_wxapp','house_keep'],
};
//信息处理
var navpage = navgroup[modal.type];
if(!navpage) {
navpage = navgroup[0]
}
$.each(navpage, function(index, val) {
var params = modal.navs[val];
//判断当前插件是否存在 不存在则删除该插件对应的装修功能
if(params) {
params.id = val;
//基本插件判断
if(val == 'coupon_goods' && !modal.plugins.coupon) {
return true
}
if(val == 'fightgroup_goods' && !modal.plugins.fightgroup) {
return true
}
if(val == 'groupon_goods' && !modal.plugins.groupon) {
return true
}
if(val == 'rush_goods' && !modal.plugins.rush) {
return true
}
if(val == 'bargain_goods' && !modal.plugins.bargain) {
return true
}
if(val == 'activity_goods' && !modal.plugins.activity) {
return true
}
if(val == 'citydelivery_goods' && !modal.plugins.citydelivery) {
return true
}
//定制组件判断
if(val == 'user_info' && !modal.plugins.user_info) {
return true
}
//求职招聘判断
let recruitList = [
'recruit_statistics',//求职-统计组件
'recruit_enterprise',//求职-企业组件
'recruit_recruit',//求职 - 招聘信息组件
'recruit_resume',//求职-简历组件
];
if($.inArray(val,recruitList) > -1 && !modal.plugins.recruit) {
return true
}
//相亲交友判断
let datingList = [
'dating_statistics',//统计组件
'dating_user',//统计组件
];
if($.inArray(val,datingList) > -1 && !modal.plugins.dating) {
return true
}
//家政服务判断
let houserKeepList = [
'house_keep',//家政服务
];
if($.inArray(val,houserKeepList) > -1 && !modal.plugins.housekeep) {
return true
}
modal.initnav.push(params)
}
});
var html = tpl("tpl_navs", modal);
$("#navs").html(html).show();
$("#navs,#createNavContent").on('click', "nav,.drag", function() {
var id = $(this).data('id');
var item = $.extend(true, {}, modal.navs[id]);
//如果点击的是图片魔方 进行单独的其他操作
if(id == 'magic_cube') {
modal.magicCube();
return false;
}
if(id === 'page') {
$("#page").trigger("click");
return
}
var inArray = $.inArray(id, navpage);
if(inArray < 0) {
tip.msgbox.err("此页面类型禁止添加此元素!");
return
}
var group_name = $(this).attr("group_name");
//如果选取的内容是组件群 进行组件的替换操作
if(group_name) {
//更换当前组件
var group_key = $(this).attr("group_key");
item = $.extend(true, {}, modal.groupNav[group_name][group_key]);
item.group_name = group_name;
item.group_key = group_key;
item.id = item.model;
delete item.title;
delete item.model;
//获取当前在phone中的itemid
var itemid = $("#phone .selected").data("itemid");
//修改储存的数据
modal.items[itemid] = $.extend(true, {}, item);
//从新渲染
modal.initItems();
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
return false;
}
if(!item) {
tip.msgbox.err("未找到此元素!");
return
}
var itemTplShow = $("#tpl_show_" + id).length;
var itemTplEdit = $("#tpl_edit_" + id).length;
if(itemTplShow == 0 || itemTplEdit == 0) {
tip.msgbox.err("添加失败!模板错误,请刷新页面重试");
return
}
if(id === 'diymod') {
modal.initMod(item);
return
}
var itemid = modal.getId("M", 0);
if(item.data) {
var itemData = $.extend(true, {}, item.data);
var newData = {};
var index = 0;
$.each(itemData, function(id, data) {
var childid = modal.getId("C", index);
newData[childid] = data;
delete childid;
index++
});
item.data = newData
}
//判断当前组件是否限制添加数量
var limitStatus = modal.numberLimit(item);
if(!limitStatus){
tip.msgbox.err("当前组件最多允许添加 " + item.max + " 个");
return false;
}
modal.items[itemid] = item;
//添加时进行判断 保证选项卡组件在最后面
var optionItems = {},newModalItems = {};
$.each(modal.items, function(key, val) {
if(val.id == 'options' || val.group_name == 'options' ){
optionItems = val;
}else{
newModalItems[key]= $.extend(true, {}, val);
}
});
modal.items = $.extend(true, {}, newModalItems);
if(optionItems.id == 'options' || optionItems.group_name == 'options'){
modal.items['M9999999999999'] = $.extend(true, {}, optionItems);
if(id == 'options'){
//当 添加组件为选项卡组件时 选中当前添加的选项卡组件
itemid = 'M9999999999999';
}
}
//重新渲染一次内容
modal.initItems();
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
modal.selected = itemid
//隐藏配置栏点击按钮
$("#page_title").hide();
//建立组件群其他组件
if(item.group) {
//组件群 显示配置栏点击按钮
$("#page_title").show();
//存在组件群 进行组件群建立步骤,不在进行单组件建立步骤
var groupInfo = $.extend(true, {}, modal.groupNav[item.group]);
if(!groupInfo) {
return
}
var html = '';
$.each(groupInfo, function(k, v) {
//判断模板是否存在
var itemTplShow = $("#tpl_show_" + v['model']).length; //模板信息
if(itemTplShow == 0) {
tip.msgbox.err("添加失败!模板错误,请刷新页面重试");
return
}
//建立单个组件
var navInfo = $.extend(true, {}, v);
navInfo.merch = modal.merch;
navInfo.plugins = modal.plugins;
navInfo.id = id;
navInfo.group_name = item.group;
navInfo.group_key = k;
//建立单个主键的标题
html += tpl("tpl_public_title", {
title: navInfo['title']
});
html += tpl("tpl_show_" + navInfo['model'], navInfo);
});
$("#diy-editor [page_id='nav_type']").html(html)
return false;
}
})
//配置栏 组件&配置信息的显示隐藏 默认打开配置信息
$("[page_id='nav_config']").show();
$("#page_title .page_name").unbind('click').click(function() {
var id = $(this).attr("id");
//删除active
$("#page_title .page_name").removeClass("active");
//添加active
$(this).addClass("active");
//隐藏内容
$("#diy-editor .inner_content").hide();
//显示内容
$("[page_id='" + id + "']").show();
});
//商品组件 - 点击选择商品
$("#diy-editor").on("click", '.select_goods', function() {
//商品类型 1=抢购(rush) 2=团购(groupon) 3=拼团(wlfightgroup) 5=优惠券(coupon)
var plugin = $(this).data("plugin");
var itemid = $(this).data("id");
$("#SelectGoodsContent").attr("itmeid",itemid);
//发送获取商品的请求
modal.getGoods(plugin, '', '', itemid);
});
//商品组件 - 点击商品信息栏分页获取当前页内容
$("#SelectGoodsContent").on('click', '.paging_button', function() {
var plugin = $(this).data("plugin");
var page = $(this).data("page");
var itemid = $("#SelectGoodsContent").attr("itmeid");
var search = $("#SelectGoodsContent .searchContent").children("input").val();
modal.getGoods(plugin, page,search,itemid);
});
//商品组件 - 搜索商品
$("#SelectGoodsContent").on('click', '.goodsSelect', function() {
var plugin = $(this).data("plugin");
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectGoodsContent").attr("itmeid");
modal.getGoods(plugin, 1, search,itemid);
});
//商品组件 - 点击选中商品
$("#SelectGoodsContent").on('click', '.selectGoods', function() {
var key = $(this).data("key");
var keys = $(this).data("keys");
var info = modal.goods[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][keys] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectGoodsContent").modal('hide');
});
//头条组件 - 点击获取头条信息
$("#diy-editor").on("click", '.select_headline', function() {
var itemid = $(this).data("id");
$("#SelectHeadlineContent").attr("itmeid",itemid);
modal.getHeadline('', '', itemid);
});
//头条组件 - 点击分页获取当前页头条内容
$("#SelectHeadlineContent").on('click', '.paging_button', function() {
var page = $(this).data("page");
var itemid = $("#SelectHeadlineContent").attr("itmeid");
var search = $("#SelectHeadlineContent .searchContent").children("input").val();
modal.getHeadline(page,search,itemid);
});
//头条组件 - 搜索头条
$("#SelectHeadlineContent").on('click', '.headlineSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectHeadlineContent").attr("itmeid");
modal.getHeadline(1, search,itemid);
});
//头条组件 - 点击选中头条
$("#SelectHeadlineContent").on('click', '.selectHeadline', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.headline[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectHeadlineContent").modal('hide');
});
//商户组件 - 点击获取商户信息
$("#diy-editor").on("click", '.select_shop', function() {
var itemid = $(this).data("id");
$("#SelectShopContent").attr("itmeid",itemid);
modal.getShop('', '', itemid);
});
//商户组件 - 点击分页获取当前页商户内容
$("#SelectShopContent").on('click', '.paging_button', function() {
var page = $(this).data("page");
var itemid = $("#SelectShopContent").attr("itmeid");
var search = $("#SelectShopContent .searchContent").children("input").val();
modal.getShop(page,search,itemid);
});
//商户组件 - 搜索商户
$("#SelectShopContent").on('click', '.shopSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectShopContent").attr("itmeid");
modal.getShop(1, search,itemid);
});
//商户组件 - 点击选中商户
$("#SelectShopContent").on('click', '.selectShop', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.shop[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectShopContent").modal('hide');
});
//求职招聘 - 企业选择器弹出
$("#diy-editor").on("click", '.select_enterprise', function() {
var itemid = $(this).data("id");
$("#SelectEnterpriseContent").attr("itmeid",itemid);
//显示弹框
var html = tpl("tplSelectEnterprise", {});
$("#SelectEnterpriseContent").html(html);
$("#SelectEnterpriseContent").modal();
});
//求职招聘 - 搜索企业信息
$("#SelectEnterpriseContent").on('click', '.enterpriseSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectEnterpriseContent").attr("itmeid");
$.ajax({
url: biz.url('utility/select/selectEnterprise'),
data: {search: search,return_type:'json'},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = {'list':res.data};
modal.enterprise = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectEnterprise", info);
$("#SelectEnterpriseContent").html(html);
}
});
});
//求职招聘 - 点击选中企业
$("#SelectEnterpriseContent").on('click', '.selectEnterprise', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.enterprise[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectEnterpriseContent").modal('hide');
});
//求职招聘 - 招聘选择器弹出
$("#diy-editor").on("click", '.select_recruit', function() {
var itemid = $(this).data("id");
$("#SelectRecruitContent").attr("itmeid",itemid);
modal.getRecruit('', '', itemid);
});
//求职招聘 - 点击分页获取当前页招聘内容
$("#SelectRecruitContent").on('click', '.paging_button', function() {
var page = $(this).data("page");
var itemid = $("#SelectRecruitContent").attr("itmeid");
var search = $("#SelectRecruitContent .searchContent").children("input").val();
modal.getRecruit(page,search,itemid);
});
//求职招聘 - 搜索招聘信息
$("#SelectRecruitContent").on('click', '.recruitSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectRecruitContent").attr("itmeid");
modal.getRecruit(1, search,itemid);
});
//求职招聘 - 点击选中招聘信息
$("#SelectRecruitContent").on('click', '.selectRecruit', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.recruit[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectRecruitContent").modal('hide');
});
//求职招聘 - 简历选择器弹出
$("#diy-editor").on("click", '.select_resume', function() {
var itemid = $(this).data("id");
$("#SelectResumeContent").attr("itmeid",itemid);
modal.getResume('', '', itemid);
});
//求职招聘 - 点击分页获取当前页简历内容
$("#SelectResumeContent").on('click', '.paging_button', function() {
var page = $(this).data("page");
var itemid = $("#SelectResumeContent").attr("itmeid");
var search = $("#SelectResumeContent .searchContent").children("input").val();
modal.getResume(page,search,itemid);
});
//求职招聘 - 搜索简历信息
$("#SelectResumeContent").on('click', '.resumeSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectResumeContent").attr("itmeid");
modal.getResume(1, search,itemid);
});
//求职招聘 - 点击选中简历信息
$("#SelectResumeContent").on('click', '.selectResume', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.resume[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectResumeContent").modal('hide');
});
//相亲交友 - 会员选择器弹出
$("#diy-editor").on("click", '.select_dating', function() {
var itemid = $(this).data("id");
$("#SelectDatingContent").attr("itmeid",itemid);
modal.getDating('', '', itemid);
});
//相亲交友 - 点击分页获取当前页简历内容
$("#SelectDatingContent").on('click', '.paging_button', function() {
var page = $(this).data("page");
var itemid = $("#SelectDatingContent").attr("itmeid");
var search = $("#SelectDatingContent .searchContent").children("input").val();
modal.getDating(page,search,itemid);
});
//相亲交友 - 搜索简历信息
$("#SelectDatingContent").on('click', '.datingSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectDatingContent").attr("itmeid");
modal.getDating(1, search,itemid);
});
//相亲交友 - 点击选中简历信息
$("#SelectDatingContent").on('click', '.selectDating', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.dating[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectDatingContent").modal('hide');
});
//家政服务 - 选择器弹出
$("#diy-editor").on("click", '.select_houseKeep', function() {
var itemid = $(this).data("id");
$("#SelectHouseKeepContent").attr("itmeid",itemid);
modal.getHouseKeep('', '', itemid);
});
//家政服务 - 点击分页获取当前页内容
$("#SelectHouseKeepContent").on('click', '.paging_button', function() {
var page = $(this).data("page");
var itemid = $("#SelectHouseKeepContent").attr("itmeid");
var search = $("#SelectHouseKeepContent .searchContent").children("input").val();
modal.getHouseKeep(page,search,itemid);
});
//家政服务 - 搜索信息
$("#SelectHouseKeepContent").on('click', '.houseKeepSelect', function() {
var search = $(this).prev(".searchContent").children("input").val();
var itemid = $("#SelectHouseKeepContent").attr("itmeid");
modal.getHouseKeep(1, search,itemid);
});
//家政服务 - 点击选中信息
$("#SelectHouseKeepContent").on('click', '.selectHouseKeep', function() {
var key = $(this).data("key");
var id = $(this).data("itemid");
var info = modal.houseKeep[key];
//获取itemid
var itemid = $("#phone .selected").data("itemid");
modal.items[itemid]['data'][id] = $.extend(true, {}, info);
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
//关闭弹框
$("#SelectHouseKeepContent").modal('hide');
});
};
modal.getId = function(S, N) {
var date = +new Date();
var id = S + (date + N);
return id
};
modal.getNavs = function() {
//基础组件 nav_class=1:基础组件; =2:辅助组件; =3:商品/商户组件; =4:功能组件
modal.navs = {
notice: {
nav_class: 2,
group: 'notice',
name: '公告',
style: {
'marginbottom': '0',
},
},
banner: {
nav_class: 1,
group: 'banner',
name: '图片轮播',
params: {
img_width:640,
img_height:300,
},
style: {
'dotstyle': 'round',
'dotalign': 'left',
'side_margin': 0,//0=无边距;1=有边距
'bottom': '0',
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
}
}
},
richtext: {
nav_class: 1,
name: '富文本',
params: {
content: ''
},
style: {
'background': '#ffffff',
'padding': '0'
},
data: {}
},
title: {
nav_class: 2,
group: 'title',
name: '标题栏',
params: {
'title': '',
'link':"",
'butname':"查看更多",
'url_type':"",
},
style: {
'background': '#ffffff',
'color': '#666666',
'textalign': 'left',
'paddingBottom': '5',
}
},
search: {
nav_class: 1,
group: 'search',
name: '搜索框',
params: {
'placeholder': '请输入关键字进行搜索',
'search_type': 1,//1=搜索商品,2=搜索招聘信息
},
style: {
'inputbackground': '#ffffff',
'background': '#f1f1f2',
'iconcolor': '#b4b4b4',
'color': '#999999',
'textalign': 'left',
'searchstyle': '',
'marginBottom': "0"
}
},
line: {
nav_class: 2,
name: '辅助线',
params: {},
style: {
'background': '#ffffff',
"bordercolor": "#000000",
'padding': '10',
'linestyle': 'solid',
'leftpadding': "0",
}
},
blank: {
nav_class: 2,
name: '辅助空白',
params: {},
style: {
height: '20',
background: '#ffffff'
}
},
menu: {
nav_class: 1,
group: "menu",
name: '按钮组',
params: {},
style: {
'navstyle': '',
'background': '#ffffff',
'rownum': '4',
'showtype': '0',
'pagenum': '8',
'marginbottom': "0",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字1',
color: '#666666'
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字2',
color: '#666666'
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字3',
color: '#666666'
},
C0123456789104: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字4',
color: '#666666'
}
}
},
picturew: {
nav_class: 1,
group: 'picturew',
name: '图片橱窗',
params: {},
style: {
'marginLeftRight': "5",
'marginTopBottom': "5",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789104: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
}
}
},
pictures: {
nav_class: 1,
name: '图片展播',
params: {
showtype: 0,
rownum: 3
},
style: {
background: "#ffffff",
paddingtop: "5",
paddingleft: "5",
titlealign: 'left',
titlecolor: '#ffffff',
textcolor: '#666666'
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
title: '这里是上标题',
text: '这里是下标题'
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
title: '这里是上标题',
text: '这里是下标题'
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
title: '这里是上标题',
text: '这里是下标题'
}
}
},
magic_cube: {
nav_class: 1,
name: '图片魔方',
style: {},
data: {}
},
rush_goods: {
nav_class: 3,
group: "rush_goods",
name: '抢购商品',
plugin: 1, //商品类型
params: {
type: 1, //1=手动选择 2=选择分类 3=选择状态
orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
classs: 0, //按商品分类选择时,商品分类id
status: 1, //按状态选择时,商品状态
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
groupon_goods: {
nav_class: 3,
group: "groupon_goods",
name: '团购商品',
plugin: 2,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
fightgroup_goods: {
nav_class: 3,
group: "fightgroup_goods",
name: '拼团商品',
plugin: 3,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
marker_set: 0,//角标是否显示 0=不显示,1=显示
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
'marker_bg': '#FF4444',
'marker_color': '#FFFFFF',
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
bargain_goods:{
nav_class: 3,
group: "bargain_goods",
name: '砍价商品',
plugin: 7,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
marker_set: 0,//角标是否显示 0=不显示,1=显示
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
'marker_bg': '#FF4444',
'marker_color': '#FFFFFF',
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
}
}
},
activity_goods: {
nav_class: 3,
group: "activity_goods",
name: '同城活动',
plugin: 9, //商品类型
params: {
type: 1, //1=手动选择 2=选择分类 3=选择状态
orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
classs: 0, //按商品分类选择时,商品分类id
status: 1, //按状态选择时,商品状态
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
coupon_goods: {
nav_class: 3,
group: "coupon_goods",
name: '优惠券',
plugin: 5,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
user_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
integral_goods: {
nav_class: 3,
group: "integral_goods",
name: '积分商品',
plugin: 8,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 3,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
}
}
},
citydelivery_goods:{
nav_class: 3,
group: "citydelivery_goods",
name: '配送商品',
plugin: 10,
params: {
title: '推荐',//块标题
show_more: 1,//是否显示更多 0=不显示,1=显示
type: 1, //1=手动选择 2=选择分类
orders: 1,//1=综合 2=销量 3=价格降序 4=价格升序 5=创建时间
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#FFFFFF",//背景颜色
'padding': 10,//内边距
'marginBottom': 0,//下边距
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789102: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789103: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
}
},
packages:{
nav_class: 3,
group: "packages",
name: '大礼包',
plugin: 4,
params: {
type: 1, //1=手动选择 2=选择分类 3=选择状态
orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
datestatus:1,
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
storename: '商户名称',
name: '礼包名称',
usetimes: '100',//周期内使用次数
surplus: '99',//剩余次数
price: '88888',
}
}
},
discount_card:{
nav_class: 3,
group: "discount_card",
name: '折扣卡',
plugin: 6,
params: {
type: 1, //1=手动选择 2=选择分类 3=选择状态
orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
name: '卡券名称',
limit: '使用限制',
discount: 1.0,//折扣
storename: '店铺名称',//
logo: '../addons/weliam_smartcity/web/resource/images/default.png',
}
}
},
headline: {
nav_class: 1,
group: "headline",
name: '头条',
params: {},
style: {
'bgColor': "#FFFFFF",
'marginBottom': "0",
'type':"1",
'show_num':"1"
},
data: {
C0123456789101: {
'title': '头条标题',
'summary': '头条副标题',
'display_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'author': '作者',
'author_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'browse': '999',
'one_name': '分类',
'two_name': '分类'
}
}
},
community: {
nav_class: 2,
name: '社群',
params: {
community_id: 0,
title: "入群",
name: "请输入群名称",
introduce: "请输入群的简介",
imgUrl: "../addons/weliam_smartcity/web/resource/images/default.png",
qrcodeUrl: "../addons/weliam_smartcity/web/resource/images/default.png"
},
style: {
'bgColor': "#FFFFFF", //背景颜色
'marginBottom': "0", //上下边距
'buttonbg': "#ff0000", //按钮背景
'buttonColor': "#FFFFFF", //按钮颜色
},
data: {}
},
public_goods:{
nav_class: 3,
group: "public_goods",
name: '通用商品',
plugin: 0, //商品类型
params: {},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
shop:{
nav_class: 3,
group: "shop",
name: '商家信息',
params: {
type:1,//1=手动选择 2=自动选择
rule:3,//自动规则 1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
show_num:5,//默认显示的数量
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
score:"5",
storehours:"00:00—23:59&nbsp;营业",
address:"店铺地址信息",
oneType:'一级分类',
twoType:'二级分类',
goods:{
halfcard:{name:'一卡通'},
active:{name:'抢购商品'},
coupon:{name:'卡券信息'},
fightgroup:{name:'拼团商品'},
packages:{name:'大礼包信息'},
groupon:{name:'团购商品'},
}
}
}
},
area_select:{
nav_class: 2,
name: '地区选择',
params: {
nickname: "用户昵称...",
avatar: "../addons/weliam_smartcity/web/resource/images/default.png",
areaname:"地区名称",
},
style:{
'background':'#FFF',
'nicknameColor':'#000',
'areanameColor':'#000',
'marginBottom': "0",
'showtype':0,
}
},
options: {
nav_class: 1,
max: 1,
group: "options",
name: '选项卡',
params: {},
style: {
'marginBottom': "0",
'selectBg': '#ff2d2d',
'background': '#FFFFFF',
'defaultBg': '#000000',
},
data: modal.optionInfo,
},
shop_join:{
nav_class: 2,
group: "shop_join",
name: '商户入驻',
params: {
title:"商户入驻",
button:'我要入驻'
},
style: {
'marginBottom': "0",
},
data: {},
},
user_info:{
nav_class: 2,
name: '用户信息',
params: {
'title':'我的乐豆',
'button_title':'积分兑换乐豆',
'link':'',
},
style: {},
data: {},
},
jump_wxapp:{
nav_class: 2,
name: '公众号跳转小程序',
params: {
img: '',
link:'',
original_id:'',
},
style: {}
},
recruit_statistics:{
nav_class: 4,
name: '统计(求职招聘)',
params: {
enterprise:{
title:'入驻企业',
numberColor: '#000000',
titleColor: '#CCCCCC',
backgroundColor: '#FFFFFF',
icon: '../addons/weliam_smartcity/web/resource/diy/images/enterprise.png'
},//入驻企业
recruit:{
title:'职业',
numberColor: '#000000',
titleColor: '#CCCCCC',
backgroundColor: '#FFFFFF',
icon: '../addons/weliam_smartcity/web/resource/diy/images/recruit.png'
},//职业
resume:{
title:'简历',
numberColor: '#000000',
titleColor: '#CCCCCC',
backgroundColor: '#FFFFFF',
icon: '../addons/weliam_smartcity/web/resource/diy/images/resume.png'
},//简历
pv:{
title:'访问',
numberColor: '#000000',
titleColor: '#CCCCCC',
backgroundColor: '#FFFFFF',
icon: '../addons/weliam_smartcity/web/resource/diy/images/pv.png'
},//访问
},
style: {},
data: {},
},
recruit_enterprise: {
nav_class: 4,
group: "recruit_enterprise",
name: '企业(求职招聘)',
params: {
type: 1, //加载类型:1=手动选择,2=选择行业
orders: 1, //排序:1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
industry_id: 0, //行业id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#FFFFFF",//背景颜色
'padding': 0,//内边距
'marginBottom': 0,//下边距
},
data: {
R0123456789101: {
storename: "请选择企业...",
logo:'../addons/weliam_smartcity/web/resource/images/default.png',
is_authentication: 0,//是否认证:0=未认证,1=已认证
nature:'企业性质',//企业性质
scale:'企业规模',//企业规模
industry:'经营行业',//经营行业
area:'所在区域',//所在区域
release_recruit: 999,//招聘中岗位数量
}
}
},
recruit_recruit: {
nav_class: 4,
name: '招聘(求职招聘)',
params: {
type: 1, //加载类型:1=手动选择,2=选择行业
orders: 1, //排序:1=推荐排序,2=浏览,3=发布时间,4=距离排序
industry_id: 0, //行业id
show_num: 1, //显示的数量
},
style: {
'bgColor': "#FFFFFF",//背景颜色
labelBgColor: '#F4F4F4',//标签背景
labelColor: '#666666',//标签字体颜色
'padding': 0,//内边距
'marginBottom': 0,//下边距
},
data: {
R0123456789101: {
title:'招聘标题名称',
recruitment_type: 1,//招聘类型:1=个人招聘,2=企业招聘
job_type:1,//工作类型:1=全职,2=兼职
status: 4,//招聘状态:1=待付款,2=审核中,3=未通过,4=招聘中,5=已结束
release: {
name: '发布方姓名',//发布方姓名
logo: '../addons/weliam_smartcity/web/resource/images/default.png',//发布方logo
nature: '企业性质',//企业性质
scale: '企业规模',//企业规模
industry: '企业行业',//企业行业
is_authentication: 1,//是否认证:0=未认证,1=已认证
},
salary: '99K~99K',//薪资
welfare_list:['职位福利','职位福利','职位福利','职位福利','职位福利'],
area:'区',
release_time: '今日',
}
}
},
recruit_resume: {
nav_class: 4,
name: '求职招聘-简历',
params: {
type: 1, //加载类型:1=手动选择,2=选择行业
orders: 1, //排序:1=推荐排序,2=浏览,3=发布时间
industry_id: 0, //行业id
show_num: 1, //显示的数量
},
style: {
bgColor: "#FFFFFF",//背景颜色
labelBgColor: '#F4F4F4',//标签背景
labelColor: '#666666',//标签字体颜色
padding: 0,//内边距
marginBottom: 0,//下边距
},
data: {
R0123456789101: {
age: 18,//年龄
area: "区域",//区
avatar: "../addons/weliam_smartcity/web/resource/images/default.png",//头像
education: "学历",//学历
expect_position_list: ["职位一", "职位二", "职位三"],//期望职位,MAX:3
experience: "无工作经验",//工作经验
gender: "2",//性别:2=男,3=女
name: "姓名",//姓名
salary: "999~999K",//期望薪资
}
}
},
flow:{
nav_class: 2,
group: "flow",
name: '流量主',
params: {
unit_id:'',
},
style: {},
data: {}
},
dating_statistics:{
nav_class: 4,
name: '统计(相亲交友)',
params: {
user:{
title:'会员数',
numberColor: '#000000',
titleColor: '#9E9E9E',
backgroundColor: '#F8F8F8',
icon: '../addons/weliam_smartcity/web/resource/diy/images/dating_user.png'
},//会员数
pv:{
title:'访问量',
numberColor: '#000000',
titleColor: '#9E9E9E',
backgroundColor: '#F8F8F8',
icon: '../addons/weliam_smartcity/web/resource/diy/images/dating_pv.png'
},//访问量
},
style: {},
data: {},
},
dating_user:{
nav_class: 4,
name: '会员(相亲交友)',
params: {
type: 1, //加载类型:1=手动选择,2=自动加载
orders: 1, //排序:1=推荐排序,2=浏览量,3=发布时间,4=距离排序
show_num: 1, //显示的数量
},
style: {
bgColor: "#FFFFFF",//背景颜色
padding: 10,//内边距
marginBottom: 0,//下边距
},
data: {
R0123456789101: {
gneder: 1,//性别:1=男,2=女
live: 1,//居住情况
travel: 1,//出行情况
pv: 9999,//人气
is_top: 1,//是否置顶:1=未置顶,2=置顶中
nickname: "昵称",//昵称
cover: "../addons/weliam_smartcity/web/resource/images/default.png",//头像
area: "区域",//区域
is_vip: 0,//是否为会员
age: 18,//年龄
},
R0123456789102: {
gneder: 2,//性别:1=男,2=女
live: 1,//居住情况
travel: 1,//出行情况
pv: 9999,//人气
is_top: 1,//是否置顶:1=未置顶,2=置顶中
nickname: "昵称",//昵称
cover: "../addons/weliam_smartcity/web/resource/images/default.png",//头像
area: "区域",//区域
is_vip: 0,//是否为会员
age: 18,//年龄
},
}
},
house_keep:{
nav_class: 4,
group: "house_keep",
name: '家政服务',
params: {
title:'推荐服务者',//标题
show_more: 1,//查看更多
show_title: 1,//标签栏
service_type: 0,//服务类型:0=全部,1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
type: 1, //加载类型:1=手动选择,2=自动加载
show_num: 1, //显示的数量
orders: 1, //排序
jbstatus:1, //角标开关
},
style: {
bgColor: "#FFFFFF",//背景颜色
padding: 0,//内边距
marginBottom: 0,//下边距
},
data: {
R0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
R0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
R0123456789103: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
}
}
}
//组件群 同类型不同风格的组件
modal.groupNav = {
//公告
notice: {
0: {
model: "notice",
title: '风格一',
style: {
'marginbottom': '0',
},
},
1: {
model: "notice2",
title: '风格二',
style: {
'marginbottom': '0',
},
},
2: {
model: "notice3",
title: '风格三',
params: {
title: "公告标题"
},
style: {
'marginbottom': '0',
},
}
},
//标题
title: {
0: {
model: 'title',
title: '风格一',
params: {
'title': '',
'link':"",
'butname':"查看更多",
'url_type':"",
},
style: {
'background': '#ffffff',
'color': '#666666',
'textalign': 'left',
'paddingBottom': '5',
}
},
1: {
model: "title2",
title: '风格二',
params: {
'mainText': "",
'viceText': "",
'link':"",
'butname':"查看更多",
'url_type':"",
},
style: {
'marginBottom': 0,
'bgColor': '#FFFFFF',
'mainColor': "#000000",
'mainAlign': "left",
'viceColor': "#000000",
'viceAlign': "left",
}
},
},
//搜索框
search: {
0: {
model: "search",
title: '风格一',
params: {
'placeholder': '请输入关键字进行搜索',
'search_type': 1,//1=搜索商品,2=搜索招聘信息
},
style: {
'inputbackground': '#ffffff',
'background': '#f1f1f2',
'iconcolor': '#b4b4b4',
'color': '#999999',
'textalign': 'left',
'searchstyle': '',
'marginBottom': 0
}
},
1: {
model: "search2",
title: '风格二',
params: {
'placeholder': '请输入关键字进行搜索',
'search_type': 1,//1=搜索商品,2=搜索招聘信息
},
style: {
'inputbackground': '#ffffff',
'background': '#f1f1f2',
'iconcolor': '#b4b4b4',
'color': '#999999',
'textalign': 'left',
'searchstyle': '',
'marginBottom': 0,
'areaColor': "#666666",
}
},
2: {
model: "search3",
title: '风格三',
params: {
'textcontent': '请输入文字内容',
'search_type': 1,//1=搜索商品,2=搜索招聘信息
},
style: {
'inputbackground': '#d9d9d9',
'background': '#f1f1f1',
'titlecolor': '#000000',
'iconcolor': '#000000',
'marginBottom': 0
}
}
},
//菜单
menu:{
0: {
model: "menu",
title: '风格一',
params: {},
style: {
'navstyle': '',
'background': '#ffffff',
'rownum': '4',
'showtype': '0',
'pagenum': '8',
'marginbottom': "0",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字1',
color: '#666666'
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字2',
color: '#666666'
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字3',
color: '#666666'
},
C0123456789104: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
text: '按钮文字4',
color: '#666666'
}
}
},
1: {
model: "menu2",
title: '风格二',
params: {},
style: {
'navstyle': 'radius',//按钮形状
'background': '#ffffff',//背景颜色
'rownum': '2',//每行数量
'showtype': '0',//显示方式
'pagenum': '4',//每页数量
'marginbottom': "0",//下边距
},
data: {
C0123456789101: {
imgurl: '',
linkurl: '',
text: '标题',
color: '#ffffff',
bgColor: '#FDAD28',
},
C0123456789102: {
imgurl: '',
linkurl: '',
text: '标题',
color: '#ffffff',
bgColor: '#FDAD28',
}
}
},
},
//图片橱窗
picturew: {
0: {
model: "picturew",
title: '风格一',
params: {},
style: {
'marginLeftRight': "5",
'marginTopBottom': "5",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789104: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
}
}
},
1: {
model: "picturew2",
title: '风格二',
params: {},
style: {
'marginLeftRight': "5",
'marginTopBottom': "5",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default_adv.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default_adv.png',
linkurl: '',
},
}
},
2: {
model: "picturew3",
title: '风格三',
params: {},
style: {
'marginLeftRight': "5",
'marginTopBottom': "5",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
}
},
3: {
model: "picturew4",
title: '风格四',
params: {},
style: {
'marginLeftRight': "10",
'marginTopBottom': "10",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default_adv.png',
linkurl: '',
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default_adv.png',
linkurl: '',
},
}
},
4: {
model: "picturew5",
title: '风格五',
params: {},
style: {
'marginLeftRight': "10",
'marginTopBottom': "10",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default_adv.png',
linkurl: '',
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789104: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
}
},
5: {
model: "picturew6",
title: '风格六',
params: {},
style: {
'marginLeftRight': "5",
'marginTopBottom': "5",
'bgColor': "#FFFFFF",
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789103: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
}
},
},
//抢购商品组
rush_goods: {
0: {
model: "rush_goods",
title: '风格一',
plugin: 1,
params: {
type: 1,
orders: 1,
classs: 0,
status: 1,
show_num: 1,
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
1: {
model: "rush_goods2",
title: '风格二',
plugin: 1,
params: {
type: 1,
orders: 1,
classs: 0,
status: 1,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
}
}
},
2: {
model: "rush_goods3",
title: '风格三',
plugin: 1,
params: {
type: 1,
orders: 1,
classs: 0,
status: 1,
show_num: 1,
buy_user: 1,
sort_icon: 1,
goodsLabel: '抢购'
},
style: {
'bgColor': "#FFFFFF",
'margin': 5,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00",
}
}
},
3: {
model: "rush_goods4",
title: '风格四',
plugin: 1, //商品类型
params: {
type: 1,
orders: 1,
classs: 0,
status: 1,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
},
//团购商品组
groupon_goods: {
0: {
model: "groupon_goods",
title: '风格一',
plugin: 2,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
1: {
model: "groupon_goods2",
title: '风格二',
plugin: 2,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00",
buy_num: "0",
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00",
buy_num: "0",
}
}
},
2: {
model: "groupon_goods3",
title: '风格三',
plugin: 2,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
buy_user: 1,
sort_icon: 1,
goodsLabel: '团购'
},
style: {
'bgColor': "#FFFFFF",
'margin': 5,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00",
}
}
},
4: {
model: "groupon_goods4",
title: '风格四',
plugin: 2, //商品类型
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
},
//优惠券商品组
coupon_goods: {
0: {
model: "coupon_goods",
title: '风格一',
plugin: 5,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
user_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
1: {
model: "coupon_goods2",
title: '风格二',
plugin: 5,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
2: {
model: "coupon_goods3",
title: '风格三',
plugin: 5,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
}
},
3: {
model: "coupon_goods4",
title: '风格四',
plugin: 5, //商品类型
params: {
type: 1,
orders: 1,
classs: 0,
status: 1,
show_num: 1,
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
},
//积分商品组
integral_goods: {
0: {
model: "integral_goods",
title: '风格一',
plugin: 8,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 3,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
}
}
},
1: {
model: "integral_goods2",
title: '风格二',
plugin: 8,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 3,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
},
C0123456789102: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
}
}
},
2: {
model: "integral_goods3",
title: '风格三',
plugin: 8,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 3,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
sort_icon: 1,
goodsLabel: '积分'
},
style: {
'bgColor': "#f6f6f6",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
}
}
},
3: {
model: "integral_goods4",
title: '风格四',
plugin: 8,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 3,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
},
C0123456789102: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
},
C0123456789103: {
title: "请选择商品...",
thumb: "../addons/weliam_smartcity/web/resource/images/default.png",
old_price: "00.00",
price: "00.00",
price_text: "1000积分 + 999.00元",
pv:'8888',
stock: '',
}
}
},
},
//拼团商品组
fightgroup_goods: {
0: {
model: "fightgroup_goods",
title: '风格一',
plugin: 3,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
marker_set: 0,//角标是否显示 0=不显示,1=显示
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
'marker_bg': '#FF4444',
'marker_color': '#FFFFFF',
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
1: {
model: "fightgroup_goods2",
title: '风格二',
plugin: 3,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
marker_set: 0,//角标是否显示 0=不显示,1=显示
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
'marker_bg': '#FF4444',
'marker_color': '#FFFFFF',
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
}
}
},
2: {
model: "fightgroup_goods3",
title: '风格三',
plugin: 3, //商品类型
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
3: {
model: "fightgroup_goods4",
title: '风格四',
plugin: 3,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
buy_user: 1,
sort_icon: 1,
goodsLabel: '拼团'
},
style: {
'bgColor': "#FFFFFF",
'margin': 5,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00",
}
}
},
},
//砍价商品
bargain_goods: {
0: {
model: "bargain_goods",
title: '风格一',
plugin: 7,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
marker_set: 0,//角标是否显示 0=不显示,1=显示
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
'marker_bg': '#FF4444',
'marker_color': '#FFFFFF',
},
data: {
C0123456789101: {
oldprice: "00.00",
goods_name: "请选择商品...",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
}
}
},
1: {
model: "bargain_goods2",
title: '风格二',
plugin: 7,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
marker_set: 0,//角标是否显示 0=不显示,1=显示
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
'marker_bg': '#FF4444',
'marker_color': '#FFFFFF',
},
data: {
C0123456789101: {
oldprice: "00.00",
goods_name: "请选择商品...",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
},
C0123456789102: {
oldprice: "00.00",
goods_name: "请选择商品...",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
}
}
},
2: {
model: "bargain_goods3",
title: '风格三',
plugin: 7,
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
buy_user: 1,
sort_icon: 1,
goodsLabel: '砍价'
},
style: {
'bgColor': "#FFFFFF",
'margin': 5,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00",
}
}
},
4: {
model: "bargain_goods4",
title: '风格四',
plugin: 7, //商品类型
params: {
type: 1,
orders: 1,
classs: 0,
show_num: 1,
},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
},
//同城活动组
activity_goods: {
0: {
model: "activity_goods",
title: '风格一',
plugin: 9,
params: {
type: 1,
orders: 1,
classs: 0,
status: 1,
show_num: 1,
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
address: "详细地址...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
catename:'活动分类'
}
}
},
},
//头条
headline: {
0: {
model: "headline",
title: '风格一',
params: {},
style: {
'bgColor': "#FFFFFF",
'marginBottom': "0",
'type':"1",
'show_num':"1",
},
data: {
C0123456789101: {
'title': '头条标题',
'summary': '头条副标题',
'display_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'author': '作者',
'author_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'browse': '999',
'one_name': '分类',
'two_name': '分类'
}
}
},
1: {
model: "headline2",
title: '风格二',
params: {
title: "榜单标题",
detailed: "榜单详细"
},
style: {
'bgColor': "#FFFFFF",
'marginBottom': "0",
'type':"1",
'show_num':"1",
},
data: {
C0123456789101: {
'title': '头条标题',
'summary': '头条副标题',
'display_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'author': '作者',
'author_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'browse': '999',
'one_name': '分类',
'two_name': '分类'
},
C0123456789102: {
'title': '头条标题',
'summary': '头条副标题',
'display_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'author': '作者',
'author_img': '../addons/weliam_smartcity/web/resource/images/default.png',
'browse': '999',
'one_name': '分类',
'two_name': '分类'
}
}
},
},
//图片轮播
banner:{
0:{
model: "banner",
title: '风格一',
params: {
img_width:750,
img_height:560,
},
style: {
'dotstyle': 'round',
'dotalign': 'left',
'side_margin': 0,//0=无边距;1=有边距
'bottom': '0',
},
data: {
C0123456789101: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
}
}
},
1: {
model: "banner2",
title: '风格二',
params: {
title: "标题内容",
text: "副标题内容",
img_width:750,
img_height:560,
},
style: {
'bgColor': '#FFFFFF',
'marginBottom': '0',
'titlecolor':"#000000",
'textcolor':"#666666",
},
data: {
C0123456789101: {
title:"",
text:"",
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
},
C0123456789102: {
title:"",
text:"",
imgurl: '../addons/weliam_smartcity/web/resource/images/default.png',
linkurl: '',
}
}
},
},
//通用商品
public_goods:{
0:{
model: "public_goods",
title: '风格一',
plugin: 0, //商品类型
params: {},
style: {
'bgColor': "#FFFFFF",
'margin': 0,
'padding': 15,
'marginBottom': "0",
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
}
}
},
1:{
model: "public_goods2",
title: '风格二',
plugin: 0, //商品类型
params: {
title:"",
sub_title:"",
button_name:'购买',
},
style: {
'bgColor': "#FFFFFF",
'marginBottom': "0",
'margin': 0,
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png"
},
C0123456789102: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
},
C0123456789103: {
goods_name: "请选择商品...",
oldprice: "00.00",
price: "00.00",
storename: "店铺名称...",
buy_num: "0",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
discount_price:"1.00"
}
}
},
},
//商户组件
shop:{
0:{
model: "shop",
title: '风格一',
params: {
type:1,
rule:3,
show_num:5,
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
score:"5",
storehours:"00:00—23:59&nbsp;营业",
address:"店铺地址信息",
oneType:'一级分类',
twoType:'二级分类',
goods:{
halfcard:{name:'一卡通'},
active:{name:'抢购商品'},
coupon:{name:'卡券信息'},
fightgroup:{name:'拼团商品'},
packages:{name:'大礼包信息'},
groupon:{name:'团购商品'},
}
}
}
},
1:{
model: "shop2",
title: '风格二',
params: {
type:1,
rule:3,
show_num:5,
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
storename: "店铺名称...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
score:"5",
salesVolume:88888,
storehours:"00:00—23:59&nbsp;营业",
}
}
},
2:{
model: "shop3",
title: '风格三',
params: {
type:1,//1=手动选择 2=自动选择
rule:3,//自动规则 1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
show_num:5,//默认显示的数量
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:88888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
},
C0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:88888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
},
C0123456789103: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:88888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
},
}
},
3:{
model: "shop4",
title: '风格四',
params: {
type:1,//1=手动选择 2=自动选择
rule:3,//自动规则 1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
show_num:5,//默认显示的数量
},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:88888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
C0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:88888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
}
},
4:{
model: "shop5",
title: '风格五',
params: {
type:1,//1=手动选择 2=自动选择
rule:3,//自动规则 1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
show_num:5,//默认显示的数量
},
style: {
'marginBottom': "0",
'title': '专区标题',
'top_image': '../addons/weliam_smartcity/web/resource/images/default.png',
'titleColor':'#FFFFFF',//标题颜色
'bgColor': '#FFFFFF',//背景颜色
'link':'',//跳转链接
},
data: {
C0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
C0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
C0123456789103: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
}
},
5:{
model: "shop6",
title: '风格六',
params: {
type:1,//1=手动选择 2=自动选择
rule:3,//自动规则 1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
show_num:5,//默认显示的数量
},
style: {
'marginBottom': "0",
'bgColor': '#f6f6f6',//背景颜色
},
data: {
C0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
C0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
distance: '500m',
storename: "店铺名称...",
score:"5",
salesVolume:888,
storehours:"00:00—23:59&nbsp;营业",
tag:['标签一','标签二','标签三'],
address:'店铺详细地址',
},
}
},
},
//大礼包组件
packages:{
0:{
model: "packages",
title: '风格一',
plugin: 4, //商品类型
params: {
type: 1, //1=手动选择 2=选择分类 3=选择状态
orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
datestatus:1,
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
storename: '商户名称',
name: '礼包名称',
usetimes: '100',//周期内使用次数
surplus: '99',//剩余次数
price: '88888',
}
}
},
// 1:{
// model: "packages2",
// title: '风格二',
// plugin: 4,//商品类型
// params: {
// type: 1, //1=手动选择 2=选择分类 3=选择状态
// orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
// show_num: 1, //显示的商品数量
// },
// style: {
// 'marginBottom': "0",
// },
// data: {
// C0123456789101: {
// datestatus:1,
// logo: "../addons/weliam_smartcity/web/resource/images/default.png",
// storename: '某某商户',
// name: '礼包名称',
// usetimes: '100',//周期内使用次数
// surplus: '99',//剩余次数
// price: '88888',
// limit:'当前礼包的使用限制',
// }
// }
// }
},
//打折卡组件
discount_card:{
0:{
model: "discount_card",
title: '风格一',
plugin: 6, //商品类型
params: {
type: 1, //1=手动选择 2=选择分类 3=选择状态
orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#f6f6f6",
'margin': 15,
'padding': 10,
'marginBottom': "0",
},
data: {
C0123456789101: {
name: '卡券名称',
limit: '使用限制',
discount: '1.0',
storename: '店铺名称',
logo: '../addons/weliam_smartcity/web/resource/images/default.png',
}
}
},
// 1:{
// model: "discount_card2",
// title: '风格二',
// plugin: 6,//商品类型
// params: {
// type: 1, //1=手动选择 2=选择分类 3=选择状态
// orders: 1, //1=综合 2=按销量 3=价格降序 4=价格升序
// show_num: 1, //显示的商品数量
// },
// style: {
// 'marginBottom': "0",
// },
// data: {
// C0123456789101: {
// name: '卡券名称',
// limit: '使用限制',
// discount: '1.0',
// storename: '店铺名称',
// logo: '../addons/weliam_smartcity/web/resource/images/default.png',
// }
// }
// }
},
//选项卡组件
options:{
0:{
model: "options",
title: '首页选项卡',
params: {},
style: {
'marginBottom': "0",
'selectBg': '#ff2d2d',
'background': '#FFFFFF',
'defaultBg': '#000000',
},
data: modal.optionInfo,
},
1:{
model: "options2",
title: '商品选项卡',
params: {
goods_type: modal.getOption2DefautlSelectedPlugin(),
},
style: {
'marginBottom': "0",
'selectBg': '#ff2d2d',
'background': '#FFFFFF',
'defaultBg': '#000000',
},
data: {
C0123456789101: {
'name': '标题',//名称
'sort': '1',//当前按钮顺序
'status': '1',//状态
'orders': 1,//1=创建时间 2=店铺距离 3=推荐设置 4=浏览人气 5=商品销量
gneder: '1',//性别:1=男,2=女
service_type:'1',//类型
},
C0123456789102: {
'name': '标题',//名称
'sort': '2',//当前按钮顺序
'status': '2',//状态
'orders': 1,//1=创建时间 2=店铺距离 3=推荐设置 4=浏览人气 5=商品销量
gneder: '1',//性别:1=男,2=女
service_type:'1',//类型
},
C0123456789103: {
'name': '标题',//名称
'sort': '3',//当前按钮顺序
'status': '3',//状态
'orders': 1,//1=创建时间 2=店铺距离 3=推荐设置 4=浏览人气 5=商品销量
gneder: '1',//性别:1=男,2=女
service_type:'1',//类型
}
},
},
2:{
model: "options3",
title: '商户选项卡',
params: {},
style: {
'marginBottom': "0",
},
data: {
C0123456789101: {
title:'最新',
order:1,//1=时间排序;2=距离排序;3=推荐排序;4=人气排序
},
C0123456789102: {
title:'附近',
order:2,//1=时间排序;2=距离排序;3=推荐排序;4=人气排序
},
C0123456789103: {
title:'推荐',
order:3,//1=时间排序;2=距离排序;3=推荐排序;4=人气排序
},
C0123456789104: {
title:'人气',
order:4,//1=时间排序;2=距离排序;3=推荐排序;4=人气排序
},
}
},
},
//商户入驻组件
shop_join:{
0:{
model: "shop_join",
title: '风格一',
params: {
title:"商户入驻",
button:'我要加入'
},
style: {
'marginBottom': "0",
},
data: {},
},
},
//求职 - 企业
recruit_enterprise:{
0: {
model: "recruit_enterprise",
title: '风格一',
params: {
type: 1, //加载类型:1=手动选择,2=选择行业
orders: 1, //排序:1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
industry_id: 0, //行业id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#FFFFFF",//背景颜色
'padding': 0,//内边距
'marginBottom': 0,//下边距
},
data: {
R0123456789101: {
storename: "请选择企业...",
logo:'../addons/weliam_smartcity/web/resource/images/default.png',
is_authentication: 0,//是否认证:0=未认证,1=已认证
nature:'企业性质',//企业性质
scale:'企业规模',//企业规模
industry:'经营行业',//经营行业
area:'所在区域',//所在区域
release_recruit: 999,//招聘中岗位数量
}
}
},
1: {
model: "recruit_enterprise2",
title: '风格二',
params: {
title: '企业推荐',//块标题
show_more: 1,//是否显示更多 0=不显示,1=显示
type: 1, //加载类型:1=手动选择,2=选择行业
orders: 1, //排序:1 = 创建时间,2 = 店铺距离,3 = 默认设置,4 = 浏览人气
industry_id: 0, //行业id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#FFFFFF",//背景颜色
'padding': 10,//内边距
'marginBottom': 0,//下边距
},
data: {
R0123456789101: {
storename: "请选择企业...",
logo:'../addons/weliam_smartcity/web/resource/images/default.png',
is_authentication: 0,//是否认证:0=未认证,1=已认证
nature:'企业性质',//企业性质
scale:'企业规模',//企业规模
industry:'经营行业',//经营行业
area:'所在区域',//所在区域
release_recruit: 999,//招聘中岗位数量
},
R0123456789102: {
storename: "请选择企业...",
logo:'../addons/weliam_smartcity/web/resource/images/default.png',
is_authentication: 0,//是否认证:0=未认证,1=已认证
nature:'企业性质',//企业性质
scale:'企业规模',//企业规模
industry:'经营行业',//经营行业
area:'所在区域',//所在区域
release_recruit: 999,//招聘中岗位数量
},
R0123456789103: {
storename: "请选择企业...",
logo:'../addons/weliam_smartcity/web/resource/images/default.png',
is_authentication: 0,//是否认证:0=未认证,1=已认证
nature:'企业性质',//企业性质
scale:'企业规模',//企业规模
industry:'经营行业',//经营行业
area:'所在区域',//所在区域
release_recruit: 999,//招聘中岗位数量
},
}
},
},
//流量主
flow:{
0:{
model: "flow",
title: 'Banner广告',
params: {
unit_id:'',
},
style: {},
data: {}
},
1:{
model: "flow2",
title: '激励式广告',
params: {
unit_id:'',
},
style: {},
data: {}
},
2:{
model: "flow3",
title: '插屏广告',
params: {
unit_id:'',
},
style: {},
data: {}
},
3:{
model: "flow4",
title: '视频广告',
params: {
unit_id:'',
},
style: {},
data: {}
},
// 4:{
// model: "flow5",
// title: '视频贴片广告',
// params: {
// unit_id:'',
// },
// style: {},
// data: {}
// },
5:{
model: "flow6",
title: '格子广告',
params: {
unit_id:'',
},
style: {},
data: {}
},
},
//配送商品
citydelivery_goods:{
0: {
model: "citydelivery_goods",
title: '风格一',
plugin: 10,
params: {
title: '推荐',//块标题
show_more: 1,//是否显示更多 0=不显示,1=显示
type: 1, //1=综合 2=销量 3=价格降序 4=价格升序 5=创建时间
orders: 1,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'bgColor': "#FFFFFF",//背景颜色
'padding': 10,//内边距
'marginBottom': 0,//下边距
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789102: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789103: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
}
},
1: {
model: "citydelivery_goods2",
title: '风格二',
plugin: 10,
params: {
type: 1, //1=综合 2=销量 3=价格降序 4=价格升序 5=创建时间
orders: 1,//3=推荐 4=人气
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'top_image': '../addons/weliam_smartcity/web/resource/images/default.png',
'link':'',//跳转链接
'bgColor': "#FFFFFF",//背景颜色
'padding': 0,//内边距
'marginBottom': 0,//下边距
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789102: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789103: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789104: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
}
},
2: {
model: "citydelivery_goods3",
title: '风格三',
plugin: 10,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 1,//1=综合 2=销量 3=价格降序 4=价格升序 5=创建时间
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
'top_image': '../addons/weliam_smartcity/web/resource/images/default.png',
'link':'',//跳转链接
'bgColor': "#FFFFFF",//背景颜色
'padding': 10,//内边距
'marginBottom': 0,//下边距
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
}
}
},
3: {
model: "citydelivery_goods4",
title: '风格四',
plugin: 10,
params: {
type: 1, //1=手动选择 2=选择分类
orders: 1,//1=综合 2=销量 3=价格降序 4=价格升序 5=创建时间
classs: 0, //按商品分类选择时,商品分类id
show_num: 1, //显示的商品数量
},
style: {
top_image: '../addons/weliam_smartcity/web/resource/images/default.png',
link:'',//跳转链接
'bgColor': "#FFFFFF",//背景颜色
'padding': 10,//内边距
'marginBottom': 0,//下边距
},
data: {
C0123456789101: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789102: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
C0123456789103: {
goods_name: "请选择商品...",
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
price: "10.00",
buy_num: 9999
},
}
},
},
//家政服务
house_keep:{
0:{
model: "house_keep",
title: '风格一',
params: {
title:'推荐服务者',//标题
show_more: 1,//查看更多
show_title: 1,//标签栏
service_type: 0,//服务类型:0=全部,1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
type: 1, //加载类型:1=手动选择,2=自动加载
show_num: 1, //显示的数量
orders: 1, //排序
jbstatus:1, //角标开关
},
style: {
bgColor: "#FFFFFF",//背景颜色
padding: 0,//内边距
marginBottom: 0,//下边距
},
data: {
R0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
R0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
R0123456789103: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
}
},
1:{
model: "house_keep2",
title: '风格二',
params: {
service_type: 0,//服务类型:0=全部,1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
type: 1, //加载类型:1=手动选择,2=自动加载
show_num: 1, //显示的数量
orders: 1, //排序
jbstatus:1, //角标开关
},
style: {
bgColor: "#F6F6F6",//背景颜色
margin: 15,//外边距
padding: 10,//内边距
marginBottom: 0,//下边距
},
data: {
R0123456789101: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
R0123456789102: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
R0123456789103: {
logo: "../addons/weliam_smartcity/web/resource/images/default.png",
long_logo: "../addons/weliam_smartcity/web/resource/images/default.png",
name: '名称',
address: '地址信息',
service_type: 1,//类型:1=商户服务商,2=个人服务商,3=客户需求,4=服务项目
tip: '商户服务商',
label: ['分类一','分类二','分类三']
},
}
},
}
}
};
//判断插件 获取选项卡风格二默认选中插件
modal.getOption2DefautlSelectedPlugin = function(){
if(modal.plugins.rush) return 'rush';//抢购
else if(modal.plugins.groupon) return 'groupon';//团购
else if(modal.plugins.wlfightgroup) return 'wlfightgroup';//拼团
else if(modal.plugins.bargain) return 'bargain';//砍价
else if(modal.plugins.wlcoupon) return 'coupon';//卡券
else if(modal.plugins.activity) return 'activity';//活动
else if(modal.plugins.recruit) return 'recruit';//求职招聘
else if(modal.plugins.housekeep) return 'housekeep';//家政服务
};
modal.initItems = function(selected) {
var phone = $("#phone");
if(!modal.items) {
modal.items = {};
return
}
phone.empty();
var page_bgColor = modal.page['background'];
$.each(modal.items, function(itemid, item) {
//存在group 添加group_name group_key
if(item.group) {
item.group_name = item.group;
item.group_key = 0;
}
//id不存在 判断是否为组件群 是获取新的id
if(typeof(item.id) === 'undefined' && typeof(item.group) !== 'undefined'){
if(item.group_key == 0 || (typeof(item.group) !== 'undefined' && typeof(item.group_name) === 'undefined')){
item.id = item.group;
}else{
var id_name = item.group+item.group_key;
item.id = item.group+item.group_key;
}
}
//id存在 进行数据的渲染
if(typeof(item.id) !== 'undefined') {
var newItem = $.extend(true, {}, item);
newItem.itemid = itemid;
newItem['page_bgColor'] = page_bgColor;
//获取组件数量
if(newItem.data && typeof newItem.data != 'object'){
newItem.params.length = Object.keys(newItem.data).length;
}
//console.log(newItem);
var html = tpl("tpl_show_" + newItem.id, newItem);
$("#phone").append(html)
}
});
var btnhtml = $("#edit-del").html();
$("#phone .drag").append(btnhtml);
//点击删除
$("#phone .drag .btn-edit-del .btn-del").unbind('click').click(function(e) {
e.stopPropagation();
var drag = $(this).closest(".drag");
var itemid = drag.data('itemid');
var nodelete = $(this).closest(".drag").hasClass("nodelete");
if(nodelete) {
tip.alert("此元素禁止删除");
return
}
tip.confirm("确定删除吗", function() {
var nearid = modal.getNear(itemid);
delete modal.items[itemid];
modal.initItems();
if(nearid) {
$(document).find(".drag[data-itemid='" + nearid + "']").trigger('mousedown')
} else {
$("#page").trigger('click')
}
})
});
if(selected) {
modal.selectedItem(selected)
}
};
modal.selectedItem = function(itemid) {
if(!itemid) {
return
}
modal.selected = itemid;
if(itemid == 'page') {
$("#page").trigger('click')
} else {
$(".drag[data-itemid='" + itemid + "']").addClass('selected')
}
};
modal.initPage = function(initE) {
if(typeof(initE) === 'undefined') {
initE = true
}
if(!modal.page) {
modal.page = {
type: modal.type,
title: '请输入页面标题',
name: '未命名页面',
background: '#FFFFFF',
diymenu: '-1',
diyadv: '-1',
diylayer: '0',
diygotop: '0',
followbar: '0',
visit: '0',
poster: '0',
bgm_music: '',
share_title:'',
share_description:'',
share_image:'',
visitlevel: {
member: null,
commission: null
},
novisit: {
title: null,
link: null
}
};
if(modal.type == 5) {
modal.page.title = "商品详情"
} else if(modal.type == 8) {
modal.page.title = "兑换中心"
} else if(modal.type == 99) {
modal.page.type = 99;
modal.page.title = '公用模块';
modal.page.name = '未命名模块'
}
}
if(!modal.page.visitlevel) {
modal.page.visitlevel = {
member: null,
commission: null
};
}
if(!modal.page.novisit) {
modal.page.novisit = {};
}
$("#page").text(modal.page.title);
$("#phone").css({
'background-color': modal.page.background
});
$("#phone").find(".drag").removeClass("selected");
if(initE) {
modal.initEditor()
}
};
modal.initSortable = function() {
$("#phone").sortable({
opacity: 0.8,
placeholder: "highlight",
items: '.drag:not(.fixed)',
revert: 100,
scroll: false,
start: function(event, ui) {
var height = ui.item.height();
$(".highlight").css({
"height": height + "px"
});
$(".highlight").html('<div><i class="fa fa-plus"></i> 放置此处</div>');
$(".highlight div").css({
"line-height": height - 4 + "px"
})
},
stop: function(event, ui) {
modal.initEditor()
},
update: function(event, ui) {
modal.sortItems()
}
});
$("#phone").disableSelection();
$(document).on('mousedown', "#phone .drag", function() {
if($(this).hasClass("selected")) {
return
}
modal.selected = $(this).data('itemid');
$("#phone").find(".drag").removeClass("selected");
$(this).addClass("selected");
modal.selected = $(this).data('itemid');
modal.initEditor()
})
};
modal.sortItems = function() {
var newItems = {};
$("#phone .drag").each(function() {
var thisid = $(this).data('itemid');
newItems[thisid] = modal.items[thisid]
});
modal.items = newItems
};
modal.initEditor = function(scroll) {
if(typeof(scroll) === 'undefined') {
scroll = true
}
var itemid = modal.selected;
if(modal.selected) {
if(modal.selected == 'page') {
modal.page['diymenu'] = modal.diymenu;
modal.page['diyadv'] = modal.diyadv;
modal.page['menulist'] = modal.menulist;
modal.page['advlist'] = modal.advlist;
if(modal.type == 99) {
var html = tpl("tpl_edit_page_mod", modal.page)
} else {
var html = tpl("tpl_edit_page", modal.page)
}
$("#diy-editor .inner").html(html)
} else {
var item = $.extend(true, {}, modal.items[modal.selected]);
item.itemid = modal.selected;
item.merch = modal.merch;
item.plugins = modal.plugins;
//建立组件的标题
var name_keys = item.id;
/*********** 版本兼容操作 进行不同版本中差异数据的兼容操作 **********************************************/
//大礼包商品组件的信息兼容
if(name_keys.indexOf("packages") >= 0 ){
if(!item.params.orders){
item.params.orders = 1;
}
}
/*********** 兼容操作完成 ***************************************************************************/
if(item.group_name) {
var name_keys = item.group_name;
}
var navName = modal.navs[name_keys]['name'];
$("#adv_title").html(navName + "编辑");
//信息渲染
if(item.group_name) {
//组件群 显示配置栏点击按钮
$("#page_title").show();
//存在组件群 进行组件群建立步骤,不在进行单组件建立步骤
var groupInfo = $.extend(true, {}, modal.groupNav[item.group_name]);
if(!groupInfo) {
return
}
var html = '';
$.each(groupInfo, function(k, v) {
//判断模板是否存在
var itemTplShow = $("#tpl_show_" + v['model']).length; //模板信息
if(itemTplShow == 0) {
tip.msgbox.err("添加失败!模板错误,请刷新页面重试");
return
}
//建立单个组件
var navInfo = $.extend(true, {}, v);
navInfo.merch = modal.merch;
navInfo.plugins = modal.plugins;
navInfo.id = item.group_name;
navInfo.group_name = item.group_name;
navInfo.group_key = k;
//建立当个主键的标题
html += tpl("tpl_public_title", {
title: navInfo['title']
});
html += tpl("tpl_show_" + navInfo['model'], navInfo);
});
$("#diy-editor [page_id='nav_type']").html(html)
} else {
$("#page_title").hide();
$("#diy-editor .inner").html('')
}
//判断是否需要渲染商品分类
var cateName = item['id'].substring(0, item['id'].indexOf('_'));
if(item['group_name'] == 'shop'){
cateName = 'store';
}
if(modal.goodCate[cateName]) item['goodCate'] = modal.goodCate[cateName];
//console.log(item['goodCate']);
//判断是否渲染社群列表
if(item.id == 'community'){
item['community_list'] = modal.community_list;
}
//判断是否为轮播图渲染
if(item.id == 'banner' || item.group_name == 'banner'){
if(!item.params.img_width) item.params.img_width = 750;
if(!item.params.img_height) item.params.img_height = 560;
}
var html = tpl("tpl_edit_" + item.id, item);
$("#diy-editor .inner").html(html)
$("#nav_config").click();
}
$("#diy-editor").attr("data-editid", modal.selected).show();
}
var sliderlength = $("#diy-editor .slider").length;
if(sliderlength > 0) {
$("#diy-editor .slider").each(function() {
var decimal = $(this).data('decimal');
var multiply = $(this).data('multiply');
var defaultValue = $(this).data("value");
if(decimal) {
defaultValue = defaultValue * decimal
}
$(this).slider({
slide: function(event, ui) {
var sliderValue = ui.value;
if(decimal) {
sliderValue = sliderValue / decimal
}
$(this).siblings(".input").val(sliderValue).trigger("propertychange");
$(this).siblings(".count").find("span").text(sliderValue)
},
value: defaultValue,
min: $(this).data("min"),
max: $(this).data("max")
})
})
}
var goodsSelector = $("#diy-editor .goods-selector").length;
if(goodsSelector > 0) {
var _this = $("#diy-editor .goods-selector");
var gType = _this.data('goodstype') == 1 ? 'creditshop' : '';
var gUrl = modal.merch ? biz.url('goods/goods_selector', null, modal.merch) : '';
_this.unbind('click').click(function() {
modal.childid = $(this).closest('.item').data('id');
gSelector.open('callbackGoods', gType, modal.merch, false, gUrl);
});
/*
var url = biz.url('goods/query', null, modal.merch);
if (_this.data('goodstype') == 1) {
url = biz.url('creditshop/goods/querygoods', null, modal.merch)
}
_this.attr({'id': 'goods_selector', 'data-url': url, 'data-callback': 'callbackGoods'});
_this.unbind('click').click(function () {
biz.selector.select({name: 'goods', autosearch: 1, url: url});
modal.childid = $(this).closest('.item').data('id')
})*/
}
var categorySelector = $("#diy-editor .category-selector").length;
if(categorySelector > 0) {
var _this = $("#diy-editor .category-selector");
var url = biz.url('goods/category/query', null, modal.merch);
if(_this.data('goodstype') == 1) {
url = biz.url('creditshop/category/query', null, modal.merch)
}
_this.attr({
'id': 'category_selector',
'data-url': url,
'data-callback': 'callbackCategory'
});
_this.unbind('click').click(function() {
biz.selector.select({
name: 'category'
})
})
}
var groupSelector = $("#diy-editor .group-selector").length;
if(groupSelector > 0) {
var _this = $("#diy-editor .group-selector");
_this.attr({
'id': 'group_selector',
'data-url': biz.url('goods/group/query', null, modal.merch),
'data-callback': 'callbackGroup'
});
_this.unbind('click').click(function() {
biz.selector.select({
name: 'group'
})
})
}
var merchSelector = $("#diy-editor .merch-selector").length;
if(merchSelector) {
var _this = $("#diy-editor .merch-selector");
var url = biz.url('merch/user/query', null, modal.merch);
_this.attr({
'id': 'merch_selector',
'data-url': url,
'data-callback': 'callbackMerch'
});
_this.unbind('click').click(function() {
biz.selector.select({
name: 'merch'
});
modal.childid = $(this).closest('.item').data('id')
})
}
var merchCategorySelector = $("#diy-editor .merch-category-selector").length;
if(merchCategorySelector) {
var _this = $("#diy-editor .merch-category-selector");
var url = biz.url('merch/category/query', null, modal.merch);
_this.attr({
'id': 'category_selector',
'data-url': url,
'data-callback': 'callbackMerchCategory'
});
_this.unbind('click').click(function() {
biz.selector.select({
name: 'category'
})
})
}
var merchGroupSelector = $("#diy-editor .merch-group-selector").length;
if(merchGroupSelector) {
var _this = $("#diy-editor .merch-group-selector");
_this.attr({
'id': 'group_selector',
'data-url': biz.url('merch/group/query', null, modal.merch),
'data-callback': 'callbackMerchGroup'
});
_this.unbind('click').click(function() {
biz.selector.select({
name: 'group'
})
})
}
var couponSelector = $("#diy-editor .coupon-selector").length;
if(couponSelector) {
var _this = $("#diy-editor .coupon-selector");
_this.attr({
'id': 'coupon_selector',
'data-url': biz.url('sale/coupon/query', {
diy: 1
}, modal.merch),
'data-callback': 'callbackCoupon'
});
_this.unbind('click').click(function() {
biz.selector.select({
name: 'coupon'
});
modal.childid = $(this).closest('.item').data('id')
})
}
var audioPlayer = $("#diy-editor .audio-player").length;
if(audioPlayer) {
$("#diy-editor .audio-player").click(function() {
var _this = $(this);
var audio = _this.next('audio')[0];
var src = _this.next('audio').attr('src');
if(audio && src) {
if(audio.paused) {
audio.play();
_this.find('.fa').removeClass("fa-play").addClass("fa-stop");
var timer = setInterval(function() {
if(audio.currentTime >= audio.duration) {
audio.pause();
_this.find('.fa').removeClass("fa-stop").addClass("fa-play");
clearInterval(timer)
}
}, 1000)
} else {
audio.currentTime = 0;
audio.pause();
_this.find('.fa').removeClass("fa-stop").addClass("fa-play")
}
} else {
tip.msgbox.err("请先选择音频!")
}
})
}
var childitems = $("#diy-editor .form-items").length;
if(childitems > 0) {
modal.initSortableChild();
$("#addChild").unbind('click').click(function() {
var itemid = modal.selected;
var type = modal.items[itemid].id;
//存在group_name 是组件群的组件
if(modal.items[itemid].group_name) {
var temp = modal.groupNav[modal.items[itemid].group_name][modal.items[itemid].group_key].data;
} else {
var temp = modal.navs[type].data;
}
var max = $(this).closest(".form-items").data('max');
if(max) {
var length = modal.length(modal.items[itemid].data);
if(length >= max) {
tip.msgbox.err("最大添加 " + max + " 个!");
return
}
}
var newChild = {};
var index = 0;
$.each(temp, function(i, t) {
if(index == 0) {
newChild = t;
index++
}
});
if(newChild) {
var childName = modal.getId("M", 0);
if(typeof(modal.items[itemid].data) === 'undefined') {
modal.items[itemid].data = {}
}
newChild = $.extend(true, {}, newChild);
modal.items[itemid].data[childName] = newChild
}
modal.initItems(itemid);
modal.initEditor(false)
});
$("#diy-editor .form-items .item .btn-del").unbind('click').click(function() {
var childid = $(this).closest(".item").data('id');
var itemid = modal.selected;
var min = $(this).closest(".form-items").data("min");
if(min) {
var length = modal.length(modal.items[itemid].data);
if(length <= min) {
tip.msgbox.err("至少保留 " + min + " 个!");
return
}
}
tip.confirm("确定删除吗", function() {
delete modal.items[itemid].data[childid];
modal.initItems(itemid);
modal.initEditor(false)
})
})
}
var richtext = $("#diy-editor .form-richtext").length;
if(richtext > 0) {
var ueditoroption = {
'autoClearinitialContent': false,
'toolbars': [
['fullscreen', 'source', 'preview', '|', 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'backcolor', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'insertorderedlist', 'insertunorderedlist', 'blockquote', 'emotion', 'removeformat', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight', 'indent', 'paragraph', 'fontsize', '|', 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|', 'anchor', 'map', 'print', 'drafts', '|', 'link']
],
'elementPathEnabled': false,
'initialFrameHeight': 300,
'focus': false,
'maximumWords': 99999
};
var opts = {
type: 'image',
direct: false,
multiple: true,
tabs: {
'upload': 'active',
'browser': '',
'crawler': ''
},
path: '',
dest_dir: '',
global: false,
thumb: false,
width: 0
};
UE.registerUI('myinsertimage', function(editor, uiName) {
editor.registerCommand(uiName, {
execCommand: function() {
require(['fileUploader'], function(uploader) {
uploader.show(function(imgs) {
if(imgs.length == 0) {
return
} else if(imgs.length == 1) {
editor.execCommand('insertimage', {
'src': imgs[0]['url'],
'_src': imgs[0]['url'],
'width': '100%',
'alt': imgs[0].filename
})
} else {
var imglist = [];
for(i in imgs) {
imglist.push({
'src': imgs[i]['url'],
'_src': imgs[i]['url'],
'width': '100%',
'alt': imgs[i].filename
})
}
editor.execCommand('insertimage', imglist)
}
}, opts)
})
}
});
var btn = new UE.ui.Button({
name: '插入图片',
title: '插入图片',
cssRules: 'background-position: -726px -77px',
onclick: function() {
let input_id = "#cimg-"+uiName,
src_id = "#pimg-"+uiName,
html = '<input id="cimg-'+uiName+'" style="display: none">' +
'<img src="" id="pimg-'+uiName+'" data-toggle="selectAttachment" data-input="#cimg-'+uiName+'" data-img="#pimg-'+uiName+'" style="display: none">';
$(input_id).remove();
$(src_id).remove();
//模拟图片上传操作
$("body").append(html);
$(src_id).click();
//图片选取成功
$(document).off("change",input_id).on('change',input_id,function () {
//参数获取
let link = $(src_id).attr("src");
let imgHtml = '<img src="'+link+'">';
editor.execCommand('insertimage', {
'src': link,
'_src': link,
'width': '100%',
'alt': link
})
//删除内容
$(input_id).remove();
$(src_id).remove();
});
//editor.execCommand(uiName)
}
});
editor.addListener('selectionchange', function() {
var state = editor.queryCommandState(uiName);
if(state == -1) {
btn.setDisabled(true);
btn.setChecked(false)
} else {
btn.setDisabled(false);
btn.setChecked(state)
}
});
return btn
}, 48);
UE.registerUI('myinsertvideo', function(editor, uiName) {
editor.registerCommand(uiName, {
execCommand: function() {
require(['fileUploader'], function(uploader) {
uploader.show(function(video) {
if(!video) {
return
} else {
var videoType = video.isRemote ? 'iframe' : 'video';
editor.execCommand('insertvideo', {
'url': video.url,
'width': 300,
'height': 200
}, videoType)
}
}, {
fileSizeLimit: 5120000,
type: 'video',
allowUploadVideo: true,
netWorkVideo: true
})
})
}
});
var btn = new UE.ui.Button({
name: '插入视频',
title: '插入视频',
cssRules: 'background-position: -320px -20px',
onclick: function() {
//editor.execCommand(uiName)
let input_id = "#cimg-"+uiName,
src_id = "#pimg-"+uiName,
html = '<input id="cimg-'+uiName+'" style="display: none">' +
'<video src="" id="pimg-'+uiName+'" data-toggle="selectVideo" data-input="#cimg-'+uiName+'" data-img="#pimg-'+uiName+'" style="display: none"></video>';
$(input_id).remove();
$(src_id).remove();
//模拟视频上传操作
$("body").append(html);
$(src_id).click();
//视频选取成功
$(document).off("change",input_id).on('change',input_id,function () {
console.log("成功");
//参数获取
link = $(src_id).attr("src");
editor.execCommand('insertvideo', {
'url': link,
'width': 300,
'height': 200,
}, 'video');
//删除内容
$(input_id).remove();
$(src_id).remove();
});
}
});
editor.addListener('selectionchange', function() {
var state = editor.queryCommandState(uiName);
if(state == -1) {
btn.setDisabled(true);
btn.setChecked(false)
} else {
btn.setDisabled(false);
btn.setChecked(state)
}
});
return btn
}, 20);
UE.registerUI('mylink', function(editor, uiName) {
var btn = new UE.ui.Button({
name: 'selectUrl',
title: '系统链接',
cssRules: 'background-position: -622px 80px;',
onclick: function() {
$("#" + this.id).attr({
"data-toggle": "selectUrl",
"data-callback": "selectUrlCallback"
})
}
});
editor.addListener('selectionchange', function() {
var state = editor.queryCommandState(uiName);
if(state == -1) {
btn.setDisabled(true);
btn.setChecked(false)
} else {
btn.setDisabled(false);
btn.setChecked(state)
}
});
return btn
});
if(typeof(UE) != 'undefined') {
UE.delEditor('rich')
}
var ue = UE.getEditor('rich', ueditoroption);
ue.ready(function() {
var thisitem = modal.items[itemid];
var richContent = thisitem.params.content;
richContent = $.base64.decode(richContent);
ue.setContent(richContent);
var $textarea = $('#rich').parent().find('iframe').contents();
var fn = function(){
$('#rich').parent().find('iframe').contents().find('body').children("#baidu_pastebin").css({
"position":"inherit",
"width":"100%",
"height":"auto",
"left":"0px",
});
newContent = ue.getContent();
newContent = $.base64.encode(newContent);
$("#richtext").html(newContent).trigger('change');
}
//第一种触发方式
if (document.all) {
$textarea.get(0).attachEvent('onpropertychange',function(e) {
fn();
});
}else{
$textarea.bind('input',fn);
}
//第二种触发方式
ue.addListener('contentChange',fn);
});
}
$("#diy-editor").find(".diy-bind").bind('input propertychange change', function() {
var _this = $(this);
var bind = _this.data("bind");
var bindchild = _this.data('bind-child');
var bindparent = _this.data('bind-parent');
var initEditor = _this.data('bind-init');
var type = _this.attr('type');
var sort = _this.data("bind-sort");
var value = '';
var tag = this.tagName;
if(!itemid) {
modal.selectedItem('page')
}
if(tag == 'INPUT') {
if(type == 'checkbox') {
var notpush = _this.data('bind-nopush');
if(notpush != 'yes'){
value = [];
_this.closest('.form-group').find('input[type=checkbox]').each(function() {
var checked = this.checked;
var valname = $(this).val();
if(checked) {
value.push(valname)
}
})
}else{
value = _this.val();
}
} else {
var _type = _this.attr("data-types");
var placeholder = _this.data('placeholder');
value = _this.val();
value = value == '' ? placeholder : value;
}
} else if(tag == 'SELECT') {
value = _this.find('option:selected').val()
} else if(tag == 'TEXTAREA') {
value = _this.val()
}
value = $.trim(value);
if(itemid == 'page') {
if(bindchild) {
if(!modal.page[bindchild]) {
modal.page[bindchild] = {}
}
modal.page[bindchild][bind] = value
} else {
modal.page[bind] = value
}
modal.initPage(false);
if(bind == 'keyword') {
$.post(biz.url('diypage/page/keyword'), {
id: modal.id,
keyword: value
}, function(r) {
if(r.status == 0) {
_this.closest('.form-group').addClass('has-error');
modal.keyworderr = true
} else {
_this.closest('.form-group').removeClass('has-error');
modal.keyworderr = false
}
}, 'json')
}
} else {
if(bindchild) {
if(modal.items[itemid][bindparent]) {
if(modal.items[itemid][bindparent][bindchild]) {
if(bindparent) {
modal.items[itemid][bindparent][bindchild][bind] = value
if(_type) {modal.items[itemid][bindparent][bindchild]['url_type'] = _type}
} else {
modal.items[itemid][bindchild][bind] = value
}
} else {
modal.items[itemid][bindparent][bind] = value
}
} else {
modal.items[itemid][bindchild][bind] = value
if(_type) {modal.items[itemid][bindchild]['url_type'] = _type}
}
} else {
modal.items[itemid][bind] = value
}
modal.initItems(itemid)
if(type == 'radio') {
modal.initEditor(itemid);
}
//其他操作 根据组件的不同操作也不同
var idName = modal.items[itemid]['id'];
switch (idName) {
case 'community':
var params = modal.items[itemid]['params'];
if(params['community_id'] > 0){
var comInfo = common.ajaxPost('diy/diy/getCommunityInfo', {id:params['community_id']});
params['imgUrl'] = comInfo['communimg'];
params['introduce'] = comInfo['commundesc'];
params['name'] = comInfo['communname'];
params['qrcodeUrl'] = comInfo['communqrcode'];
}else{
params = {
community_id: 0,
title: "入群",
name: "请输入群名称",
introduce: "请输入群的简介",
imgUrl: "../addons/weliam_smartcity/web/resource/images/default.png",
qrcodeUrl: "../addons/weliam_smartcity/web/resource/images/default.png"
};
}
modal.items[itemid]['params'] = params;
break;//社群操作
}
}
if(initEditor) {
modal.initEditor(false)
}
if(sort){
var sortPosition = '#phone #sort_'+itemid;//结果建立处
var className = '#phone .sort_'+itemid;//获取的需要排序的DOM元素
var div = $(className).toArray().sort(function(a,b){
return parseInt($(a).attr("sort")) - parseInt($(b).attr("sort"))
});
$(div).appendTo(sortPosition)
}
})
};
modal.initSortableChild = function() {
$("#diy-editor .inner").sortable({
opacity: 0.8,
placeholder: "highlight",
items: '.item',
revert: 100,
scroll: false,
cancel: '.goods-selector,input,select,.btn,btn-del',
start: function(event, ui) {
var height = ui.item.height();
$(".highlight").css({
"height": height + 22 + "px"
});
$(".highlight").html('<div><i class="fa fa-plus"></i> 放置此处</div>');
$(".highlight div").css({
"line-height": height + 16 + "px"
})
},
update: function(event, ui) {
modal.sortChildItems()
}
})
};
modal.initMod = function(item) {
$.ajax(biz.url('diypage/page/mod/query', null, modal.merch), {
type: "get",
dataType: "html",
cache: false
}).done(function(html) {
modModal = $('<div class="modal fade" id="modModal"></div>');
$(document.body).append(modal), modModal.modal('show');
modModal.append2(html, function() {
$(document).off("click", '#modModal nav').on("click", '#modModal nav', function() {
var modid = $(this).data('id');
var modname = $(this).data('name');
modModal.find(".close").click();
var itemid = modal.getId("M", 0);
item.params.modid = modid;
item.params.modname = modname;
if(modal.selected && modal.selected != 'page') {
var newItems = {};
$.each(modal.items, function(id, eachitem) {
newItems[id] = eachitem;
if(id == modal.selected) {
newItems[itemid] = item
}
});
modal.items = newItems
} else {
modal.items[itemid] = item
}
modal.initItems();
$(".drag[data-itemid='" + itemid + "']").trigger('mousedown').trigger('click');
modal.selected = itemid
})
})
})
};
modal.initTemp = function() {
var itemslength = 0;
$.each(modal.items, function(index) {
itemslength++;
return false
});
if(!itemslength) {
tip.msgbox.err("您还没有添加任何元素,不能保存为模板!");
return
}
if(modal.type == 99) {
tip.msgbox.err("页面类型为公用模块,不能保存为模板!");
return
}
$("#saveTempModal").modal();
//点击保存按钮
$("#saveTemp", "#saveTempModal").unbind('click').click(function() {
//确定保存后 按钮保存按钮再次点击无效
$(".btn-save").data('status', 1).text("保存中...");
$("#saveTemp").data('status', 1).text("保存中...");
//获取模板名称
var tempname = $.trim($("#saveTempModal").find("#saveTempName").val());
//获取分类id
var tempcate = $.trim($("#saveTempModal").find("#saveTempCate option:selected").val());
delete modal.page['advlist'];
delete modal.page['menulist'];
delete modal.page['diygotop'];
delete modal.page['diylayer'];
delete modal.page['followbar'];
delete modal.page['novisit'];
delete modal.page['visit'];
delete modal.page['visitlevel'];
var tempdata = {
page: modal.page,
items: modal.items
};
if(!tempname) {
tip.msgbox.err("请填写模板名称!");
$("#saveTempModal").find("#saveTempName").focus();
return false;
}
//获取提交地址
var posturl = biz.url("diy/diy/savetemp", null, modal.merch)
//进行下一步操作
setTimeout(function(){
modal.createPreviewPage(posturl, {
type: modal.type, //页面类型
cate: tempcate, //模板分类id
name: tempname, //模板名称
data: tempdata //模板配置信息
});
},500)
})
};
modal.initTpl = function() {
tpl.helper("imgsrc", function(src) {
if(typeof src != 'string') {
return ''
}
if(src.indexOf('http://') == 0 || src.indexOf('https://') == 0 || src.indexOf('../addons/weliam_smartcity/') == 0) {
return src
} else if(src.indexOf('images/') == 0 || src.indexOf('audios/') == 0) {
return modal.attachurl + src;
}
});
tpl.helper("decode", function(content) {
return $.base64.decode(content)
});
tpl.helper("count", function(data) {
return modal.length(data)
});
tpl.helper("toArray", function(data) {
var oldArray = $.makeArray(data);
var newArray = [];
$.each(data, function(itemid, item) {
newArray.push(item)
});
return newArray
});
tpl.helper("strexists", function(str, tag) {
if(!str || !tag) {
return false
}
if(str.indexOf(tag) != -1) {
return true
}
return false
});
tpl.helper("inArray", function(str, tag) {
if(!str || !tag) {
return false
}
if(typeof(str) == 'string') {
var arr = str.split(",");
if($.inArray(tag, arr) > -1) {
return true;
}
}
return false
});
tpl.helper("define", function(str) {
var str
})
};
modal.initGotop = function() {
$(window).bind('scroll resize', function() {
var scrolltop = $(window).scrollTop();
if(scrolltop > 300) {
$("#gotop").show()
} else {
$("#gotop").hide()
}
$("#gotop").unbind('click').click(function() {
$("html,body").animate({
scrollTop: 0
}, 300);
})
})
};
modal.getNear = function(itemid) {
var newarr = [];
var index = 0;
var prev = 0;
var next = 0;
$.each(modal.items, function(id, obj) {
newarr[index] = id;
if(id == itemid) {
prev = index - 1;
next = index + 1
}
index++
});
var pervid = newarr[prev];
var nextid = newarr[next];
if(nextid) {
return nextid
}
if(pervid) {
return pervid
}
return false
};
modal.getItemNum = function(id) {
var itemNum = 0;
$.each(modal.items, function(itemid, eachitem) {
if(eachitem.id == id || eachitem.group_name == id) {
itemNum++
}
});
return itemNum
};
modal.sortChildItems = function() {
var newChild = {};
var itemid = modal.selected;
$("#diy-editor .form-items .item").each(function() {
var thisid = $(this).data('id');
newChild[thisid] = modal.items[itemid].data[thisid]
});
modal.items[itemid].data = newChild;
modal.initItems(itemid)
};
modal.length = function(json) {
if(typeof(json) === 'undefined') {
return 0
}
var jsonlen = 0;
for(var item in json) {
jsonlen++
}
return jsonlen
};
modal.callbackGoods = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
if(!data.minprice) {
data.minprice = data.marketprice;
}
var itemid = modal.selected;
var childid = modal.childid;
modal.items[itemid].data[childid] = {
'title': data.title,
'thumb': data.thumb,
'price': data.minprice,
'gid': data.id,
'bargain': data.bargain,
'credit': data.credit
};
modal.initItems(itemid);
modal.initEditor(false);
modal.childid = null
};
modal.callbackCategory = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
var itemid = modal.selected;
modal.items[itemid].params.catename = data.name;
modal.items[itemid].params.cateid = data.id;
modal.items[itemid].params.groupname = '';
modal.items[itemid].params.groupid = '';
modal.initItems(itemid);
modal.initEditor(false)
};
modal.callbackGroup = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
var itemid = modal.selected;
modal.items[itemid].params.groupname = data.name;
modal.items[itemid].params.groupid = data.id;
modal.items[itemid].params.catename = '';
modal.items[itemid].params.cateid = '';
modal.initItems(itemid);
modal.initEditor()
};
modal.callbackMerch = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
var itemid = modal.selected;
var childid = modal.childid;
modal.items[itemid].data[childid] = {
'name': data.merchname,
'thumb': data.logo,
'merchid': data.id,
'desc': data.desc
};
modal.initItems(itemid);
modal.initEditor(false);
modal.childid = null
};
modal.callbackMerchCategory = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
var itemid = modal.selected;
modal.items[itemid].params.catename = data.catename;
modal.items[itemid].params.cateid = data.id;
modal.items[itemid].params.groupname = '';
modal.items[itemid].params.groupid = '';
modal.initItems(itemid);
modal.initEditor(false)
}
modal.callbackMerchGroup = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
var itemid = modal.selected;
modal.items[itemid].params.groupname = data.groupname;
modal.items[itemid].params.groupid = data.id;
modal.items[itemid].params.catename = '';
modal.items[itemid].params.cateid = '';
modal.initItems(itemid);
modal.initEditor()
};
modal.callbackCoupon = function(data) {
if(!data) {
tip.msgbox.err("回调数据错误,请重试!");
return
}
var itemid = modal.selected;
var childid = modal.childid;
modal.items[itemid].data[childid].price = data.values;
modal.items[itemid].data[childid].desc = data.uselimit;
modal.items[itemid].data[childid].couponid = data.id;
modal.items[itemid].data[childid].name = data.couponname;
modal.initItems(itemid);
modal.initEditor(false);
modal.childid = null
};
modal.save = function(preview) {
if(typeof(preview) === 'undefined') {
preview = false
}
//判断是否有组件
if(Object.keys(modal.items).length <= 0) {
tip.msgbox.err("您还没有添加任何元素,不能进行保存!");
return false;
}
modal.data = {};
//判断点击的按钮类型
delete modal.page['advlist'];
delete modal.page['menulist'];
delete modal.page['diygotop'];
delete modal.page['diylayer'];
delete modal.page['followbar'];
delete modal.page['novisit'];
delete modal.page['visit'];
delete modal.page['visitlevel'];
modal.data = {
page: modal.page,
items: modal.items
};
if(!modal.page.title) {
tip.msgbox.err("页面标题是必填项");
$("#page").trigger("click");
return
}
$(".diypage-save-page").data('status', 1).html('<i class="icon iconfont icon-upload"></i>保存中...');
var posturl = biz.url("diy/diy/savePage", null, modal.merch)
//提交页面配置信息
$.post(posturl, {
id: modal.id,
data: $.base64.encode(JSON.stringify(modal.data))
}, function(res) {
if(preview) {
$("[data-type='savetemp']").data('status', 0).html('<i class="icon iconfont icon-youji1"></i>保存模板');
$("[data-type='save']").data('status', 0).html('<i class="icon iconfont icon-upload"></i>保存页面');
$("[data-type='preview']").data('status', 0).html('<i class="icon iconfont icon-attention"></i>预览');
$("#saveTemp").data('status', 0).text("保存");
modal.preview(res.data['id']);
} else {
tip.alert("操作成功",function () {
window.location.href = res['data']['url'];
});
}
}, 'json')
};
//页面内容预览
modal.preview = function(id) {
var url = biz.url("diy/diy/previewPage")
$.ajax(url, {
type: "get",
data: {
id: id
},
dataType: "html",
cache: false
}).done(function(html) {
html = $('<div class="modal fade" id="preview">' + html + '</div>');
html.modal('show');
})
}
modal.length = function(json) {
if(typeof(json) === 'undefined') {
return 0
}
var jsonlen = 0;
for(var item in json) {
jsonlen++
}
return jsonlen
};
//提交前进行截图
modal.createPreviewPage = function(posturl, data) {
var pageImg = ''; //当前页面形成的图片信息(base64格式)
//生成预览图片
var width = $(".phone-body").width();
var height = width * 16 / 9; //截图的高度,决定图片的高,截图的高,处理图片的界限
var cloneDom = $(".phone-body").clone(true);
cloneDom.removeAttr("id");
cloneDom.attr("id", "temporary_content");
cloneDom.css({
"position": "fixed",
"top": "0px",
"z-index": "999",
"height": height,
"width": width
});
$(".phone-body").append(cloneDom);
//图片处理
var img_url = {}; //要处理的图片数组
var base64 = ''; //已处理的图片信息(base64格式)
//删除多余的内容
var divTop = $("#temporary_content").offset().top;
$("#temporary_content .drag").each(function() {
var distance = $(this).offset().top;
if((parseInt(distance) - parseInt(divTop)) > height) {
$(this).remove();
}
});
//获取截图中的图片
$("#temporary_content img").each(function() {
var src = $(this).attr("src");
if(src.indexOf(';base64,') <= -1) {
img_url[Object.keys(img_url).length] = src;
}
});
//提交图片地址获取经过处理的图片base64码
if(Object.keys(img_url).length > 0) {
var url = biz.url("diy/diy/getImgInfo")
$.ajax({
url: url,
data: {
img_url: img_url
},
async: false,
dataType: "json",
success: function(res) {
base64 = res.data;
}
});
}
//循环替换img的内容,替换url不是base64编码的图片地址
if(base64) {
$("#temporary_content img").each(function(k) {
var src = $(this).attr("src");
if(src.indexOf(';base64,') <= -1) {
$(this).attr("src", base64[k]);
}
});
}
html2canvas(cloneDom, {
allowTaint: true,
taintTest: false,
onrendered: function(canvas) {
//获取截图 并且提交后台换取图片链接
pageImg = canvas.toDataURL(); //第一张图的base64格式
$("#temporary_content").remove();
var canvasImgUrl = biz.url("diy/diy/saveTempImage", null, modal.merch)
$.post(canvasImgUrl, {'pageImg':pageImg}, function(res) {
if(res.errno == 1) {
//预览图获取成功 提交内容模板信息进行储存
data['pageImg'] = res.data.img_name;
$.post(posturl, data, function(res) {
if(res.errno == 1) {
tip.msgbox.suc("操作成功");
$("[data-type='savetemp']").data('status', 0).text("保存模板");
$("[data-type='save']").data('status', 0).text("保存页面");
$("[data-type='preview']").data('status', 0).text("页面预览");
$("#saveTemp").data('status', 0).text("保存");
} else {
tip.msgbox.err("操作失败");
}
$("#saveTempModal .close").trigger('click');
}, 'json')
} else {
tip.msgbox.err("图片保存失败");
}
}, 'json')
}
});
};
//魔方的建立
modal.magicCube = function() {
//在手机上建立一个div 并且选中
var itemid = modal.getId("M", 0);
//隐藏配置栏点击按钮
$("#page_title").hide();
//修改对象的属性
var w = 372; //获取div的宽 固定高度,否则覆盖检测会出错
var min_w = w / 4; //魔方为16宫格,这里获取每个小格子的宽高,不能为小数 否则覆盖检测会出错
magic_cube = {
id: "magic_cube",
name: '图片魔方',
style: {
'width': w,
'min_w': min_w, //减去边框的像素
'padding':0,
'bgColor':"FFFFFF"
},
data: {}
}
var item = $.extend(true, {}, magic_cube);
item['itemid'] = itemid;
//储存信息
var selected = $("#phone .selected").data("itemid");
if(Object.keys(modal.items).length > 0 && selected){
var itemCode = $.extend(true, {}, modal.items);
$.each(itemCode,function (id,val) {
modal.items[id] = val;
if(id == selected){
modal.items[itemid] = magic_cube;
}
});
}else{
modal.items[itemid] = magic_cube;
}
//添加时进行判断 保证选项卡组件在最后面
var optionItems = {},newModalItems = {};
$.each(modal.items, function(key, val) {
if(val.id == 'options' || val.group_name == 'options' ){
optionItems = val;
}else{
newModalItems[key]= $.extend(true, {}, val);
}
});
modal.items = $.extend(true, {}, newModalItems);
if(optionItems.id == 'options' || optionItems.group_name == 'options'){
modal.items['M9999999999999'] = $.extend(true, {}, optionItems);
}
//更新配置信息
modal.selected = itemid;
modal.initItems(itemid);
modal.initEditor(itemid);
};
//魔方的操作方法
modal.cubeFun = function() {
//开始选择魔方
var w = 372; //obj.width();//获取div的宽 固定高度,否则覆盖检测会出错
var min_w = w / 4; //魔方为16宫格,这里获取每个小格子的宽高
cubeBlockW = min_w;
var indexF = '';
var indexHS = '';
var indexS = '';
var posTop = '';
var posLeft = '';
var creatWidth = '';
var creatHeight = '';
var creatCan = '';
var memoryposTop = '';
var memoryposLeft = '';
var hover_memoryposTop = '';
var hover_memoryposLeft = '';
var hover_mTop = '';
var hover_mLeft = '';
var h_posTop = '';
var h_posLeft = '';
var h_creatWidth = '';
var h_creatHeight = '';
var activeArr = [];
//覆盖检测 建立选中的内容
$("#diy-editor").on("mouseover", '.cube_block', function() {
hover_memoryposTop = parseInt($(this).position().top);
hover_memoryposLeft = parseInt($(this).position().left);
if(indexF !== ''){
var h_cubeBlockW = $(this).outerWidth();
h_posLeft = parseInt($(this).position().left)
h_posTop = parseInt($(this).position().top)
h_creatWidth = parseInt(h_posLeft - posLeft + h_cubeBlockW)
if(h_posLeft < posLeft){
h_creatWidth = parseInt(posLeft - h_posLeft + h_cubeBlockW)
}
h_creatHeight = parseInt(h_posTop - posTop + h_cubeBlockW)
if(h_posTop < posTop){
h_creatHeight = parseInt(posTop - h_posTop + h_cubeBlockW)
}
}
if(indexF !== '' && $(this).parent().find('.active .active-hover').length == 0) {
$(this).parent().find('.active').append('<div class="active-hover"></div>');
}
var hover_impact = true
var itemid = $("#edit_magic_cube").data("itemid");
if(Object.keys(modal.items[itemid]['data']).length >= 1){
hover_impact = impact(0);
}
if(hover_impact){
if(hover_mTop !== parseInt($(this).position().top) || hover_mLeft !== parseInt($(this).position().left)){
$('#cube_table .active .active-hover').css({"width": (Math.abs(hover_memoryposLeft-memoryposLeft)+93)+"px", "height": (Math.abs(hover_memoryposTop-memoryposTop)+93)+"px"});
if(memoryposTop > parseInt($(this).position().top)){
$('#cube_table .active .active-hover').css({"top": "auto", "bottom": "0"});
}else{
$('#cube_table .active .active-hover').css({"top": "0", "bottom": "auto"});
}
if(memoryposLeft > parseInt($(this).position().left)){
$('#cube_table .active .active-hover').css({"left": "auto", "right": "0"});
}else{
$('#cube_table .active .active-hover').css({"left": "0", "right": "auto"});
}
}
hover_mTop = parseInt($(this).position().top);
hover_mLeft = parseInt($(this).position().left);
}
});
$("#diy-editor").on("mouseleave", '.cube_block', function() {
$('#cube_table .active .active-hover').css({"width": "0", "height": "0"});
/*h_posTop = '';
h_posLeft = '';
h_creatWidth = '';
h_creatHeight = '';*/
});
$("#diy-editor").on("click", '.cube_block', function() {
var that = $(this);
cubeBlockW = $(this).outerWidth();
if($(this).attr('class').indexOf('active') <= 0 || indexF !== '') {
itemid = $("#edit_magic_cube").data("itemid");
if(indexF == '') {
$(this).addClass('active');
activeArr.push($(this).attr('data-key'));
indexF = $(this).attr('data-key');
posTop = parseInt($(this).position().top);
posLeft = parseInt($(this).position().left);
memoryposTop = parseInt($(this).position().top);
memoryposLeft = parseInt($(this).position().left);
h_posTop = parseInt($(this).position().top);
h_posLeft = parseInt($(this).position().left);
} else {
indexS = $(this).attr('data-key');
if($(this).position().left > posLeft) {
creatWidth = parseInt($(this).position().left + cubeBlockW - posLeft)
} else {
creatWidth = parseInt(posLeft + cubeBlockW - $(this).position().left)
posLeft = parseInt($(this).position().left)
}
if($(this).position().top > posTop) {
creatHeight = parseInt($(this).position().top + cubeBlockW - posTop)
} else {
creatHeight = parseInt(posTop + cubeBlockW - $(this).position().top)
posTop = parseInt($(this).position().top)
}
impact(1);
}
}
});
function impact (way) {
// way 0为hover 1为click
//进行碰撞检测
var result = true; //当前绘制的区域是否合格
//获取当前选中区域的点
//操作类型为hover时 改变区域点的值
var current_top = parseInt(posTop);
var current_left = parseInt(posLeft);
var current_width = parseInt(creatWidth);
var current_height = parseInt(creatHeight);
current_right = w - (current_left + current_width);
current_bottom = w - (current_top + current_height);
itemid = $("#edit_magic_cube").data("itemid");
$.each(modal.items[itemid]['data'], function(k, v) {
//获取已存在的被选中区域的点
var top = parseInt(v.top);
var width = parseInt(v.width);
var height = parseInt(v.height);
var left = parseInt(v.left);
var right = w - (left + width);
var bottom = w - (top + height);
//判断是否被覆盖
//上边有内容被覆盖
var topCover = current_left < (parseInt(left) + parseInt(width)) && current_right < (parseInt(right) + parseInt(width)) && current_top < top && current_bottom < (parseInt(height) + parseInt(bottom)),
//右边有内容被覆盖
rightCover = current_top < (parseInt(top) + parseInt(height)) && current_bottom <= bottom && current_right < right && current_left < (parseInt(width) + parseInt(left)),
//下边有内容被覆盖
bottomCover = current_left < (parseInt(left) + parseInt(width)) && current_right <= right && current_bottom < bottom && current_top < (parseInt(height) + parseInt(top)),
//左边有内容被覆盖
leftCover = current_top < (parseInt(top) + parseInt(height)) && current_bottom <= bottom && current_left < left && current_right < (parseInt(width) + parseInt(right)),
//横向有内容被覆盖
abeamCover = current_left <= left && current_right <= right && current_top >= top && current_bottom >= bottom,
//纵向有内容被覆盖
endwiseCover = current_top <= top && current_bottom <= bottom && current_left >= left && current_right >= right;
if((topCover || rightCover || bottomCover || leftCover || abeamCover || endwiseCover)) {
//区域有冲突 不合格 数据还原 不建立选中区域
posTop = memoryposTop;
posLeft = memoryposLeft;
creatWidth = '';
creatHeight = '';
result = false;
}
});
//判断当前绘制的区域是否合格 合格开始建立内容
if(result) {
if(way == 1){
creat();
}
return true;
}else{
return false
}
}
function creat () {
if(creatCan == '') {
$('#diy-editor .cube_block').each(function() {
if($(this).position().top >= posTop && $(this).position().left >= posLeft && $(this).position().top < (posTop + creatHeight) && $(this).position().left < (posLeft + creatWidth)) {
if(activeArr.indexOf($(this).attr('data-key')) <= -1 || $(this).attr('data-key') == indexF) {
if(activeArr.indexOf($(this).attr('data-key')) <= -1) {
activeArr.push($(this).attr('data-key'));
}
}
}
});
//更新信息
var selectNum = $("#cube_table .creat-p").length;
var total = parseInt(selectNum) + parseInt(1);
var numberkey = 'C012345678910' + total;
var cubeInfoData = {
width: creatWidth,
height: creatHeight,
top: posTop,
left: posLeft,
url: "",
imgurl: "",
};
var itemkey = $("#edit_magic_cube").data("itemid");
modal.items[itemkey]['data'][numberkey] = $.extend(true, {}, cubeInfoData);
modal.initItems(itemid);
//更新配置信息
modal.initEditor(itemid);
indexF = '';
indexS = '';
posTop = '';
posLeft = '';
memoryposTop = '';
memoryposLeft = '';
creatWidth = '';
creatHeight = '';
}
creatCan = '';
}
//修改魔方图片 链接
$("#diy-editor").on('input || propertychange || change', '.cube-bind', function() {
var itemkey = $("#edit_magic_cube").data("itemid");
var itemid = $(this).data("bind-child");
var bind = $(this).data("bind");
var value = $(this).val();
var type = $(this).data("types");
modal.items[itemkey]['data'][itemid][bind] = value;
if(type) {
modal.items[itemkey]['data'][itemid]['url_type'] = type;
}
modal.initItems(itemkey);
});
//删除一个已经选中的块
$("#diy-editor").on('click', ".cude-del", function() {
var itemkey = $("#edit_magic_cube").data("itemid");
var id = $(this).data("id");
tip.confirm("确定删除吗", function() {
var data = $.extend(true, {}, modal.items[itemkey]['data']); //提取data
delete data[id];
var newData = {}; //新的data信息
$.each(data, function(k, v) {
var total = parseInt(Object.keys(newData).length) + parseInt(1);
var key = 'C012345678910' + total;
newData[key] = v;
});
modal.items[itemkey]['data'] = $.extend(true, {}, newData); //从新赋予data信息
modal.initItems();
//更新配置信息
$(".drag[data-itemid='" + itemkey + "']").trigger('mousedown').trigger('click');
})
});
//魔方删除
$("#diy-editor").on('mousemove', '.creat-p', function() {
if($(this).attr('class').indexOf('creat-p-act') < 0) {
$(this).addClass('creat-p-act');
}
if($(this).find('.creat-p-act-del').length == 0) {
$(this).append('<div class="creat-p-act-del"><i class="icon iconfont icon-close"></i></div>');
}
});
$("#diy-editor").on('mouseleave', '.creat-p, .creat-p-act-del', function() {
$('.creat-p').removeClass('creat-p-act');
$('.creat-p-act-del').remove();
});
//点击删除当前被选中的块
$("#diy-editor").on('click', '.creat-p-act-del', function() {
var id = $(this).parent(".creat-p").data("itemkey");
$("#diy-editor #create-cube [data-id='" + id + "'].cude-del ").click();
});
};
//获取商品信息,显示弹框
modal.getGoods = function(plugin, page, search, keys) {
var info;
$.ajax({
url: biz.url('diy/diy/getGoodsInfo'),
data: {
plugin: plugin,
page: page,
search: search,
page_class:modal.pageClass,
},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
info = res.data;
modal.goods = info['goods'];
info['plugin'] = plugin;
info['keys'] = keys;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectGoods", info);
$("#SelectGoodsContent").html(html);
$("#SelectGoodsContent").modal();
if(info['page_number'] <= 1) {
return false
}
//建立分页内容
modal.createPaging(info, plugin);
}
});
};
//获取头条信息,显示弹框
modal.getHeadline = function(page, search, itemid) {
$.ajax({
url: biz.url('diy/diy/getHeadline'),
data: {
page: page,
search: search
},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = res.data;
modal.headline = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectHeadline", info);
$("#SelectHeadlineContent").html(html);
$("#SelectHeadlineContent").modal();
//建立分页内容
if(info['page_number'] <= 1) {
return false
}
info['state'] = 'headline';
modal.createPaging(info);
}
});
};
//获取商户信息,显示弹框
modal.getShop = function (page, search, itemid) {
$.ajax({
url: biz.url('diy/diy/getShop'),
data: {
page: page,
search: search
},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = res.data;
modal.shop = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectShop", info);
$("#SelectShopContent").html(html);
$("#SelectShopContent").modal();
//建立分页内容
if(info['page_number'] <= 1) {
return false
}
info['state'] = 'shop';
modal.createPaging(info);
}
});
};
//为弹框建立分页的页码按钮
modal.createPaging = function(info, plugin) {
var page_html = '';
if(info['page'] > 1) {
page_html += "<div class='paging_button' data-plugin='" + plugin + "' data-page='1'>首页</div>";
page_html += "<div class='paging_button' data-plugin='" + plugin + "' data-page='" + (info['page'] - 1) + "'>上一页</div>";
}
for(var i = 1; i <= info['page_number']; i++) {
if(i == info['page']) {
page_html += "<div class='paging_button paging_pageNumber paging_active' data-plugin='" + plugin + "' data-page='" + i + "'>" + i + "</div>";
} else {
page_html += "<div class='paging_button paging_pageNumber' data-plugin='" + plugin + "' data-page='" + i + "'>" + i + "</div>";
}
}
var show_num = 5; //显示的按钮数量
var but_num = Math.floor(parseInt(show_num) / parseInt(2)); //两边的数量
if(info['page_number'] > info['page']) {
page_html += "<div class='paging_button' data-plugin='" + plugin + "' data-page='" + (parseInt(info['page']) + parseInt(1)) + "'>下一页</div>";
page_html += "<div class='paging_button' data-plugin='" + plugin + "' data-page='" + info['page_number'] + "'>尾页</div>";
}
if(info['state'] == 'headline') {
$("#SelectHeadlineContent .paging").html(page_html);
}else if(info['state'] == 'shop'){
$("#SelectShopContent .paging").html(page_html);
}else if(info['state'] == 'recruit'){
$("#SelectRecruitContent .paging").html(page_html);
}else if(info['state'] == 'resume'){
$("#SelectResumeContent .paging").html(page_html);
}else if(info['state'] == 'dating'){
$("#SelectDatingContent .paging").html(page_html);
} else if(info['state'] == 'houseKeep'){
$("#SelectHouseKeepContent .paging").html(page_html);
} else {
$("#SelectGoodsContent .paging").html(page_html);
}
//删除多余的分页按钮
if(info['page_number'] > show_num) {
if(info['page'] <= (parseInt(but_num) + parseInt(1))) {
//删除大于五的内容
$(".paging_pageNumber:gt(" + (show_num - 1) + ")").remove();
} else if(info['page'] >= (parseInt(info['page_number']) - parseInt(but_num))) {
//删除小于总页数减 show_num 的数的内容
var maxNumber = parseInt(info['page_number']) - parseInt(show_num);
$(".paging_pageNumber:lt(" + maxNumber + ")").remove();
} else {
//删除两边 当前数位移 but_num 数量后的内容
var min_num = parseInt(info['page']) - (parseInt(but_num) + parseInt(1)); //最小显示的页面 左
$(".paging_pageNumber:lt(" + min_num + ")").remove();
$(".paging_pageNumber:gt(" + (show_num - 1) + ")").remove();
}
}
};
//获取选项卡风格一的选项卡内容
modal.optionInfoFun = function(){
$.ajax({
url: biz.url('diy/diy/getOption'),
dataType: "json",
async: false,
success: function(res) {
modal.optionInfo = res;
}
});
};
//组件数量限制
modal.numberLimit = function(item){
//限制判断 —— 获取当前组件的基础组件信息
var modelInfo;
if(item.group_name){
modelInfo = $.extend(true, {}, modal.navs[item.group_name]);
}else{
modelInfo = $.extend(true, {}, modal.navs[item.id]);
}
//限制判断 —— 判断是否存在判断内容
if(modelInfo.max > 0){
//获取已经存在的数量
var haveNum = modal.getItemNum(modelInfo.id);
if(modelInfo.max <= haveNum){
return false;//到达限制不可添加
}
return true;
}
return true;
};
//获取招聘信息,显示弹框
modal.getRecruit = function (page, search, itemid) {
$.ajax({
url: biz.url('utility/select/selectRecruit'),
data: {page: page, search: search,return_type:'json'},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = res.data;
modal.recruit = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectRecruit", info);
$("#SelectRecruitContent").html(html);
$("#SelectRecruitContent").modal();
//建立分页内容
if(info['page_number'] <= 1) return false
info['state'] = 'recruit';
modal.createPaging(info);
}
});
};
//获取简历信息,显示弹框
modal.getResume = function (page, search, itemid) {
$.ajax({
url: biz.url('utility/select/selectResume'),
data: {page: page, search: search,return_type:'json'},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = res.data;
modal.resume = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectResume", info);
$("#SelectResumeContent").html(html);
$("#SelectResumeContent").modal();
//建立分页内容
if(info['page_number'] <= 1) return false
info['state'] = 'resume';
modal.createPaging(info);
}
});
};
//获取相亲交友会员信息
modal.getDating = function (page, search, itemid) {
$.ajax({
url: biz.url('utility/select/selectDating'),
data: {page: page, search: search,return_type:'json'},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = res.data;
modal.dating = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectDating", info);
$("#SelectDatingContent").html(html);
$("#SelectDatingContent").modal();
//建立分页内容
if(info['page_number'] <= 1) return false
info['state'] = 'dating';
modal.createPaging(info);
}
});
};
//获取相亲交友会员信息
modal.getHouseKeep = function (page, search, itemid) {
$.ajax({
url: biz.url('utility/select/selectHouseKeep'),
data: {page: page, search: search,return_type:'json'},
dataType: "json",
async: false,
success: function(res) {
if(res.errno == 0) {
tip.msgbox.err(res.message);
return false;
}
var info = res.data;
modal.houseKeep = info['list'];
info['itemid'] = itemid;
info['search'] = search;
//显示弹框
var html = tpl("tplSelectHouseKeep", info);
$("#SelectHouseKeepContent").html(html);
$("#SelectHouseKeepContent").modal();
//建立分页内容
if(info['page_number'] <= 1) return false
info['state'] = 'houseKeep';
modal.createPaging(info);
}
});
};
return modal
});