Authored by 王钱钧

Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop

... ... @@ -8,6 +8,7 @@ dialog=require('./dialog'),
tab=require('./tab'),
tabTree=require('./tabTree'),
util=require('./util'),
components=require('./edit2'),
drag=require('./drag');
var common={
... ... @@ -18,7 +19,8 @@ var common={
edit:edit,
util:util,
tabTree:tabTree,
drag:drag
drag:drag,
components:components
}
module.exports=common;
\ No newline at end of file
... ...
... ... @@ -315,7 +315,7 @@ toast.close = function() {
}
toast.defaults = {
init: null,
zIndex: 1024,
zIndex: 50,
lock: true,
content: 'Loading...',
title: '',
... ...
... ... @@ -11,7 +11,7 @@ drag.prototype = {
dragItemList: null,
dragItemPos: [],
Initialize: function(){
this.dragItemList = $(this.el).find("li");
this.dragItemList = $(this.el).find(".dragItem");
if(this.dragItemList.length > 0){
var elHeight = $(this.el).height();
$(this.el).css("position","relative").css("height", elHeight + "px");
... ... @@ -75,8 +75,8 @@ drag.prototype = {
$(oNear).css("border","0px").css("z-index", _self.minZindex++);
$(obj).css("z-index", _self.minZindex++);
_self.move(oNear,_self.dragItemPos[obj.index]);
_self.move(obj,_self.dragItemPos[oNear.index]);
//_self.move(oNear,_self.dragItemPos[obj.index]);
//_self.move(obj,_self.dragItemPos[oNear.index]);
//交换index
oNear.index += obj.index;
... ... @@ -187,7 +187,7 @@ drag.prototype = {
},
destroy: function(){
this.dragItemList = $(this.el).find("li");
this.dragItemList = $(this.el).find(".dragItem");
if(this.dragItemList.length > 0){
$(this.el).removeAttr("style");
for(var i=0; i<this.dragItemList.length; i++){
... ...
var $ = require('jquery');
var Validator = require('./validate');
require('./upload');
require('../util/datepicker');
require('../util/jquery.gritter');
var components=function(el,option){
this.registerEvent = {
validate: [],
render: [],
file_onComplete: []
};
this.el = el;
this.option = option || {};
}
components.prototype={
constructor:components,
on: function(name, callback) {
var __self = this;
var _e = __self.registerEvent[name];
if (_e) {
_e.push(callback);
}
return _e;
},
off: function(name, callback) {
var __self = this;
var _e = __self.registerEvent[name];
var e = [];
me.each(_e, function(name, _callback) {
if (_callback === callback) {
e.push(name);
}
});
me.each(e.reverse(), function(name, _callback) {
_e.splice(_callback, 1);
});
},
init: function() {
var __self = this;
this.__fileRender();
return this;
},
validate:function(){
return true;
},
__fileRender:function(){
var that=this;
if ($('input[type="file"]', that.el).length > 0) {
$('input[type="file"]', that.el).each(function() {
var bucket= $(this).data("bucket")||that.option.bucket;
if(!bucket){
alert("bucket 不存在");
}
$(this).wrap("<div class='fileinput-button'></div>");
var parent=$(this).parent(".fileinput-button");
if($(this).attr("value")){
parent.append('<a class="fileinput-button-icon" href="javascript:void(0);"><img src="'+$(this).attr("value")+'" width=100 height=100/></a>');
}else{
parent.append('<a class="fileinput-button-icon" href="javascript:void(0);">+</a>');
}
$('input[type="file"]', that.el).ajaxfileupload({
'action': '/ajax/upload',
'params': {
"bucket": bucket,
__type: "upload"
},
'onComplete': function(response) {
if (response.status && response.code == 200) {
that.__listen("file_onComplete", {
field: $(this).data("field"),
data: response.data,
datas:response.datas
});
var parent=$(this).parent(".fileinput-button");
if(response.data){
parent.find(".fileinput-button-icon").html("<img src='"+response.data+"' width=100 height=100/>");
}
} else {
that.$tip(response.message);
}
}
});
})
}
},
__listen: function(key, o, callback) {
var __self = this;
if (__self.registerEvent[key] && __self.registerEvent[key].length > 0) {
for (_e in __self.registerEvent[key]) {
var a = __self.registerEvent[key][_e](o);
if (callback) {
callback(a);
}
}
}
},
__err: function(msg, callback) {
if (msg) {
this.$tip(msg, callback);
}
},
$tip: function(msg, callback, type) {
$.gritter.add({
title: msg,
class_name: type || 'growl-warning',
sticky: false,
time: 1000,
after_open: setTimeout(function() {
callback && callback();
}, 1000)
});
}
}
components.prototype.init.prototype = components.prototype;
module.exports = components;
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@ if(param&&param.length==1){
console.log("ViewModel",ViewModel);
var edit = new common.edit(".modal-body", {
var components = new common.components(".modal-body", {
bucket: "goodsimg"
});
... ... @@ -104,7 +104,7 @@ var Bll = {
button: [{
value: "保存",
callback: function() {
if (edit.validate()) {
if (components.validate()) {
//TODO
!!~index ? Bll.contentDatas[index] = module : Bll.contentDatas.push(module);
Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
... ... @@ -124,15 +124,13 @@ var Bll = {
Bll.__editRender();
},
__editRender:function(){
edit.init();
edit.on("callback", function(obj) {
if (/^file_onComplete/.test(obj.key)) {
components.init();
components.on("file_onComplete", function(obj) {
var names=obj.field;
Bll.module.contentData.data=common.util.__buildobj(names, '.', Bll.module.contentData.data, function(o, name) {
o[name] = obj.data;
});
console.log(Bll.module.contentData);
}
console.log(obj);
});
},
rendContent: function() {
... ...
var Button=[
var Button = [
{
template_intro:"文本",
data:{text:""},
template_name:"text"
template_intro: "文本",
data: {text: ""},
template_name: "text"
},
{
template_intro:"一张图",
template_name:"singleImage",
data:[{
template_intro: "一张图",
template_name: "singleImage",
data: [{
"url": {
"action":"",
"url":""
"action": "",
"url": ""
},
"alt": "",
"src": "",
... ... @@ -18,20 +18,20 @@ var Button=[
}]
},
{
template_intro:"添加小图",
template_name:"smallPic",
data:[{
template_intro: "添加小图",
template_name: "smallPic",
data: [{
"url": {
"action":"",
"url":""
"action": "",
"url": ""
},
"alt": "",
"src": "",
"imgId": ""
},{
}, {
"url": {
"action":"",
"url":""
"action": "",
"url": ""
},
"alt": "",
"src": "",
... ... @@ -39,9 +39,9 @@ var Button=[
}]
},
{
template_intro:"焦点图",
template_name:"focus",
data:[
template_intro: "焦点图",
template_name: "focus",
data: [
{
"src": "",
"alt": "",
... ... @@ -50,12 +50,12 @@ var Button=[
"imgId": "0"
}
],
focus_type:"1"
focus_type: "1"
},
{
template_intro:"添加商品",
template_name:"goods",
data:[
template_intro: "添加商品",
template_name: "goods",
data: [
// {
// src:"",
// id:""
... ... @@ -63,12 +63,12 @@ var Button=[
]
},
{
template_intro:"推荐商品组",
template_name:"goodsGroup",
data:[
template_intro: "推荐商品组",
template_name: "goodsGroup",
data: [
{
cover:{cover:"",maxSortId:""},
list:[
cover: {cover: "", maxSortId: ""},
list: [
// {
// src:"",
// id:"",
... ... @@ -94,8 +94,8 @@ var Button=[
]
},
{
template_intro:"推荐(1T-1L-4R)",
template_name:"recommendContentOne",
template_intro: "推荐(1T-1L-4R)",
template_name: "recommendContentOne",
"data": {
"title": {
"name": "",
... ... @@ -152,8 +152,8 @@ var Button=[
}
},
{
template_intro:"推荐(1T-6F)",
template_name:"recommendContentTwo",
template_intro: "推荐(1T-6F)",
template_name: "recommendContentTwo",
"data": {
"title": {
"name": "",
... ... @@ -232,15 +232,15 @@ var Button=[
"title": "",
"src": "",
"url": {
action:"",
url:""
action: "",
url: ""
},
"alt": ""
}
},
{
template_intro:"推荐(1T-12F)",
template_name:"recommendContentThree",
template_intro: "推荐(1T-12F)",
template_name: "recommendContentThree",
"data": {
"big_image": [
{
... ... @@ -353,18 +353,18 @@ var Button=[
}
},
{
template_intro:"潮人搭配",
template_name:"trendsetterCollocation",
template_intro: "潮人搭配",
template_name: "trendsetterCollocation",
data: {}
},
{
template_intro:"潮品话题",
template_name:"trendgoodsTopic",
template_intro: "潮品话题",
template_name: "trendgoodsTopic",
data: {}
},
{
template_intro:"推荐品牌",
template_name:"appHotBrands",
template_intro: "推荐品牌",
template_name: "appHotBrands",
"data": {
"title": {
"title": ""
... ... @@ -374,8 +374,8 @@ var Button=[
}
},
{
template_intro:"自定义品牌",
template_name:"customBrands",
template_intro: "自定义品牌",
template_name: "customBrands",
"data": {
"title": {
"title": "",
... ... @@ -386,22 +386,22 @@ var Button=[
}
},
{
template_intro:"一个链接",
template_name:"link",
data:[
{"url":{"action":"","url":""}}
template_intro: "一个链接",
template_name: "link",
data: [
{"url": {"action": "", "url": ""}}
]
},
{
template_intro:"添加促销",
template_name:"promotion",
template_intro: "添加促销",
template_name: "promotion",
data: {
"promotionId": ""
}
},
{
template_intro:"轮播banner",
template_name:"carouselBanner",
template_intro: "轮播banner",
template_name: "carouselBanner",
"data": {
"speed": "",
"list": [
... ... @@ -413,22 +413,25 @@ var Button=[
}
},
{
template_intro:"kids推荐品牌",
template_name:"kidsBrands",
template_intro: "kids推荐品牌",
template_name: "kidsBrands",
"data": {
"params": {
"param": "",
"paramValue": "",
"title": "",
"more": "",
"more_url": ""
"more_url": {
"action": "",
"url": ""
}
},
"list": []
}
},
{
template_intro:"推荐(L1-RT1-RF2)",
template_name:"recommendContentFour",
template_intro: "推荐(L1-RT1-RF2)",
template_name: "recommendContentFour",
"data": {
"left": {
"title": "",
... ... @@ -475,8 +478,8 @@ var Button=[
}
},
{
template_intro:"添加楼层",
template_name:"addfloor",
template_intro: "添加楼层",
template_name: "addfloor",
data: [
{
"url": {},
... ... @@ -488,8 +491,8 @@ var Button=[
]
},
{
template_intro:"推荐(标题 + 12张图)",
template_name:"recommendContentFive",
template_intro: "推荐(标题 + 12张图)",
template_name: "recommendContentFive",
data: {
"title": {
"title": "",
... ... @@ -596,13 +599,13 @@ var Button=[
}
},
{
template_intro:"文本导航",
template_name:"textNav",
template_intro: "文本导航",
template_name: "textNav",
data: []
},
{
template_intro:"图片列表",
template_name:"imageList",
template_intro: "图片列表",
template_name: "imageList",
"data": {
"title": {
"title": "",
... ... @@ -613,13 +616,29 @@ var Button=[
}
},
{
template_intro:"标题标签",
template_name:"",
"data": {}
template_intro: "标题标签",
template_name: "title",
"data": {
"title_name": "",
"more_name": "",
"more_link": {
"action": "",
"url": ""
},
"nav": [
{
"name": "",
"url": {
"action": "",
"url": ""
}
}
]
}
},
{
template_intro:"编辑推荐",
template_name:"editorTalk",
template_intro: "编辑推荐",
template_name: "editorTalk",
"data": {
"title": {
"title": "",
... ... @@ -629,8 +648,8 @@ var Button=[
}
},
{
template_intro:"热门品类",
template_name:"hotCategory",
template_intro: "热门品类",
template_name: "hotCategory",
"data": {
"title": {
"name": "",
... ... @@ -731,15 +750,15 @@ var Button=[
}
},
{
template_intro:"有序焦点",
template_name:"debrisSlider",
template_intro: "有序焦点",
template_name: "debrisSlider",
"data": {
"big_image": [
{
"src": "",
"url": {
action:"",
url:""
action: "",
url: ""
},
"title": ""
}
... ... @@ -749,8 +768,8 @@ var Button=[
}
},
{
template_intro:"新人专享",
template_name:"newUserFloor",
template_intro: "新人专享",
template_name: "newUserFloor",
data: {
"title": {
"name": "",
... ... @@ -774,8 +793,8 @@ var Button=[
}
},
{
template_intro:"图片广告",
template_name:"imageGroup",
template_intro: "图片广告",
template_name: "imageGroup",
data: {
"title": "",
"more": "",
... ... @@ -795,8 +814,8 @@ var Button=[
}
},
{
template_intro:"自定义参数",
template_name:"paramsGroup",
template_intro: "自定义参数",
template_name: "paramsGroup",
data: {
"title": "",
"more": "",
... ... @@ -810,17 +829,17 @@ var Button=[
}
},
{
template_intro:"自定义参数图片",
template_name:"",
template_intro: "自定义参数图片",
template_name: "",
data: {}
},
{
template_intro:"站内公告",
template_name:"announcement"
template_intro: "站内公告",
template_name: "announcement"
},
{
template_intro:"标题图片",
template_name:"titleImage",
template_intro: "标题图片",
template_name: "titleImage",
data: {
"title": "",
"more_name": "",
... ... @@ -828,7 +847,7 @@ var Button=[
"action": "",
"url": ""
},
"image":{
"image": {
"src": "",
"url": {
"action": "",
... ... @@ -838,10 +857,10 @@ var Button=[
}
},
{
template_intro:"多标签图片",
template_name:"multiLabelImage",
template_intro: "多标签图片",
template_name: "multiLabelImage",
data: {
"label":[
"label": [
{
"title": "",
"url": {
... ... @@ -850,7 +869,7 @@ var Button=[
}
}
],
"image":[
"image": [
{
"src": "",
"url": {
... ... @@ -862,8 +881,8 @@ var Button=[
}
},
{
template_intro:"搭配(2T-nF)",
template_name:"matchImage",
template_intro: "搭配(2T-nF)",
template_name: "matchImage",
data: {
"title": {
"name": "",
... ... @@ -917,22 +936,24 @@ var Button=[
{
"template_name": "getCoupon",
"template_intro": "领券频道",
"data": {
"title":"",
"isShow":"YES",
"image":{
"data": [
{
"title": "",
"isShow": "YES",
"image": {
"src": "",
"url": {
"action": "",
"url": ""
}
},
"couponID":"",
"goShopping":{
"action": "",
"url": ""
}
"couponID": ""
//"goShopping":{
// "action": "",
// "url": ""
//}
}
]
}
];
... ...
... ... @@ -36,7 +36,7 @@ var g = new common.grid({
});
g.init("/resource/platform/findResPlatforms");
g.init("/resources/findResPlatforms");
var Bll = {
getLocalTime:function(nS) {
... ... @@ -83,12 +83,12 @@ var Bll = {
$(document).on('click', '#add-platform', function() {
var item = {};
Bll.toast("/resource/platform/addResPlatform", item, "添加平台");
Bll.toast("/resources/addResPlatform", item, "添加平台");
});
$(document).on('click', '.add2', function() {
var item = g.rows[$(this).data("index")];
Bll.toast("/resource/platform/updateResPlatform", item, "修改平台");
Bll.toast("/resources/updateResPlatform", item, "修改平台");
});
$(document).on('click', '.delbtn', function() {
... ... @@ -97,7 +97,7 @@ $(document).on('click', '.delbtn', function() {
"确认删除?",
function() {
common.util.__ajax({
url:'/resource/platform/deleteResPlatform',
url:'/resources/deleteResPlatform',
data:{platformId:item.platformId}
},function() {
g.reload();
... ...
var $ = require('jquery'),
common = require('../common/common');
var Button=require('./partials/Button1');
var Button = require('./partials/Button1');
/*获取数据*/
var ViewModel={};
var ViewModel = {};
//资源id
var param = location.href.substring(location.href.lastIndexOf("/") + 1);
common.util.__ajax({
url: "/resource/content/resContentIndex",
url: "/resources/resContentIndex",
data: {id: param},
async:false
},function(res) {
async: false
}, function (res) {
ViewModel = res.data;
},true);
}, true);
/*配置模块*/
var edit = new common.edit(".modal-body", {
bucket: "goodsimg"
bucket: "yhb-img01"
});
var tempArr = [];
... ... @@ -44,7 +44,7 @@ tempArr["addfloor"] = "icon-template";
tempArr["recommendContentFive"] = "recommendContent-template";
tempArr["textNav"] = "textNav-template";
tempArr["imageList"] = "imageList-template";
tempArr["标题标签"] = "noEdit-template";
tempArr["title"] = "title-template";
tempArr["editorTalk"] = "editorTalk-template";
tempArr["hotCategory"] = "hotCategory-template";
tempArr["debrisSlider"] = "debrisSlider-template";
... ... @@ -58,16 +58,16 @@ tempArr["multiLabelImage"] = "multiLabelImage-template";
tempArr["matchImage"] = "matchImage-template";
tempArr["getCoupon"] = "getCoupon-template";
var Bll={
var Bll = {
Brands: [],
Brands1: {},
Brdata: [],
contentDatas:[],
contentDatas: [],
module: null,
__render:function(selecter,templater,data){
$(selecter).html(common.util.__template2($("#"+templater).html(),data) );
__render: function (selecter, templater, data) {
$(selecter).html(common.util.__template2($("#" + templater).html(), data));
},
toast: function(index, module) {
toast: function (index, module) {
var d = new common.dialog({
title: (!!~index ? "修改" : "添加") + module.contentData.template_intro,
//content: common.util.__template2($("#" + module.contentData.dialog).html(), module),
... ... @@ -75,11 +75,11 @@ var Bll={
width: '70%',
button: [{
value: "保存",
callback: function() {
callback: function () {
if (edit.validate()) {
//TODO
!!~index ? Bll.contentDatas[index] = module : Bll.contentDatas.push(module);
Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
d.close();
}
return false;
... ... @@ -89,28 +89,26 @@ var Bll={
});
Bll.__editRender();
},
renderDialog:function(templater){
Bll.__render(".modal-body",templater,Bll.module);
renderDialog: function (templater) {
Bll.__render(".modal-body", templater, Bll.module);
Bll.__editRender();
},
__editRender:function(){
__editRender: function () {
edit.init();
edit.on("callback", function(obj) {
edit.on("callback", function (obj) {
if (/^file_onComplete/.test(obj.key)) {
var names=obj.field;
Bll.module.contentData.data=common.util.__buildobj(names, '.', Bll.module.contentData.data, function(o, name) {
var names = obj.field;
Bll.module.contentData.data = common.util.__buildobj(names, '.', Bll.module.contentData.data, function (o, name) {
o[name] = obj.data;
});
console.log(Bll.module.contentData.data);
}
});
},
//获取品牌
getBrands: function() {
getBrands: function () {
var Brand = {};
$.get("/ajax/yohosearch", function(res) {
res.data.forEach(function(item, index) {
$.get("/ajax/yohosearch", function (res) {
res.data.forEach(function (item, index) {
var brandAlif = (item.brand_alif || "").toUpperCase();
if (/^[0-9]$/.test(item.brand_alif)) {
brandAlif = "0-9";
... ... @@ -123,7 +121,7 @@ var Bll={
Bll.Brands1[item.id] = item;
});
for (var i in Brand) {
Brand[i].sort(function(a, b) {
Brand[i].sort(function (a, b) {
var aName = a.brand_name.toLowerCase(),
bName = b.brand_name.toLowerCase();
if (aName < bName) return -1;
... ... @@ -137,39 +135,38 @@ var Bll={
}
});
},
renderBrandPic: function(Brdata) {
renderBrandPic: function (Brdata) {
var Brands2 = [];
Brdata.forEach(function(item, index) {
if(!item.brandIco){
Brdata.forEach(function (item, index) {
if (!item.brandIco) {
var a = Bll.Brands1[item];
a.brandIco = common.util.__joinImg("brandLogo", a.brand_ico);
Brands2.push(a);
}else{
item.brandIco=common.util.__template(item.brandIco,{width:110,height:150});
} else {
item.brandIco = common.util.__template(item.brandIco, {width: 110, height: 150});
Brands2.push(item);
}
});
Bll.module=Bll.module||{};
Bll.module.contentData=Bll.module.contentData||{};
Bll.module.contentData.data=Bll.module.contentData.data||{};
Bll.module.contentData.data.list=Bll.module.contentData.data.list||[];
for(var i=0;i<Brands2.length;i++){
var pic={};
if( Bll.module.contentData.template_name=="kidsBrands"){
pic={
"src":Brands2[i].brandIco,
"id":Brands2[i].id,
"title":Brands2[i].brand_name
Bll.module = Bll.module || {};
Bll.module.contentData = Bll.module.contentData || {};
Bll.module.contentData.data = Bll.module.contentData.data || {};
Bll.module.contentData.data.list = Bll.module.contentData.data.list || [];
for (var i = 0; i < Brands2.length; i++) {
var pic = {};
if (Bll.module.contentData.template_name == "kidsBrands") {
pic = {
"src": Brands2[i].brandIco,
"id": Brands2[i].id,
"title": Brands2[i].brand_name
};
}else{
pic={
"src":Brands2[i].brandIco,
"id":Brands2[i].id,
"name":Brands2[i].brand_name
} else {
pic = {
"src": Brands2[i].brandIco,
"id": Brands2[i].id,
"name": Brands2[i].brand_name
};
}
Bll.module.contentData.data.list.push(pic);
}
Bll.renderDialog("brands-template");
... ... @@ -177,26 +174,40 @@ var Bll={
};
/*第一步,基础模板*/
Bll.__render("#content-list","content-template",ViewModel);
Bll.__render(".contents","template_content_btns",{btns:Button});
Bll.__render("#content-list", "content-template", ViewModel);
Bll.__render(".contents", "template_content_btns", {btns: Button});
/*第二部,把楼层数据转化成数组*/
ViewModel.contentData.forEach(function(item,index){
item.contentData=item.contentData.replace(/(gif|png|jpg|jpeg)\?[^"]*/g,'$1');
item.contentData=common.util.__ObjToArray(JSON.parse(item.contentData));
ViewModel.contentData.forEach(function (item, index) {
item.contentData = JSON.parse(item.contentData);
var temp;
if (item.contentData.template_name == "kidsBrands") {
temp = item.contentData.data.params.more_url;
item.contentData.data.params.more_url = {};
item.contentData.data.params.more_url.action = JSON.parse(temp).action || "";
item.contentData.data.params.more_url.url = JSON.parse(temp).url || "";
}
if (item.contentData.template_name == 'title') {
temp = item.contentData.data.more_link;
item.contentData.data.more_link = {};
item.contentData.data.more_link.action = JSON.parse(temp).action || "";
item.contentData.data.more_link.url = JSON.parse(temp).url || "";
}
item.contentData = JSON.stringify(item.contentData);
item.contentData = item.contentData.replace(/(gif|png|jpg|jpeg)\?[^"]*/g, '$1');
item.contentData = common.util.__ObjToArray(JSON.parse(item.contentData));
Bll.contentDatas.push(item);
});
/*第三部解析楼层*/
Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
/*第四部 操作按钮 添加 删除 修改*/
$(document).on("click", ".add_btn", function() {
$(document).on("click", ".add_btn", function () {
var item = Button[$(this).data("index")];
Bll.module={};
Bll.module = {};
Bll.module.contentData = $.extend(true, {}, item);
Bll.toast(-1, Bll.module);
});
... ... @@ -206,37 +217,35 @@ $(document).on("click", ".add_btn", function() {
//});
$(document).on("click", ".del", function () {//删除
var index = $(this).data("index");
console.log(Bll.contentDatas);
common.dialog.confirm("警告",
common.util.__template2("是否确认删除?", {}),
function() {
if(Bll.contentDatas[index].id) {
function () {
if (Bll.contentDatas[index].id) {
common.util.__ajax({
url: "/resource/content/delResContent",
url: "/resources/delResContent",
data: {id: Bll.contentDatas[index].id}
});
}
Bll.contentDatas.splice(index, 1);
Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
});
//$("#index_" + index).remove();
});
$(document).on("click", ".edit", function() {
$(document).on("click", ".edit", function () {
var index = $(this).data("index");
var item = Bll.contentDatas[index];
console.log(Bll.contentDatas);
Bll.module = $.extend(true, {}, item);
Bll.toast(index, Bll.module);
});
/*第五步 绑定监听事件*/
$(document).on("change", ".observe", function() {
$(document).on("change", ".observe", function () {
var $this = $(this);
var name = $this.data("field");
Bll.module.contentData.data=common.util.__buildobj(name, '.', Bll.module.contentData.data, function(obj, name) {
Bll.module.contentData.data = common.util.__buildobj(name, '.', Bll.module.contentData.data, function (obj, name) {
obj[name] = $this.val();
if(name == "image_style") {
if (name == "image_style") {
delete obj["default"];
delete obj["T1F2"];
delete obj["L1R2"];
... ... @@ -246,7 +255,7 @@ $(document).on("change", ".observe", function() {
});
});
$(document).on("click", '#multiLabelImage-addImage', function() {
$(document).on("click", '#multiLabelImage-addImage', function () {
Bll.module.contentData.data.image.push({
"src": "",
"url": {
... ... @@ -257,7 +266,7 @@ $(document).on("click", '#multiLabelImage-addImage', function() {
Bll.renderDialog("multiLabelImage-template");
});
$(document).on("click", '#multiLabelImage-addOne', function() {
$(document).on("click", '#multiLabelImage-addOne', function () {
Bll.module.contentData.data.label.push({
"src": "",
"url": {
... ... @@ -268,7 +277,7 @@ $(document).on("click", '#multiLabelImage-addOne', function() {
Bll.renderDialog("multiLabelImage-template");
});
$(document).on("click", '#imageGroup-addOne', function() {
$(document).on("click", '#imageGroup-addOne', function () {
Bll.module.contentData.data.list.push({
"src": "",
"title": "",
... ... @@ -280,7 +289,7 @@ $(document).on("click", '#imageGroup-addOne', function() {
Bll.renderDialog("imageGroup-template");
});
$(document).on("click", '#matchImage-addOne', function() {
$(document).on("click", '#matchImage-addOne', function () {
Bll.module.contentData.data.list.push({
"title": "",
"url": {
... ... @@ -291,7 +300,7 @@ $(document).on("click", '#matchImage-addOne', function() {
Bll.renderDialog("matchImage-template");
});
//添加一个图标
$(document).on("click", '#icon-addOne', function() {
$(document).on("click", '#icon-addOne', function () {
Bll.module.contentData.data.push({
//"title": "",
"url": {
... ... @@ -302,60 +311,93 @@ $(document).on("click", '#icon-addOne', function() {
Bll.renderDialog("icon-template");
});
//删除一个图标
$(document).on("click", '#icon-delOne', function() {
$(document).on("click", '#icon-delOne', function () {
var index = $(this).data("index");
Bll.module.contentData.data.splice(index,1);
Bll.module.contentData.data.splice(index, 1);
Bll.renderDialog("icon-template");
});
//添加一个标签
$(document).on("click", '#nav-addOne', function () {
Bll.module.contentData.data.nav.push({
"name": "",
"url": {
"action": "",
"url": ""
}
});
Bll.renderDialog("title-template");
});
//添加领券
$(document).on("click", '#coupon-addOne', function () {
var length = Bll.module.contentData.data.length;
if (length >= 4) {
alert("最多添加4个")
} else {
Bll.module.contentData.data.push({
"title": "",
"isShow": "YES",
"image": {
"src": "",
"url": {
"action": "",
"url": ""
}
},
"couponID": ""
});
Bll.renderDialog("getCoupon-template");
}
});
//获取品牌
Bll.getBrands();
/*渲染品牌*/
//Bll.Brdata=ViewModel.brandList||[];
//Bll.renderBrandPic(Bll.Brdata);
//打开品牌选择模态
$(document).on("click", "#addBrands", function() {
$(document).on("click", "#addBrands", function () {
var e = new common.edit("#brandForm");
new common.dialog({
title:"选择品牌",
width:"70%",
title: "选择品牌",
width: "70%",
content: common.util.__template2($("#template5").html(), {
Brands: Bll.Brands,//所有品牌数据
Brdata: []
}),
button:[
button: [
{
value:"确定",
callback:function(){
value: "确定",
callback: function () {
Bll.Brdata = $("#brandCheckBox").val().split('|');
Bll.renderBrandPic(Bll.Brdata);
},
css:"btn-primary"
css: "btn-primary"
},
{
value:"取消"
value: "取消"
}
]
});
e.init();
});
//品牌筛选
$(document).on('click', '.brand-index', function() {
$(document).on('click', '.brand-index', function () {
var brandIndex = $(this).text();
$('.brand-wrap').find('[name="' + brandIndex + '"]').show().siblings().hide();
});
//删除一个品牌
$(document).on("click", '#remove_brand', function() {
$(document).on("click", '#remove_brand', function () {
var index = $(this).data("index");
Bll.module.contentData.data.list.splice(index,1);
Bll.module.contentData.data.list.splice(index, 1);
Bll.renderDialog("brands-template");
});
/*自定义参数*/
$(document).on("click", '.paramsGroupDel', function() {
Bll.module.contentData.data.list.splice($(this).data("index"),1);
$(document).on("click", '.paramsGroupDel', function () {
Bll.module.contentData.data.list.splice($(this).data("index"), 1);
Bll.renderDialog("paramsGroup-template");
});
$(document).on("click", '#paramsGroup-addOne', function() {
$(document).on("click", '#paramsGroup-addOne', function () {
Bll.module.contentData.data.list.push(
{
"title": "",
... ... @@ -365,7 +407,7 @@ $(document).on("click", '#paramsGroup-addOne', function() {
Bll.renderDialog("paramsGroup-template");
});
/*新人专享*/
$(document).on("click", '#newUserFloor-addBanner', function() {
$(document).on("click", '#newUserFloor-addBanner', function () {
Bll.module.contentData.data.banner_image.push(
{
"src": "",
... ... @@ -379,7 +421,7 @@ $(document).on("click", '#newUserFloor-addBanner', function() {
Bll.renderDialog("newUserFloor-template");
});
/*有序焦点添加*/
$(document).on("click", '#debrisSlider-addLeft', function() {
$(document).on("click", '#debrisSlider-addLeft', function () {
Bll.module.contentData.data.left.push(
{
"src": "",
... ... @@ -392,7 +434,7 @@ $(document).on("click", '#debrisSlider-addLeft', function() {
);
Bll.renderDialog("debrisSlider-template");
});
$(document).on("click", '#debrisSlider-addCenter', function() {
$(document).on("click", '#debrisSlider-addCenter', function () {
Bll.module.contentData.data.big_image.push(
{
"src": "",
... ... @@ -405,7 +447,7 @@ $(document).on("click", '#debrisSlider-addCenter', function() {
);
Bll.renderDialog("debrisSlider-template");
});
$(document).on("click", '#debrisSlider-addRight', function() {
$(document).on("click", '#debrisSlider-addRight', function () {
Bll.module.contentData.data.right.push(
{
"src": "",
... ... @@ -420,7 +462,7 @@ $(document).on("click", '#debrisSlider-addRight', function() {
});
//*****************************************************************//
/*热门品类*/
$(document).on("click", '#hotCategory-addLeft', function() {
$(document).on("click", '#hotCategory-addLeft', function () {
Bll.module.contentData.data.blocks.push(
{
"src": "",
... ... @@ -433,7 +475,7 @@ $(document).on("click", '#hotCategory-addLeft', function() {
);
Bll.renderDialog("hotCategory-template");
});
$(document).on("click", '#hotCategory-addRight', function() {
$(document).on("click", '#hotCategory-addRight', function () {
Bll.module.contentData.data.imgs.push(
{
"src": "",
... ... @@ -446,17 +488,17 @@ $(document).on("click", '#hotCategory-addRight', function() {
);
Bll.renderDialog("hotCategory-template");
});
$(document).on("click", '.hotCategory-delLeft', function() {
Bll.module.contentData.data.blocks.splice($(this).data("index"),1);
$(document).on("click", '.hotCategory-delLeft', function () {
Bll.module.contentData.data.blocks.splice($(this).data("index"), 1);
Bll.renderDialog("hotCategory-template");
});
$(document).on("click", '.hotCategory-delRight', function() {
Bll.module.contentData.data.imgs.splice($(this).data("index"),1);
$(document).on("click", '.hotCategory-delRight', function () {
Bll.module.contentData.data.imgs.splice($(this).data("index"), 1);
Bll.renderDialog("hotCategory-template");
});
//*****************************************************************//
/*图片列表*/
$(document).on("click", '#imageList-addOne', function() {
$(document).on("click", '#imageList-addOne', function () {
Bll.module.contentData.data.list.push(
{
"src": "",
... ... @@ -469,25 +511,21 @@ $(document).on("click", '#imageList-addOne', function() {
);
Bll.renderDialog("imageList-template");
});
$(document).on("click", '.imageList-del', function() {
Bll.module.contentData.data.list.splice($(this).data("index"),1);
$(document).on("click", '.imageList-del', function () {
Bll.module.contentData.data.list.splice($(this).data("index"), 1);
Bll.renderDialog("imageList-template");
});
$(document).on("click", '.is_show_name', function() {
$(document).on("click", '.is_show_name', function () {
Bll.module.contentData.data.title.is_show_name = $(this).val();
Bll.renderDialog("imageList-template");
});
$(document).on("click", '#is_show_name_Y', function() {
Bll.module.contentData.data.is_show_name = "Y";
Bll.renderDialog("brands-template");
});
$(document).on("click", '#is_show_name_N', function() {
Bll.module.contentData.data.is_show_name = "N";
Bll.renderDialog("brands-template");
$(document).on("click", '.isShow_coupon', function () {
Bll.module.contentData.data.isShow = $(this).val();
Bll.renderDialog("getCoupon-template");
});
//*****************************************************************//
/*文本导航*/
$(document).on("click", '#textNav-addOne', function() {
$(document).on("click", '#textNav-addOne', function () {
Bll.module.contentData.data.push(
{
"name": "",
... ... @@ -499,19 +537,19 @@ $(document).on("click", '#textNav-addOne', function() {
);
Bll.renderDialog("textNav-template");
});
$(document).on("click", '.textNav-delOne', function() {
$(document).on("click", '.textNav-delOne', function () {
Bll.module.contentData.data.splice($(this).data("index"), 1);
Bll.renderDialog("textNav-template");
});
//*****************************************************************//
/*推荐(标题 + 12张图)*/
$(document).on("change", '#recommendContentFive-is_show', function() {
Bll.module.contentData.data.title.is_show = 1-Bll.module.contentData.data.title.is_show;
$(document).on("change", '#recommendContentFive-is_show', function () {
Bll.module.contentData.data.title.is_show = 1 - Bll.module.contentData.data.title.is_show;
Bll.renderDialog("recommendContent-template");
});
//*****************************************************************//
/*焦点图*/
$(document).on("click", '#focus-addOne', function() {
$(document).on("click", '#focus-addOne', function () {
Bll.module.contentData.data.push(
{
"src": "",
... ... @@ -523,17 +561,17 @@ $(document).on("click", '#focus-addOne', function() {
);
Bll.renderDialog("focus-template");
});
$(document).on("click", '.focus-del', function() {
$(document).on("click", '.focus-del', function () {
Bll.module.contentData.data.splice($(this).data("index"), 1);
Bll.renderDialog("focus-template");
});
$(document).on("change", '#focus-select', function() {
$(document).on("change", '#focus-select', function () {
Bll.module.contentData.focus_type = $(this).val();
Bll.renderDialog("focus-template");
});
//*****************************************************************//
/*轮播banner*/
$(document).on("click", '#carouselBanner-addOne', function() {
$(document).on("click", '#carouselBanner-addOne', function () {
Bll.module.contentData.data.list.push(
{
"src": "",
... ... @@ -542,13 +580,13 @@ $(document).on("click", '#carouselBanner-addOne', function() {
);
Bll.renderDialog("carouselBanner-template");
});
$(document).on("click", '.carouselBanner-del', function() {
$(document).on("click", '.carouselBanner-del', function () {
Bll.module.contentData.data.list.splice($(this).data("index"), 1);
Bll.renderDialog("carouselBanner-template");
});
//*****************************************************************//
/*编辑推荐*/
$(document).on("click", '#editorTalk-addOne', function() {
$(document).on("click", '#editorTalk-addOne', function () {
Bll.module.contentData.data.list.push(
{
"src": "",
... ... @@ -561,41 +599,55 @@ $(document).on("click", '#editorTalk-addOne', function() {
);
Bll.renderDialog("editorTalk-template");
});
$(document).on("click", '.editorTalk-del', function() {
$(document).on("click", '.editorTalk-del', function () {
Bll.module.contentData.data.list.splice($(this).data("index"), 1);
Bll.renderDialog("editorTalk-template");
});
$(document).on("change", '#editorTalk-is_show', function() {
Bll.module.contentData.data.title.is_show = 1-Bll.module.contentData.data.title.is_show;
$(document).on("change", '#editorTalk-is_show', function () {
Bll.module.contentData.data.title.is_show = 1 - Bll.module.contentData.data.title.is_show;
Bll.renderDialog("editorTalk-template");
});
$(document).on("click", "#sub_btn", function() {
$(document).on("click", "#sub_btn", function () {
var data = {
"content": {},
"data_id": {},
"rId": ""
};
for(var i = 0; i < Bll.contentDatas.length; i++) {
addSuffix(Bll.contentDatas[i].contentData);
data.content[i]=JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[i].contentData));
if(Bll.contentDatas[i].id) {
data.data_id[i] = "id_"+Bll.contentDatas[i].id;
for (var i = 0; i < Bll.contentDatas.length; i++) {
var contentData = Bll.contentDatas[i].contentData;
var action;
var url;
addSuffix(contentData);
if (contentData.template_name == "kidsBrands") {
action = contentData.data.params.more_url.action || "";
url = contentData.data.params.more_url.url || "";
contentData.data.params.more_url = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}";
}
if (contentData.template_name == "title") {
action = contentData.data.more_link.action || "";
url = contentData.data.more_link.url || "";
contentData.data.more_link = "{\"action\":\"" + action + "\",\"url\":\"" + url + "\"}";
}
data.content[i] = JSON.stringify(common.util.__ArrayToObj(contentData));
data.content[i] = JSON.stringify(common.util.__ArrayToObj(Bll.contentDatas[i].contentData));
if (Bll.contentDatas[i].id) {
data.data_id[i] = "id_" + Bll.contentDatas[i].id;
}
}
data.rId = param;
data.content = JSON.stringify(data.content);
data.data_id = JSON.stringify(data.data_id);
common.util.__ajax({
url: "/resource/content/addResContent",
url: "/resources/addResContent",
data: data
},function(res) {
window.location.href=window.location.href;
}, function (res) {
window.location.href = window.location.href;
});
});
var addSuffix = function(contentData) {
if( typeof contentData == "object") {
var addSuffix = function (contentData) {
if (typeof contentData == "object") {
for (var i in contentData) {
if (i == "src" && contentData[i].indexOf("?") == -1) {
contentData[i] = contentData[i] + "?imageView/{mode}/w/{width}/h/{height}";
... ... @@ -663,7 +715,7 @@ var goodsgird = new common.grid({
}]
});
//搜索按钮
$(document).on("click", "#search", function() {
$(document).on("click", "#search", function () {
goodsgird.reload();
});
//点击“选择标签”按钮(添加商品)
... ... @@ -694,7 +746,7 @@ $(document).on("click", "#goodsSelectBtn", function () {
});
//点击“添加组”按钮(添加商品组)
$(document).on("click", "#goodsaddBtn", function () {
if(Bll.module.contentData.data[0].list.length){
if (Bll.module.contentData.data[0].list.length) {
Bll.module.contentData.data.push(Button[5].data[0]);
}
Bll.__render("#groupsgoods", "template_dialog_remgoodsgroup", Bll.module);
... ... @@ -731,9 +783,37 @@ $(document).on("click", ".goodsSelectBtn", function () {
goodsgird.init('/yohosearch/search');
});
//删除图片按钮
$(document).on("click", ".removepic", function() {
$(document).on("click", ".removepic", function () {
Bll.module.contentData.data.splice($(this).data("index"), 1);
$("#goodspic").html(common.util.__template2($("#template_dialog_goodsimgs").html(), {
datas: Bll.module.contentData.data
}));
});
$(document).on("mouseover","#add-content .dragItem",function(){
var drag = new common.drag("#add-content", Bll.contentDatas, function(data){
Bll.contentDatas = data;
Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
})
drag.Initialize();
});
$(document).on("mouseleave","#add-content .dragItem",function(){
new common.drag("#add-content").destroy();
});
/*
$(document).on("mouseover","#sortable .dragItem",function(){
//console.log(Bll.module.contentData.data.list);
var drag = new common.drag("#sortable", Bll.module.contentData.data.list, function(data){
Bll.module.contentData.data.list = data;
console.log(Bll.module.contentData);
console.log(Bll.module);
Bll.renderDialog("paramsGroup-template");
//Bll.__render("#sortable","paramsGroup-template",{modules:Bll.module});
})
drag.Initialize();
});
$(document).on("mouseleave","#sortable .dragItem",function(){
new common.drag("#sortable").destroy();
});
*/
... ...
... ... @@ -12,21 +12,21 @@ var resSorts = {},
/*导航栏筛选*/
common.util.__ajax({
url: "/resources/resourceManage/getResSorts",//获取所有资源
url: "/resources/getResSorts",//获取所有资源
data: {}
},function(res) {
$("#category-content").html(common.util.__template2($("#search-category").html(), res));
new common.dropDown({el: "#choose-category"});
resSorts = res;
resSorts = res.data;
},true);
common.util.__ajax({
url: "/resources/resourceManage/getResPlatforms",//获取所有平台
url: "/resources/getResPlatforms",//获取所有平台
data: {}
},function(res) {
$("#platform-content").html(common.util.__template2($("#search-platform").html(), res));
new common.dropDown({el: "#choose-platform"});
resPlatforms = res;
resPlatforms = res.data;
},true);
var g = new common.grid({
... ... @@ -59,7 +59,7 @@ var g = new common.grid({
]
});
g.init("/resources/resourceManage/queryResource");
g.init("/resources/queryResource");
var Bll = {
... ... @@ -108,7 +108,10 @@ var Bll = {
$(document).on("click", "#add-resource", function () {
var item = {};
Bll.toast("/resources/resourceManage/saveResource", item, "新增资源");
item.resSorts = resSorts;
item.resPlatforms = resPlatforms;
console.log(item);
Bll.toast("/resources/saveResource", item, "新增资源");
});
$(document).on("click", "#filter-btn",function() {
... ... @@ -117,14 +120,16 @@ $(document).on("click", "#filter-btn",function() {
$(document).on("click", ".add2", function() {
var item = g.rows[$(this).data("index")];
Bll.toast("/resources/resourceManage/saveResource", item, "编辑资源");
item.resSorts = resSorts;
item.resPlatforms = resPlatforms;
Bll.toast("/resources/saveResource", item, "编辑资源");
});
$(document).on("click", ".delbtn", function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("警告", "是否确认删除?",function() {
common.util.__ajax({
url: "/resources/resourceManage/deleteResourceById",
url: "/resources/deleteResourceById",
data: {id: item.id}
}, function () {
g.reload();
... ...
... ... @@ -87,7 +87,7 @@ var Bll = {
},
init: function() {
common.util.__ajax({
url:'/resource/sort/resSortIndex',
url:'/resources/resSortIndex',
data:{}
},function(res){
platformList = res.data.platform;
... ... @@ -103,12 +103,12 @@ Bll.init();
$(document).on('click', '#add-resource', function() {
var item = {};
Bll.toast("/resource/sort/addResSort", item, "添加资源分类");
Bll.toast("/resources/addResSort", item, "添加资源分类");
});
$(document).on('click', '.add2', function() {
var item = g.rows[$(this).data("index")];
Bll.toast("/resource/sort/updateResSort", item, "修改资源分类");
Bll.toast("/resources/updateResSort", item, "修改资源分类");
});
$(document).on('click', '.delbtn', function() {
... ... @@ -117,7 +117,7 @@ $(document).on('click', '.delbtn', function() {
"确认删除?",
function() {
common.util.__ajax({
url:'/resource/sort/deleteResourcesSort',
url:'/resources/deleteResourcesSort',
data:{sortId:item.sortId}
},function() {
Bll.init();
... ...
... ... @@ -20,11 +20,12 @@ var config = {
//http://172.16.6.124:8088/platform/product/queryAllProductAttr
//domain: 'http://172.16.6.146:8088/platform', //玛丽
//domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超
//domain: 'http://192.168.102.202:8088/platform',
domain: 'http://192.168.102.202:8088/platform',
//domain:'http://172.16.6.231:8080/platform',//王伟
//domain: 'http://172.16.6.239:8080', //孙杰翔
//domain:'http://172.16.6.189:8088/platform', //李健1
//domain:'http://192.168.102.216:8180/platform', //李健2
domain: 'http://172.16.6.243:8088/platform', //谭玲
//domain: 'http://172.16.6.243:8088/platform', //谭玲
//domain: 'http://172.16.6.204:8088/platform', //陆斌斌
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
loggers: {
... ...
... ... @@ -14,13 +14,13 @@ exports.res = [
src: '/sourceManage/platformManage'
},
{
route: '/resource/platform/findResPlatforms',
route: '/resources/findResPlatforms',
method: 'POST',
url: '/resources/findResPlatforms',
params: []
},
{
route: '/resource/platform/addResPlatform',
route: '/resources/addResPlatform',
method: 'POST',
url: '/resources/addResPlatform',
params: [
... ... @@ -30,7 +30,7 @@ exports.res = [
]
},
{
route: '/resource/platform/updateResPlatform',
route: '/resources/updateResPlatform',
method: 'POST',
url: '/resources/updateResPlatform',
params: [
... ... @@ -41,7 +41,7 @@ exports.res = [
]
},
{
route: '/resource/platform/deleteResPlatform',
route: '/resources/deleteResPlatform',
method: 'POST',
url: '/resources/deleteResPlatform',
params: [
... ...
... ... @@ -10,13 +10,13 @@ exports.domain = 'http://172.16.6.231:8080/platform';
exports.res = [
{
route: "/resource/index/index1",
route: "/resource/index/index",
method: "GET",
view: "pages/sourceManage/resourceManage",
src: "/sourceManage/resourceManage"
},
{
route: "/resources/resourceManage/queryResource",
route: "/resources/queryResource",
method: "POST",
url: "/resources/queryResource",
params: [
... ... @@ -27,19 +27,19 @@ exports.res = [
]
},
{
route: "/resources/resourceManage/getResSorts",
route: "/resources/getResSorts",
method: "POST",
url: "/resources/getResSorts",
params: []
},
{
route: "/resources/resourceManage/getResPlatforms",
route: "/resources/getResPlatforms",
method: "POST",
url: "/resources/getResPlatforms",
params: []
},
{
route: "/resources/resourceManage/saveResource",
route: "/resources/saveResource",
method: "POST",
url: "/resources/saveResource",
params: [
... ... @@ -51,7 +51,7 @@ exports.res = [
]
},
{
route: "/resources/resourceManage/deleteResourceById",
route: "/resources/deleteResourceById",
method: "POST",
url: "/resources/deleteResourceById",
params: [
... ... @@ -66,7 +66,7 @@ exports.res = [
src: '/sourceManage/resourceContentManage'
},
{
route: "/resource/content/resContentIndex",
route: "/resources/resContentIndex",
method: "POST",
url: "/resources/resContentIndex",
params: [
... ... @@ -74,7 +74,7 @@ exports.res = [
]
},
{
route: "/resource/content/addResContent",
route: "/resources/addResContent",
method: "POST",
url: "/resources/addResContent",
params: [
... ... @@ -84,7 +84,7 @@ exports.res = [
]
},
{
route: "/resource/content/delResContent",
route: "/resources/delResContent",
method: "POST",
url: "/resources/delResContent",
params: [
... ...
... ... @@ -15,13 +15,13 @@ exports.res = [
src: '/sourceManage/resourceSortManage'
},
{
route: '/resource/sort/resSortIndex',
route: '/resources/resSortIndex',
method: 'POST',
url: '/resources/resSortIndex',
params: []
},
{
route: '/resource/sort/addResSort',
route: '/resources/addResSort',
method: 'POST',
url: '/resources/addResSort',
params: [
... ... @@ -31,7 +31,7 @@ exports.res = [
]
},
{
route: '/resource/sort/updateResSort',
route: '/resources/updateResSort',
method: 'POST',
url: '/resources/updateResSort',
params: [
... ... @@ -42,7 +42,7 @@ exports.res = [
]
},
{
route: '/resource/sort/deleteResourcesSort',
route: '/resources/deleteResourcesSort',
method: 'POST',
url: '/resources/deleteResourcesSort',
params: [
... ...
... ... @@ -348,6 +348,7 @@
[[each contentData.data as item index]]
<tr>
<td>[[index+1]]</td>
<!-- multiple="true" -->
<td><input type="file" name="file" id="src-[[index]]" value="[[item.src]]" data-field="[[index]].src" data-index="[[index]]" /></td>
<td>
<div class="form-group">
... ...
... ... @@ -33,7 +33,7 @@
<div class="panel-col" id="platform-content">
</div>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="filter-all" href="/resource/index/index1" class="btn btn-info">全部</a>
<a id="filter-all" href="/resource/index/index" class="btn btn-info">全部</a>
</div>
</div>
</div>
... ... @@ -76,7 +76,7 @@
<div class="col-sm-8">
<select id="sortId" name="sortId" style="width: 160px;" value="[[sortId]]" required>
<option value="">请选择资源分类</option>
[[each resSorts.data as item index]]
[[each resSorts as item index]]
<option value="[[item.sortId]]">[[item.sortName]]</option>
[[/each]]
</select>
... ... @@ -88,7 +88,7 @@
<div class="col-sm-8">
<select id="platformId" name="platformId" style="width: 160px;" value="[[platformId]]" required>
<option value="">请选择资源平台</option>
[[each resPlatforms.data as item index]]
[[each resPlatforms as item index]]
<option value="[[item.platformId]]">[[item.platformName]]</option>
[[/each]]
</select>
... ...
... ... @@ -64,9 +64,10 @@
<input class="col-sm-2 observe" type="text" value="[[contentData.data.title.title]]"
data-field="title.title" placeholder="推荐品牌">
<label class="col-sm-1 control-label">显示名称</label>
<div class="col-sm-2">
<label style="cursor: pointer;"><input type="radio" id="is_show_name_Y" name="is_show_name" value="Y"></label>
<label style="cursor: pointer;"><input type="radio" id="is_show_name_N" name="is_show_name" value="N"></label>
<div class="col-sm-2 is_show_name_brand">
<label style="cursor: pointer;"><input type="radio" name="is_show_name" value="Y"></label>
<label style="cursor: pointer;"><input type="radio" name="is_show_name" value="N"></label>
</div>
<input type="hidden" id="is_show_name" value="[[contentData.data.is_show_name]]" for="radio"/>
</div>
... ... @@ -94,19 +95,22 @@
<select class="col-sm-2 observe" value="[[contentData.data.params.param]]" data-field="params.param">
[[layout parm2_template]]
</select>
<label class="col-sm-2 control-label">附加参数值</label>
<label class="col-sm-1 control-label">附加参数值</label>
<input class="col-sm-2 observe" type="text" value="[[contentData.data.params.paramValue]]"
data-field="params.paramValue" placeholder="附加参数值">
</div>
<div class="form-group col-sm-12">
<label class="col-sm-1 control-label">更多名称</label>
<input class="col-sm-2 observe" type="text" value="[[contentData.data.params.more]]"
data-field="params.more" placeholder="更多名称">
<label class="col-sm-1 control-label">跳转目的</label>
<select name="goTo" class="col-sm-2 observe" value="[[contentData.data.params.more]]"
data-field="params.more">
<select name="goTo" class="col-sm-2 observe" value="[[contentData.data.params.more_url.action]]"
data-field="params.more_url.action">
[[layout action_template]]
</select>
<label class="col-sm-1 control-label">链接</label>
<input value="[[contentData.data.params.more_url]]" class="col-sm-2 observe" required="required"
data-field="params.more_url"/>
<input value="[[contentData.data.params.more_url.url]]" class="col-sm-2 observe" required="required"
data-field="params.more_url.url"/>
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
... ... @@ -125,13 +129,16 @@
<tbody>
[[each contentData.data.list as item index]]
<tr>
<td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src"/>
<td><input type="file" name="file" value="[[item.src]]" class="observe"
data-field="list.[[index]].src"/>
</td>
<td>
[[if contentData.template_name=='kidsBrands']]
title:<input class="col-sm-8 observe" type="text" value="[[item.title]]" data-field="list.[[index]].title">
title:<input class="col-sm-8 observe" type="text" value="[[item.title]]"
data-field="list.[[index]].title">
[[else]]
name:<input class="col-sm-8 observe" type="text" value="[[item.name]]" data-field="list.[[index]].name">
name:<input class="col-sm-8 observe" type="text" value="[[item.name]]"
data-field="list.[[index]].name">
[[/if]]
</td>
<td>
... ... @@ -162,7 +169,7 @@
<div class="form-group" name="[[brand.name]]">
[[each brand.items as item __index ]]
<a class="btn">
<input type="checkbox" value="[[item.id]]" name="brandCheckBox" >
<input type="checkbox" value="[[item.id]]" name="brandCheckBox">
<label>[[item.brand_name]]</label>
</a>
[[/each]]
... ... @@ -182,3 +189,133 @@
<option value="promotion">促销id</option>
<option value="msort">大分类ID</option>
</script>
<!-- 9-1 标题标签 -->
<script type="text/template" id="title-template">
<div class="rows">
<div class="form-group col-sm-12">
<label class="col-sm-1 control-label">标题名称</label>
<input class="col-sm-2 observe" type="text" value="[[contentData.data.title_name]]"
data-field="title_name">
<label class="col-sm-1 control-label">更多名称</label>
<input class="col-sm-2 observe" type="text" value="[[contentData.data.more_name]]"
data-field="more_name">
</div>
<div class="form-group col-sm-12">
<label class="col-sm-1 control-label">跳转目的</label>
<select name="goTo" class="col-sm-2 observe" value="[[contentData.data.more_link.action]]"
data-field="more_link.action">
[[layout action_template]]
</select>
<label class="col-sm-1 control-label">链接</label>
<input value="[[contentData.data.more_link.url]]" class="col-sm-2 observe" required="required"
data-field="more_link.url"/>
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
</div>
<div class="panel-body">
<div>
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>标签名称</th>
<th>导航链接</th>
</tr>
</thead>
<tbody>
[[each contentData.data.nav as item index]]
<tr>
<td>
[[index+1]]
</td>
<td>
<input value="[[item.name]]" class="col-sm-6 observe" required="required"
data-field="nav.[[index]].name" placeholder="标签名称"/>
</td>
<td>
<div class="col-sm-12">
<select name="goTo" class="col-sm-4 observe" value="[[item.url.action]]"
data-field="nav.[[index]].url.action">
[[layout action_template]]
</select>
<div class="col-sm-1"></div>
<input value="[[item.url.url]]" class=" col-sm-4 observe" required="required"
data-field="nav.[[index]].url.url" placeholder="链接"/>
<p style="color:#999;margin-top: 5px;">链接中不能有英文单引号</p>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
<a href="JavaScript:;" id="nav-addOne" class="btn btn-primary btn-xs">添加一个</a>
</div>
</script>
<!-- 添加图标、楼层 -->
<script type="text/template" id="getCoupon-template">
<div class="panel-body">
<div>
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>标题内容</th>
<th>图片</th>
<th>选项</th>
</tr>
</thead>
<tbody>
[[each contentData.data as item index]]
<tr>
<td>
<div class="form-group">
<input value="[[item.title]]" class="form-control observe" required="required"
data-field="[[index]].title" placeholder="标题内容"/>
</div>
</td>
<td>
<div class="form-group">
<input type="file" name="file" value="[[item.image.src]]" class="form-control observe"
data-field="[[index]].image.src"/>
</div>
</td>
<td>
<div class="form-group">
<div class="isShow_coupon form-control">
<label style="cursor: pointer;"><input type="radio" name="isShow" value="YES"></label>
<label style="cursor: pointer;"><input type="radio" name="isShow" value="NO"></label>
</div>
<input type="hidden" id="isShow_coupon" value="[[contentData.data.isShow]]" for="radio"/>
</div>
<div class="form-group">
<input value="[[item.couponID]]" class="form-control observe" required="required"
data-field="[[index]].couponID" placeholder="码"/>
<p style="color:#999;margin-top: 5px;">多个以英文逗号隔开</p>
</div>
<div class="form-group">
<select name="goTo" class="form-control observe" value="[[item.image.url.action]]"
data-field="[[index]].image.url.action">
[[layout action_template]]
</select>
</div>
<div class="form-group">
<input value="[[item.image.url.url]]" class="form-control observe" required="required"
data-field="[[index]].image.url.url" placeholder="图片链接"/>
<p style="color:#999;margin-top: 5px;">链接中不能有英文单引号</p>
</div>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
<a href="JavaScript:;" id="coupon-addOne" class="btn btn-primary btn-xs">添加一个</a>
</div>
</script>
... ...
... ... @@ -439,11 +439,11 @@
<div id="paramsGroup-bottom">
<ul id="sortable" class="sortable" style="margin:10px;width:100%;">
[[each contentData.data.list as item index]]
<li>
<li class="dragItem">
<table style="width:100%;z-index:-1;">
<tbody>
<tr>
<td width="100px">标题:<input type="text" required style="width: 60px;" class="observe" value="[[item.title]]" data-field="list.[[index]].title"></td>
<td width="100px">标题:<input class="abc" type="text" required style="width: 60px;" class="observe" value="[[item.title]]" data-field="list.[[index]].title"></td>
<td>参数:<input type="text" style="width:300px;" class="observe" value="[[item.params]]" data-field="list.[[index]].params"></td>
<td><button class="btn btn-danger btn-sm paramsGroupDel" type="button" data-index="[[index]]">删除</button></td>
</tr>
... ...
<script type="text/template" id="template_content">
<!-- 文本内容 -->
[[each modules as module index]]
<li class="form-group custom-group" data-index="[[index]]" style="width: 100%">
<li class="form-group custom-group dragItem" data-index="[[index]]" style="width: 100%">
[[if module.contentData.template_name=='text']]
<div class="col-sm-12"><h3>[[module.contentData.data.text]]</h3></div>
[[else if module.contentData.template_name=='singleImage']]
... ... @@ -260,32 +260,37 @@
<script type="text/template" id="template_default_1">
<option value="">选择跳转目的</option>
<option value="brand">品牌列表页</option>
<option value="productDetail">商品详情页</option>
<option value="coupon">优惠券页</option>
<option value="fav">收藏列表页</option>
<option value="mine">我的页面</option>
<option value="list">列表或搜索页</option>
<option value="attention">关注页</option>
<option value="plus">plus</option>
<option value="star">star</option>
<option value="new">新品到着页</option>
<option value="sale">折扣页</option>
<option value="h5">h5网页</option>
<option value="guangchannel">逛频道</option>
<option value="gender">男女首页</option>
<option value="activity">app活动页</option>
<option value="home" selected="selected">频道首页</option>
<option value="yohood">YOHOOD</option>
<option value="top100">热销排行</option>
<option value="activitytemplate">活动模板</option>
<option value="globalpurchase">全球购</option>
<option value="subchannel">二级频道</option>
<option value="guangchannel">逛频道或SHOW晒单页</option>
<option value="showgoods">去晒单</option>
<option value="limitpurchase">尖货频道</option>
<option value="vippro">会员商品</option>
<option value="shortsize">断码页</option>
<option value="discountmarket">折扣专区</option>
<option value="discountmarketpro">折扣专区详情页</option>
<option value="">选择跳转目标</option>
<option value="go.brand">品牌列表页</option>
<option value="go.productDetail">商品详情页</option>
<option value="go.coupon">优惠券页</option>
<option value="go.fav">收藏列表页</option>
<option value="go.mine">我的页面</option>
<option value="go.list">列表或搜索页</option>
<option value="go.attention">关注页</option>
<option value="go.plus">plus</option>
<option value="go.star">star</option>
<option value="go.new">新品到着页</option>
<option value="go.sale">折扣页</option>
<option value="go.share">分享</option>
<option value="go.h5">h5网页</option>
<option value="go.weblogin">h5网页调用本地登录</option>
<option value="go.guangchannel">逛频道</option>
<option value="go.gender">男女首页</option>
<option value="go.activity">app活动页</option>
<option value="go.home">频道首页</option>
<option value="go.yohood">YOHOOD</option>
<option value="go.top100">热销排行</option>
<option value="go.activitytemplate">活动模板</option>
<option value="go.globalpurchase">全球购</option>
<option value="go.subchannel">二级频道</option>
<option value="go.guangchannel">逛频道或SHOW晒单页</option>
<option value="go.showgoods">去晒单</option>
<option value="go.limitpurchase">尖货频道</option>
<option value="go.vippro">会员商品</option>
<option value="go.shortsize">断码页</option>
<option value="go.discountmarket">折扣专区</option>
<option value="go.discountmarketpro">折扣专区详情页</option>
<option value="go.signin">签到页</option>
<option value="go.playvideo">视频播放</option>
</script>
\ No newline at end of file
... ...