Authored by 周奇琪

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

Showing 100 changed files with 1271 additions and 332 deletions

Too many changes to show.

To preserve performance only 100 of 100+ files are displayed.

... ... @@ -30,8 +30,7 @@ var server_dir = '../server';
var dist_dir = {
js: 'dist/' + config.name + '/' + config.version,
css: 'dist/' + config.name + '/' + config.version,
image: assets_dir + '/images',
font: assets_dir + '/fonts'
assets: assets_dir,
};
var cdn_domain = 'http://cdn.yoho.cn/';
... ... @@ -82,30 +81,17 @@ gulp.task("clean",function(){
gulp.task("buildjs",["js"],function(){
gulp.src(path.join(public_dir,"dist") + '/*.js')
.pipe(uglify())
// .pipe(rename({
// suffix:md5
// }))
.pipe(gulp.dest(dist_dir.js));
});
//发布静态资源
gulp.task('assets', function() {
gulp.src(public_dir + '/images/**')
.pipe(gulp.dest(dist_dir.image));
gulp.src(public_dir + '/fonts/*')
.pipe(gulp.dest(dist_dir.font));
gulp.src(public_dir + '/assets/**')
.pipe(gulp.dest(dist_dir.assets));
gulp.src(path.join(public_dir,"dist") + '/*.css')
.pipe(minifycss())
.pipe(gulp.dest(dist_dir.css));
// var str=fs.readFileSync(public_dir + '/css/all.css','utf-8');
// attr=str.replace(/(\n|\r)*/g,'').replace(/(\n)+@import url\(\'/g,function(name){
// return public_dir + '/css/';
// }).replace(/\'\)/g,'').split(';');
// gulp.src(attr)
// .pipe(concat('all.css'))
// .pipe(minifycss())
// .pipe(gulp.dest(dist_dir.css))
});
//配置静态资源文件
... ...
... ... @@ -39,6 +39,7 @@ function batchExport(el, type) {
console.log("params",params);
loadModal = common.dialog.load();
$("#message").html('');
//$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", ""));
},
... ... @@ -76,3 +77,19 @@ $(document).on("change","#brandId",function(){
}
});
function __ajaxExeclById(unquid){
var fn=arguments.callee;
common.util.__ajax({
url:'',
data:{unquid:unquid}
},function(res){
if(res.data){
$("#message").html('');
//成功操作
}else{
fn.call(null,unquid);
}
});
}
... ...
... ... @@ -6,12 +6,18 @@ var $ = require('jquery'),
var RESPONSEDATA={};
/*获取基础商品数据*/
var param = location.href.match(/(add|update|update2)\/(\d+)/);
if(param){
var param = location.href.slice(location.href.indexOf("update")).match(/\/\d+/g);
// console.log(param);
if(param&&param.length==2){
param[0]=param[0].replace(/\//,'');
param[1]=param[1].replace(/\//,'');
common.util.__ajax({
url:'/base/goods/getData',
async:false,
data:{productSkn:param[2]}
data:{
productSkn:param[0],
isAuditing:param[1]
}
},function(res){
RESPONSEDATA=res.data;
},true);
... ... @@ -229,6 +235,11 @@ var g=new common.grid({
warp.find(".w-goods-text").prop("readonly",true).prop("disabled",true);
warp.find("input[name=file]").prop("readonly",true).prop("disabled",true);
warp.find(".modelCode").prop("readonly",true).prop("disabled",true);
// 如果为undefind,则清除require,并且设置为空
if(warp.find(".modelCode").val()=="undefined"){
warp.find(".modelCode").removeAttr("required").val('');
}
//
warp.find(".sortdelete").remove();
}
}
... ... @@ -422,6 +433,7 @@ e.on("validate",function(){
return "请选择完整的分类目录";
});
e.on("validate",function(){
console.log(g.__gsm);
if(g.__rows.length==0){
return "请添加销售属性";
}
... ... @@ -435,11 +447,41 @@ e.on("validate",function(){
_count++;
return;
}
//RESPONSEDATA.productSkn
console.log("item1.barCode",item1.barCode)
map[gname+"_"+item1.sizeId]="";
if(map2.hasOwnProperty(item1.barCode)){
_count1++;
//修改
if(RESPONSEDATA.productSkn){
if(index1>g.__gsm[index]-1){
//大于原来的计算
if(map2.hasOwnProperty(item1.barCode)){
_count1++;
}
map2[item1.barCode]="";
console.log("大于原来的计算",item1.barCode+":"+_count1);
}else{
//小于原来,并且有值
if(item1.barCode){
if(map2.hasOwnProperty(item1.barCode)){
_count1++;
}
map2[item1.barCode]="";
console.log("小于原来,并且有值",_count1);
}
console.log("没值",_count1);
}
}else{
//添加时候计算
if(item1.barCode){
if(map2.hasOwnProperty(item1.barCode)){
_count1++;
}
map2[item1.barCode]="";
}
console.log("添加时候计算",_count1);
}
map2[item1.barCode]="";
if(g.__gsm[index]&&index1<g.__gsm[index]){
return;
}
... ... @@ -450,11 +492,16 @@ e.on("validate",function(){
if(_count>0){
return "同一颜色包含两组相同尺码";
}
if(_count1>0){
return "商品条码不能重复";
}else{
if(map3.length>0){
var ispass=true;
if(map3.indexOf("")>-1){
ispass="商品条码不能为空";
return ispass;
}
common.util.__ajax2({
url:'/goods/base/checkSkuBarCodeExist',
async:false,
... ... @@ -483,15 +530,20 @@ e.on("validate",function(){
$(document).on("click","#btnReview",function(){
$("#btnReview").prop("disabled",true);
if(e.validate()){
common.dialog.confirm("温馨提示","<p>你确定提交吗?</p>",function(){
setTimeout(function(){
$("#btnReview").prop("disabled",false);
},3000);
e.submit($("#basicForm").attr("action"),function(option){
var select=tabTree.getAddress();
option.data.supplierId=common.util.__input("supplierId")?$("#supplierId").val():"0";
option.data.shopId=common.util.__input("shopId")?$("#shopId").val():"0";
option.data.productSkn=param?param[2]:"";
option.data.productSkn=param?param[0]:"";
option.data.maxSortId=select[0]?select[0].id:"";
option.data.middleSortId=select[1]?select[1].id:"";
option.data.smallSortId=select[2]?select[2].id:"";
... ...
... ... @@ -6,9 +6,12 @@
var $ = require('jquery'),
common = require('../common/common');
var param = location.href.match(/(info)\/(\d+)/);
/*获取基础商品数据*/
var param = location.href.slice(location.href.indexOf("info")).match(/\/\d+/g);
param[0]=param[0].replace(/\//,'');
param[1]=param[1].replace(/\//,'');
common.util.__ajax({url: '/base/goods/getData', data:{productSkn:param[2]}},function(data){
common.util.__ajax({url: '/base/goods/getData', data:{productSkn:param[0],isAuditing:param[1]}},function(data){
console.log(data.data);
data.data.attribute={"1":"普通商品","2":"赠品","3":"虚拟商品"}[""+data.data.attribute];
... ...
... ... @@ -183,7 +183,7 @@ var g = new common.grid({
{
display: "SKN", render: function (item) {
var html = [];
html.push('<a data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '" class="btn btn-info btn-xs edit-class-btn">' + item.productSkn + '</a>');
html.push('<a data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '/'+item.isAuditing+'" class="btn btn-info btn-xs edit-class-btn">' + item.productSkn + '</a>');
return html.join('');
}
... ... @@ -247,14 +247,21 @@ var g = new common.grid({
var html = [];
//判断是否是预售商品
if (item.isAdvance === "Y") {
var t = new Date(item.createTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
var formatted="";
if(item.expectArrivalTime){
var t = new Date(item.expectArrivalTime * 1000);
formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
html.push("<p>是</p>");
html.push("<p>预售库存:" + item.stock + "</p>");
html.push("<p>预计到货时间:" + formatted + "</p>");
} else {
var t = new Date(item.createTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
var formatted="";
if(item.expectShelfTime){
var t = new Date(item.expectShelfTime * 1000);
formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
html.push("<p>否</p>");
html.push("<p>预计上架时间:" + formatted + "</p>");
}
... ... @@ -390,7 +397,7 @@ var g = new common.grid({
display: "操作", render: function (item) {
var html = [];
if (item.isAuditing != 100) {
html.push('<a data-index="' + item.__index + '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/' + item.productSkn + '">修改</a>');
html.push('<a data-index="' + item.__index + '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/' + item.productSkn + '/'+item.isAuditing+'">修改</a>');
}
if (item.isAuditing == 100) {
html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn apply-success">通过</a>');
... ...
... ... @@ -76,6 +76,13 @@ toast.prototype.init = function(options) {
width: _o.width,
height: _o.height
});
if(__self.dom.body){
__self.dom.body.css({
"max-height":($(window).height()-300) + "px",
overflow: "auto"
});
}
__self.dom.wrap.on('click', '[data-id]', function(event) {
var $this = $(this);
... ...
... ... @@ -35,7 +35,7 @@ var urlObj = {
'guangGetSortList':'/guang/article/getSortList', // 逛-获取作者
'guangGetTagCategoryByStatus':'/guang/tagSort/getTagItems',
'guangCommentGetFilterItems':'/guang/comment/getItems', // 逛-评论列表-获取筛选条件
'guangPlusSatrChannel':'/guang/plustarcategory/getCategoryNames', // 逛-plus star 频道
'queryBrandByShopId': '/query/brandByshopId', //查询店铺下关联品牌
'querySupplierByShopId': '/query/supplierByshopId' //查询店铺下关联供应商
};
... ...
... ... @@ -382,13 +382,18 @@ edit.prototype = {
dataType: "json",
success: function(res) {
return false;
},
error: function(err) {
console.log(err);
return false;
}
};
callback && callback(options);
var error=options.error;
options.error=function(err){
console.log(err);
error&&error(err);
if(err.status==200){
location.href="/login";
}
return false;
}
if (!options.debug) {
$.ajax(options);
} else {
... ...
... ... @@ -116,7 +116,7 @@ grid.prototype = {
param.page = urlParam.page;
}
if (param.size == p.size) {
if (!param.size) {
param.size = urlParam.size;
}
... ... @@ -203,6 +203,7 @@ grid.prototype = {
ajax: function(param) {
var g = this,
p = this.options;
var timeid;
var ajaxOptions = {
type: 'POST',
url: p.url,
... ... @@ -225,8 +226,14 @@ grid.prototype = {
console.log("complete~~");
// p.complete && p.complete();
},
error: function() {
console.log("error~~");
error: function(res) {
console.log("error~~",res);
clearTimeout(timeid);
if (res.status==429) {
timeid=setTimeout(function(){
g.reload();
},800);
}
g.__pagination({
total: 0,
page: 0
... ...
... ... @@ -30,6 +30,8 @@ tab.prototype = {
}
g.index = index;
this.render(data);
g.active = index;
p._init && p._init(g.active);
this.bind(p.click);
return this;
},
... ... @@ -43,8 +45,12 @@ tab.prototype = {
g.active = $(this).find("a").attr("columnname");
g.key = $(this).find("a").attr("key");
g.value = $(this).find("a").attr("value");
this._init = p._init;
callback && callback.call(this);
});
},
render: function(data) {
var g = this,
... ...
... ... @@ -22,6 +22,9 @@ var util = {
}
},
error: function(err) {
if(err.status==200){
location.href="/login";
}
console.log("ajax.ERROR", err);
return false;
}
... ...
... ... @@ -205,4 +205,20 @@ if (location.hash) {
$('.floatnav').find('li[name="' + hashPos + '"]').trigger('click');
}, 500);
}
// alert(location.hash.replace(/^#/,'').split(',')[0]);
try {
$(".floatnav li").each(function() {
var name = $.trim($(this).data('pos')),
that = this;
console.log(name);
if (name == location.hash.replace(/^#/, '')) {
setTimeout(function() {
$(that).click();
}, 500);
}
});
} catch (e) {
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,8 @@ var ENUM = {
},
attribute: {
1: '普通',
2: '赠品'
2: '赠品',
3: '虚拟商品'
},
tab: {
'1': 0,
... ... @@ -59,68 +60,6 @@ new common.dropDown({
hash: true
});
var editPostion = '';
var t = new common.tab({
el: "#basicTab",
click: function() {
g.options.columns[11].hidden = true;
g.options.columns[8].hidden = true;
g.options.page = 1;
var columnname = $(this).find('a').attr('columnname');
if (columnname == 3) {
g.options.columns[11].hidden = false;
} else if (columnname == 2) {
g.options.columns[8].hidden = false;
};
if (columnname == 1 || columnname == 2) {
editPostion = '#position9';
} else {
editPostion = '';
}
g.init($("#gridurl").val());
},
columns: [{
name: "0",
value: '8,3,2',
display: "上架前({1})"
}, {
name: "1",
value: '4,1,0,5,6',
display: "上架后({2})"
}, {
name: "2",
value: '1',
display: "搜索/标签({3})"
}, {
name: "3",
value: '1',
display: "上架后信息缺失({4})"
}, {
name: "all",
value: 'all',
display: "全部商品({all})"
}]
}).init(ENUM.tab);
//tab
var loadtab = function() {
t.active = undefined;
setTimeout(function() {
common.util.__ajax({
url: '/goods/product/queryTabProductNum',
data: g.options.parms()
}, function(res) {
var __dt = $.extend({}, ENUM.tab, res.data);
t.init(__dt);
}, true);
}, 400);
}
loadtab();
var g = new common.grid({
el: "#basicTable",
parms: function() {
... ... @@ -273,7 +212,17 @@ var g = new common.grid({
display: '缺失信息',
hidden: true,
render: function(item) {
return '<p style="color: red;">' + item.missInfo + '</p>'
var html = [];
html.push('<p style="color: red;">');
var arr = item.missInfo.split(',');
for (var i in arr) {
var item1 = $.trim(arr[i]);
if (item) {
html.push('<a href="/goods/netsale/edit/' + item.productSkn + editPostion + '#' + item1 + '">' + item1 + '</a>');
}
}
html.push('</p>');
return html.join('');
}
}, {
display: '操作',
... ... @@ -292,6 +241,69 @@ var g = new common.grid({
}
}]
});
var editPostion = '';
var t = new common.tab({
el: "#basicTab",
_init: function(active) {
g.options.columns[11].hidden = true;
g.options.columns[8].hidden = true;
g.options.page = 1;
if (active == 3) {
g.options.columns[11].hidden = false;
} else if (active == 2) {
g.options.columns[8].hidden = false;
};
if (active == 1 || active == 2) {
editPostion = '#position9';
} else {
editPostion = '';
}
},
click: function() {
this._init(t.active);
g.init($("#gridurl").val());
},
columns: [{
name: "0",
value: '8,3,2',
display: "上架前({1})"
}, {
name: "1",
value: '4,1,0,5,6',
display: "上架后({2})"
}, {
name: "2",
value: '1',
display: "搜索/标签({3})"
}, {
name: "3",
value: '1',
display: "上架后信息缺失({4})"
}, {
name: "all",
value: 'all',
display: "全部商品({all})"
}]
}).init(ENUM.tab);
//tab
var loadtab = function() {
t.active = undefined;
setTimeout(function() {
common.util.__ajax({
url: '/goods/product/queryTabProductNum',
data: g.options.parms()
}, function(res) {
var __dt = $.extend({}, ENUM.tab, res.data);
t.init(__dt);
}, true);
}, 400);
}
loadtab();
g.init($("#gridurl").val());
//筛选
... ... @@ -315,6 +327,7 @@ function shelveModal(title, html) {
return;
}
console.log(g.selected);
$.each(selectedArr, function(i, value) {
productSknList.push(value['productSkn']);
});
... ... @@ -324,6 +337,10 @@ function shelveModal(title, html) {
content: html
});
if (len === 1 && g.selected[0].isAdvance === 'N') {
$('#advanceBeginTime, #advanceEndTime').prop('disabled', true);
}
var e = new common.edit('.shelve-form');
e.init();
... ... @@ -416,7 +433,6 @@ var shelveTable = new common.grid({
}, {
display: '<div class="subhhead"><span>SKU</span><span>尺码</span><span>库存</span><span>SKU上架操作</span><span>SKU上架操作</span></div>',
render: function(item) {
console.log(item);
return common.util.__template2($("#template2").html(), item)
}
}]
... ... @@ -462,7 +478,6 @@ function getdata(Skn, callback) {
$(document).on("click", ".btnskc", function() {
var item = goodsList[$(this).data("index")];
console.log(item);
common.util.__ajax({
url: '/goods/product/updateGoodsStatus',
data: {
... ... @@ -475,7 +490,7 @@ $(document).on("click", ".btnskc", function() {
goodsList = res.data.goodsList;
shelveTable.init(res.data.goodsList);
});
g.init($("#gridurl").val());
}
})
});
... ...
... ... @@ -76,6 +76,7 @@ function inputDisabled(callback) {
$('.contentpanel').find('input').prop('disabled', true);
$('.contentpanel').find('select').prop('disabled', true);
$('.contentpanel').find('.btn').addClass('disabled');
$(".attr_checkobx_class").hide();
callback && callback();
}
}
... ...
... ... @@ -167,7 +167,7 @@ var t = new common.tab({
}, {
name: "3",
display: "通过({3})",
value: '4,7'
value: '1,4,7'
}, {
name: "all",
display: "全部商品",
... ...
... ... @@ -79,7 +79,7 @@ $(document).on('click', '.info-del', function() {
function articleCategoryOP(prefix, url, item) {
var a =new common.edit(".confirm", {
"bucket" : "color"
"bucket" : "author"
});
common.dialog.confirm(prefix+'作者', common.util.__template2($("#template").html(), item), function () {
... ...
/**
* Created by wangqianjun on 16/3/30.
*/
var $ = require('jquery');
common = require('../common/common');
var imgArr = [];
var ENUM = {
HotEnum: {
'1': '是',
'0': '否',
},
StatusEnum: {
1:'可用',
2:'不可用',
},
GenderEnum: {
1:'男',
2:'女',
3:'通用',
},
}
//下拉框
new common.dropDown({
el: "#g-brandId",
ajax: 'brand',
params : {
status: 1
}
});
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function () {
return {
brandId: common.util.__input('g-brandId'),
};
},
columns: [
{
display: 'ID',
name: "id"
}, {
display: '品牌名称',
name: "brandName"
}, {
display: '新品',
render: function (item) {
var value = (item.brandType == 1) ? "是" : "否";
return "<p>" + value + "</p>";
}
},{
display: '折扣',
render: function (item) {
var value = (item.brandType == 2) ? "是" : "否";
return "<p>" + value + "</p>";
}
},{
display: '推荐',
render: function (item) {
var value = (item.brandType == 3) ? "是" : "否";
return "<p>" + value + "</p>";
}
},{
display: '活动',
render: function (item) {
var value = (item.brandType == 4) ? "是" : "否";
return "<p>" + value + "</p>";
}
},{
display: '折扣价',
name: "discount"
}, {
display: '时间',
render: function (item) {
var t = new Date(item.createTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},
{
display: '操作',
//}
name: "status",
render: function (items) {
var HtmArr = [];
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">编辑</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>');
return HtmArr.join('');
}
}]
});
g.init('/guang/relationship/getList');
//==================== 按钮点击事件 =====================//
$("#filter-btn").click(function() {
g.reload(1);
});
//添加
$(document).on('click', '#add-btn', function() {
plusStarOP("新增", '/guang/relationship/addRel', {});
});
//编辑
$(document).on('click', '.info-modify', function() {
var item = g.rows[$(this).data("index")];
plusStarOP("编辑", '/guang/relationship/updateRel', item);
});
//删除
$(document).on('click', '.info-del', function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示","确定要删除该品牌?" , function() {
common.util.__ajax({
url: '/guang/relationship/delRel',
data: {
id: item.id,
}
}, function(res) {
if (res.code == 200) {
g.reload();
}
});
});
});
// 根据选择的类型来动态展示页面
$(document).on('click', 'input[name="brandType"]', function () {
console.log();
var val = $(this).val();
$('#discount').css('display', 'none');
$('#activity').css('display', 'none');
$('#activity-name').css('display', 'none');
switch (val) {
// 折扣
case '2':
{
$('#discount').css('display', 'inline');
}
break;
// 活动
case '4':
{
$('#activity').css('display', 'block');
$('#activity-name').css('display', 'block');
}
break;
default :
break;
}
})
function plusStarOP(prefix, url, item) {
if(prefix == "编辑") {
imgArr = item.activityImg||[];
} else {
imgArr = [];
}
var a = new common.edit('#templete-top');
common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () {
return a.submit(url,function(option){
//设置图片
if(imgArr.length) {
option.data.activityImg = imgArr.toString();
}
imgArr = [];
option.success=function(res){
res=res.data;
if(res.code=="200"){
a.$tip("提交成功", function() {
g.reload();
}, 'growl-success');
}else{
a.$tip(res.message);
}
return false;
},
option.error=function(res){
a.$tip(res.message);
}
});
});
a.init();
var val = $('#brandType').val();
$('#discount').css('display', 'none');
$('#activity').css('display', 'none');
$('#activity-name').css('display', 'none');
$('input[name="brandType"][value="' + val + '"]').trigger('click');
rendBoList(imgArr);
// 图片上传
uploadImage();
new common.dropDown({
el: "#brandId",
ajax: 'brand',
params : {
status: 1
}
});
}
function rendBoList (pictureBoList) {
$(".image-list").html('');
$("#addPic").append(common.util.__template2($("#imgeUpload").html(),
{
pictureBoList: pictureBoList
}
));
}
function uploadImage() {
common.edit.ajaxfileupload(".picfile", {
params: {
__type: "upload",
bucket: "relationship"
},
valid_extensions: ['png', 'jpg', 'jpeg'],
onComplete: function (response) {
if (response.status && response.code == 200) {
console.log("response", response);
if(response.data) {
imgArr.push(response.data);
rendBoList(imgArr);
}
}
else {
common.util.__tip(response.message, 'warning');
}
}
});
}
//删除单张图片
$(document).on('click', '.remove1', function () {
var index = $(this).data("index");
imgArr.splice(index, 1);
rendBoList(imgArr);
});
\ No newline at end of file
... ...
var $ = require('jquery'),
common = require('../common/common');
\ No newline at end of file
... ...
/**
* Created by wangqianjun on 16/3/30.
*/
var $ = require('jquery');
common = require('../common/common');
var ENUM = {
HotEnum: {
'1': '是',
'0': '否',
},
StatusEnum: {
1:'可用',
2:'不可用',
},
GenderEnum: {
1:'男',
2:'女',
3:'通用',
},
}
//下拉框
new common.dropDown({
el: "#g-brandId",
ajax: 'brand',
params : {
status: 1
}
});
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function () {
return {
brandType: common.util.__input('g-brandType'),
status: common.util.__input('g-status'),
brandId: common.util.__input('g-brandId'),
gender: common.util.__input('g-gender'),
};
},
columns: [
{
display: 'ID',
name: "id"
}, {
display: '品牌名称',
name: "brandName"
}, {
display: '品牌ID',
name: "brandId"
}, {
display: '频道名称',
name: "categoryName"
}, {
display: '性别',
render: function (item) {
return "<p>" + ENUM.GenderEnum[item.gender] + "</p>";
}
}, {
display: '是否可用',
render: function (item) {
return "<p>" + ENUM.StatusEnum[item.status] + "</p>";
}
},
{
display: '更新时间',
render: function (item) {
var t = new Date(item.updateTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},
{
display: '操作',
//}
name: "status",
render: function (items) {
var HtmArr = [];
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-copy">复制链接</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">查看/编辑</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>');
return HtmArr.join('');
}
}]
});
g.init('/guang/plustar/getList');
//==================== 按钮点击事件 =====================//
$("#filter-btn").click(function() {
g.reload(1);
});
//添加
$(document).on('click', '#add-btn', function() {
plusStarOP("新增", '/guang/plustar/addPlustar', {});
});
//编辑
$(document).on('click', '.info-modify', function() {
var item = g.rows[$(this).data("index")];
plusStarOP("编辑", '/guang/plustar/updatePlustar', item);
});
//删除
$(document).on('click', '.info-del', function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示","确定要删除该品牌?" , function() {
common.util.__ajax({
url: '/guang/plustar/delPlustar',
data: {
id: item.id,
}
}, function(res) {
if (res.code == 200) {
g.reload();
}
});
});
});
function plusStarOP(prefix, url, item) {
var a =new common.edit(".confirm");
common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () {
//
return a.submit(url,function(option){
option.success=function(res){
res=res.data;
if(res.code=="200"){
a.$tip("提交成功", function() {
g.reload();
}, 'growl-success');
}else{
a.$tip(res.message);
}
return false;
},
option.error=function(res){
a.$tip(res.message);
}
});
});
a.init();
new common.dropDown({
el: "#brandType",
ajax: 'guangPlusSatrChannel',
params : {
status: 1
}
});
new common.dropDown({
el: "#brandId",
ajax: 'brand',
params : {
status: 1
}
});
}
\ No newline at end of file
... ...
/**
* Created by wangqianjun on 16/3/30.
*/
var $ = require('jquery');
common = require('../common/common');
var imgArr = [];
var ENUM = {
HotEnum: {
'1': '是',
'0': '否',
},
StatusEnum: {
1:'可用',
2:'不可用',
},
GenderEnum: {
1:'男',
2:'女',
3:'通用',
},
}
//下拉框
new common.dropDown({
el: "#g-status"
});
new common.dropDown({
el: "#g-gender"
});
new common.dropDown({
el: "#g-brandType",
ajax: 'guangPlusSatrChannel',
params : {
status: 1
}
});
new common.dropDown({
el: "#g-brandId",
ajax: 'brand',
params : {
status: 1
}
});
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function () {
return {
brandType: common.util.__input('g-brandType'),
status: common.util.__input('g-status'),
brandId: common.util.__input('g-brandId'),
gender: common.util.__input('g-gender'),
};
},
columns: [
{
display: 'ID',
name: "id"
},
{
display: '品牌ID',
name: "brandId"
}, {
display: '品牌名称',
name: "brandName"
},{
display: '频道名称',
name: "categoryName"
}, {
display: '性别',
render: function (item) {
return "<p>" + ENUM.GenderEnum[item.gender] + "</p>";
}
}, {
display: '是否可用',
render: function (item) {
return "<p>" + ENUM.StatusEnum[item.status] + "</p>";
}
},
{
display: '更新时间',
render: function (item) {
var t = new Date(item.updateTime * 1000);
var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
return "<p>" + formatted + "</p>";
}
},
{
display: '操作',
//}
name: "status",
render: function (items) {
var HtmArr = [];
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-copy">复制链接</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">查看/编辑</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>');
return HtmArr.join('');
}
}]
});
g.init('/guang/plustar/getList');
//==================== 按钮点击事件 =====================//
$("#filter-btn").click(function() {
g.reload(1);
});
//添加
$(document).on('click', '#add-btn', function() {
plusStarOP("新增", '/guang/plustar/addPlustar', {});
});
//编辑
$(document).on('click', '.info-modify', function() {
var item = g.rows[$(this).data("index")];
common.util.__ajax(
{
url: '/guang/plustar/getDetail',
data: {
id: item.id,
}
}, function(res) {
//var item = res.data;
plusStarOP("编辑", '/guang/plustar/updatePlustar', res.data);
});
});
//删除
$(document).on('click', '.info-del', function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示","确定要删除该品牌?" , function() {
common.util.__ajax({
url: '/guang/plustar/delPlustar',
data: {
id: item.id,
}
}, function(res) {
if (res.code == 200) {
g.reload();
}
});
});
});
function plusStarOP(prefix, url, item) {
if(prefix == "编辑") {
imgArr = item.bannerImg||[];
} else {
imgArr = [];
}
var a =new common.edit("#templete-top", {
"bucket" : "plustar"
});
common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () {
//
return a.submit(url,function(option){
if(imgArr.length) {
option.data.bannerImg = imgArr.toString();
}
imgArr = [];
option.success=function(res){
res=res.data;
if(res.code=="200"){
a.$tip("提交成功", function() {
g.reload();
}, 'growl-success');
}else{
a.$tip(res.message);
}
return false;
},
option.error=function(res){
a.$tip(res.message);
}
});
});
a.init();
uploadImage();
rendBoList(imgArr);
new common.dropDown({
el: "#brandType",
ajax: 'guangPlusSatrChannel',
params : {
status: 1
}
});
new common.dropDown({
el: "#brandId",
ajax: 'brand',
params : {
status: 1
}
});
}
// 图片上传
function uploadImage() {
common.edit.ajaxfileupload(".picfile", {
params: {
__type: "upload",
bucket: "plustar"
},
valid_extensions: ['png', 'jpg', 'jpeg'],
onComplete: function (response) {
if (response.status && response.code == 200) {
console.log("response", response);
if(response.data) {
imgArr.push(response.data);
rendBoList(imgArr);
}
}
else {
common.util.__tip(response.message, 'warning');
}
}
});
}
function rendBoList (pictureBoList) {
$(".image-list").html('');
$("#addPic").append(common.util.__template2($("#imgeUpload").html(),
{
pictureBoList: pictureBoList
}
));
}
//删除单张图片
$(document).on('click', '.remove1', function () {
var index = $(this).data("index");
imgArr.splice(index, 1);
rendBoList(imgArr);
});
... ...
... ... @@ -47,7 +47,7 @@ var g = new common.grid({
name: "classifyName"
}, {
display: '所属标签数',
name: "classifyName"
name: "sortNum"
}, {
display: '状态',
render: function (item) {
... ...
... ... @@ -5,39 +5,100 @@
'use strict';
var $ = require('jquery');
require('yoho.bootstrap');
var isMenuShow = false;
var localStorage = window.localStorage;
/*左侧导航*/
$('.leftpanel .nav .parent>a').click(function() {
var coll = $(this).parents('.collapsed').length,
child = $(this).parent().find('.children');
if (!coll) {
$('.leftpanel .nav .parent-focus').each(function() {
$(this).find('.children').slideUp('fast');
$(this).removeClass('parent-focus');
});
if (!child.is(':visible')) {
child.slideDown('fast');
if (!child.parent().hasClass('active'))
child.parent().addClass('parent-focus');
} else {
child.slideUp('fast');
child.parent().removeClass('parent-focus');
}
var coll = $(this).parents('.collapsed').length,
child = $(this).parent().find('.children');
$(".parent ").removeClass("active");
$('.children').removeClass("active").slideUp('fast');
$(this).parent(".parent ").addClass("active");
child.slideDown('fast').addClass("active");
isMenuShow = true;
return false;
});
$(".leftpanel .nav .children a").each(function() {
var attr = $(this).attr('href');
if (!isMenuShow && attr == window.location.pathname + window.location.search) {
$(this).parents(".children").show();
$(this).parent("li").addClass("active");
$(this).parents(".parent").addClass("active");
localStorage.setItem("router", attr);
localStorage.getItem("router");
isMenuShow = true;
}
});
if (!isMenuShow && localStorage.getItem("router")) {
$(".leftpanel .nav .children a").each(function() {
var attr = $(this).attr('href');
if (localStorage.getItem("router") == attr) {
$(this).parents(".children").show();
$(this).parent("li").addClass("active");
$(this).parents(".parent").addClass("active");
isMenuShow = true;
}
return false;
});
}
// LocalStorage.setItem("router",);
$('.panel-heading').hover(function() {
$(this).find('.panel-btns').fadeIn('fast');
}, function() {
$(this).find('.panel-btns').fadeOut('fast');
});
$('.panel .panel-close').click(function() {
$(this).closest('.panel').fadeOut(200);
return false;
});
// Minimize Panel
$('.panel .panel-minimize').click(function() {
var t = $(this);
var p = t.closest('.panel');
if (!$(this).hasClass('maximize')) {
p.find('.panel-body, .panel-footer').slideUp(200);
t.addClass('maximize');
t.find('i').removeClass('fa-minus').addClass('fa-plus');
} else {
p.find('.panel-body, .panel-footer').slideDown(200);
t.removeClass('maximize');
t.find('i').removeClass('fa-plus').addClass('fa-minus');
}
return false;
});
// $(".leftpanel .nav .children a").each(function() {
// var attr = $(this).attr('href');
var timer = null;
$('.dropdown-toggle').on('mouseenter', function() {
$('.dropdown-menu').hide();
$(this).siblings('.dropdown-menu').show();
}).on('mouseleave', function() {
var that = this;
clearTimeout(timer);
timer = setTimeout(function() {
$(that).siblings('.dropdown-menu').hide();
}, 1000);
});
// if (attr == window.location.pathname + window.location.search) {
// $(this).parents(".children").show();
// $(this).parent("li").addClass("active");
// $(this).parents(".parent").addClass("parent-focus");
// }
// });
\ No newline at end of file
$('.dropdown-menu').on('mouseenter', function() {
clearTimeout(timer);
$(this).show();
}).on('mouseleave', function() {
$(this).hide();
})
\ No newline at end of file
... ...
... ... @@ -34,7 +34,7 @@ var tableGird = new common.grid({
var propsStr="";
if (common.util.__isJsonString(propType)) {
var props = JSON.parse(propType);
props.forEach(function(prop){
[].slice.call(props,0).forEach(function(prop){
propsStr += prop.name + ",";
});
} else {
... ... @@ -144,9 +144,12 @@ $(document).on('click', '.prop-del-btn', function () {
propValueGrid.__rows.splice($(this).data('index'),1);
propValueGrid.reload();
});
var timeid;
sortmenu.init(function () {
tableGird.init('/product/attr/queryProductAttributeList');
clearTimeout(timeid);
timeid=setTimeout(function(){
tableGird.init('/product/attr/queryProductAttributeList');
},600);
});
$('#add-attri').click(function () {
... ...
... ... @@ -11,6 +11,7 @@ var shopType = 1; //店铺类型 1:单品牌,2:多品牌
var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑
var ENUM = {
"editor-largePic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
"editor-largePic2":{"position":"", "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
"editor-smallPic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
"editor-brand":{"position":"", "name":"", "url":""},
"editor-recommend": {"position":"", "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"},
... ... @@ -24,7 +25,7 @@ var ENUM = {
var resourcesNew = {
"shopTopBanner":{
"id":"",
"data": [{"shopSrc": "","shopSrc0":"", "detailSrc": "", "isShowShopName": "Y"}]
"data": [{"shopSrc0":"","detailSrc0": "", "isShowShopName0": "Y", "shopSrc": "", "detailSrc": "", "isShowShopName": "Y"}]
},
"navigationBar":{
"id":"",
... ... @@ -33,10 +34,6 @@ var resourcesNew = {
"largeSlideImg":{
"id":"",
"data": [
{"position": 5, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 4, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 3, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 2, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]},
{"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}
]
},
... ... @@ -127,6 +124,12 @@ function showMain(){
}else if(shopType == 1){
$(".model-brand").hide();
}
//标签长度样式自适应
$.each($(".contentpanel-pc .model-showTitle .showTab"),function(){
if($(this).width() > 280){
$(this).css("right",(280-($(this).width()))+"px");
}
})
showEditorIconEvent();
}
//弹窗编辑主流程
... ... @@ -141,6 +144,7 @@ function editorIconEvent(title,id){
if(!(curDialogId == "editor-largePic-app" || curDialogId == "editor-recommend-app" || curDialogId == "editor-brand-app")){
freshJson(id, g.__rows, 1);
}
console.log(g.__rows);
showMain();
}else{
return false;
... ... @@ -170,20 +174,25 @@ function findDecoration(){
}
},
function(rs) {
console.log(rs.data);
console.log(rs);
if(rs.data){
jsonMain = rs.data;
}
if(jsonMain.templateName){
curTemplateType = jsonMain.templateName;
}
//没有装修信息,初始化装修信息
if($.isEmptyObject(jsonMain.resources)){
jsonMain.resources = $.extend(true,{},resourcesNew);
}
//装修信息中品牌内容为空,初始化品牌
if(jsonMain.resources.brandBrowse.data.length < 1 && jsonMain.brandList){
cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data);
if(jsonMain.brandList){
if(jsonMain.resources.brandBrowse.data.length < 1){
cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data);
}
}else{
common.util.__tip("店铺没有品牌,无法装修,请返回添加品牌!");
return;
}
if(jsonMain.templateName){
curTemplateType = jsonMain.templateName;
}
//装修json克隆
jsonClone = $.extend(true,{},jsonMain);
... ... @@ -247,7 +256,7 @@ function saveDecoration(submitStatus){
}
//Ajax审核,审核通过:300,驳回:900
function checkDecoration(checkStatus,comment){
if(comment){
if(comment){ //驳回
common.util.__ajax({
url:'/store/shop-decoration-check',
data: {
... ... @@ -256,12 +265,12 @@ function checkDecoration(checkStatus,comment){
"comment": comment
}
},function(rs){
common.util.__tip("审核通过成功!","success");
common.util.__tip("审核驳回成功!","success");
setTimeout(function() {
location.href="/supplier/check/index";
}, 1000);
},true);
}else{
}else{ //通过
common.util.__ajax({
url:'/store/shop-decoration-check',
data: {
... ... @@ -269,7 +278,7 @@ function checkDecoration(checkStatus,comment){
"checkStatus": checkStatus
}
},function(rs){
common.util.__tip("审核驳回成功!","success");
common.util.__tip("审核通过成功!","success");
setTimeout(function() {
location.href="/supplier/check/index";
}, 1000);
... ... @@ -289,11 +298,7 @@ function gridInit(id){
el:"#"+id,
columns:[
{display:"店铺banner图片", render:function(item){
if(curTemplateType == "2"){
return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
}else{
return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc0+"' />";
}
return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />";
}},
{display:"是否显示店铺名称", render:function(item){
if(item.isShowShopName == "Y"){
... ... @@ -336,20 +341,26 @@ function gridInit(id){
//店铺大图资源位
case "editor-largePic":
$('.editorTitle').html("<a href='javascript:' class='btn btn-success addBtn2' style='margin-right: 20px'><i class='fa fa-plus'></i> 添加资源大图</a><span class='largePicAddTip'></span>").css("margin-bottom","10px");
g = new common.grid({
hash: false,
el:"#"+id,
columns:[
{display:"排序", render:function(item){
item.position=item.position || (item.__index+1);
return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />";
}},
{
display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " +
{display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " +
"<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>",
render: function (item) {
return resourcesHtmlInit(item,"largePic");
}
}
},
{display:"操作", render:function(item){
if(g.__rows.length > 1){
return "<input type=button class='btn btn-warning btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />";
}
}}
]
});
g.__rows=""||jsonClone.resources.largeSlideImg.data;
... ... @@ -511,10 +522,10 @@ function gridInit(id){
return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />";
}},
{display:"开始时间", render:function(item){
return "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:end:endTime_"+item.__index+"' id='startTime_"+item.__index+"' name='startTime' value='"+item.startTime+"' data-index='"+item.__index+"' />";
return "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"' id='startTime_"+item.__index+"' name='startTime' value='"+item.startTime+"' data-index='"+item.__index+"' />";
}},
{display:"结束时间", render:function(item){
return "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:start:startTime_"+item.__index+"' id='endTime_"+item.__index+"' name='endTime' value='"+item.endTime+"' data-index='"+item.__index+"' />";
return "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"' id='endTime_"+item.__index+"' name='endTime' value='"+item.endTime+"' data-index='"+item.__index+"' />";
}},
{display:"状态", render:function(item){
return "<span style='white-space: nowrap'>" + (item.publishStatus==0?"未发布":"已发布") + "</span>";
... ... @@ -990,11 +1001,7 @@ function untilEditorEvent(id){
e.on("callback",function(obj){
if(/^file_onComplete_shopBannerImage_/.test(obj.key)){
var _index = obj.key.replace(/^file_onComplete_shopBannerImage_/,'');
if(curTemplateType == "2"){
g.__rows[_index].shopSrc = obj.data;
}else{
g.__rows[_index].shopSrc0 = obj.data;
}
g.__rows[_index].shopSrc = obj.data;
}
if(/^file_onComplete_DetailbannerImage_/.test(obj.key)){
var _index = obj.key.replace(/^file_onComplete_DetailbannerImage_/,'');
... ... @@ -1020,8 +1027,7 @@ function untilEditorEvent(id){
}
});
$("#"+id+" nav").hide();
$(".modal-dialog").css("width","900px");
$(".modal-dialog .modal-body .editor-dialog").css("max-height",($(window).height()-300) + "px");
$(".modal-dialog").css("width","960px");
$(".modal-dialog .modal-body .editor-dialog").css("overflow-y","auto");
$(".modal-dialog .modal-body .editor-dialog").css("overflow-x","hidden");
}
... ... @@ -1033,10 +1039,15 @@ function resourcesHtmlInit(item,resName){
htmlPic += "<div class='row'>" +
"<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" +
"<div class='col-sm-3'><input type=text class='form-control inputChange' name='url' value='"+ picList[i].url +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-2'>";
if(i>0){
htmlPic += "<input type=text class='form-control' disabled jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' />" +
"<span style='color: #999; font-size: 12px'>*上一条结束时间</span>";
}else{
htmlPic += "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' />";
}
htmlPic += "</div><div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-1'><span style='white-space: nowrap;'>"+ (picList[i].publishStatus==0?"未发布":"已发布") +"</span></div>" +
"<div class='col-sm-2'>";
if(i == (picList.length-1) && picList.length > 1){
... ... @@ -1189,12 +1200,28 @@ $(document).on("click",".addBtn",function(){
if(indexList.length > 1){
g.__rows[indexList[0]].data.push($.extend({},ENUM[curDialogId]));
if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic"){
(g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = (g.__rows[indexList[0]].data)[indexList[1]].endTime;
}
}else{
g.__rows.push($.extend({},ENUM[curDialogId]));
}
g.init(g.__rows);
untilEditorEvent(curDialogId);
});
//资源位大图添加一条资源位
$(document).on("click",".addBtn2",function(){
if(g.__rows.length > 4){
$(".largePicAddTip").text("* 最多只能添加5个资源位大图!").css("color","#ff0000");
return;
}else{
$(".largePicAddTip").empty();
g.__rows.push($.extend(true,{},ENUM["editor-largePic2"]));
g.init(g.__rows);
untilEditorEvent(curDialogId);
}
});
//input change同时更新json
$(document).on("change",".inputChange",function(){
var _index = $(this).attr("data-index");
... ... @@ -1206,6 +1233,14 @@ $(document).on("change",".inputChange",function(){
}else{
g.__rows[indexList[0]][_name] = $(this).val();
}
if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic"){
if($(this).attr("name") == "endTime"){
if(g.__rows[indexList[0]].data.length - 1 > indexList[1]){
$(this).parents(".row").next().children().find("input[name='startTime']").val($(this).val());
(g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = $(this).val();
}
}
}
$(this).removeClass("error");
});
//checkBox change同时更新json
... ...
var jQuery = require('jquery');
jQuery(document).ready(function() {
"use strict";
var $ = jQuery;
// Tooltip
jQuery('.tooltips').tooltip({
container: 'body'
});
// Popover
jQuery('.popovers').popover();
// Show panel buttons when hovering panel heading
jQuery('.panel-heading').hover(function() {
jQuery(this).find('.panel-btns').fadeIn('fast');
}, function() {
jQuery(this).find('.panel-btns').fadeOut('fast');
});
// Close Panel
jQuery('.panel .panel-close').click(function() {
jQuery(this).closest('.panel').fadeOut(200);
return false;
});
// Minimize Panel
jQuery('.panel .panel-minimize').click(function() {
var t = jQuery(this);
var p = t.closest('.panel');
if (!jQuery(this).hasClass('maximize')) {
p.find('.panel-body, .panel-footer').slideUp(200);
t.addClass('maximize');
t.find('i').removeClass('fa-minus').addClass('fa-plus');
jQuery(this).attr('data-original-title', 'Maximize Panel').tooltip();
} else {
p.find('.panel-body, .panel-footer').slideDown(200);
t.removeClass('maximize');
t.find('i').removeClass('fa-plus').addClass('fa-minus');
jQuery(this).attr('data-original-title', 'Minimize Panel').tooltip();
}
return false;
});
jQuery('.leftpanel .nav .parent > a').click(function() {
var coll = jQuery(this).parents('.collapsed').length;
if (!coll) {
jQuery('.leftpanel .nav .parent-focus').each(function() {
jQuery(this).find('.children').slideUp('fast');
jQuery(this).removeClass('parent-focus');
});
var child = jQuery(this).parent().find('.children');
if (!child.is(':visible')) {
child.slideDown('fast');
if (!child.parent().hasClass('active'))
child.parent().addClass('parent-focus');
} else {
child.slideUp('fast');
child.parent().removeClass('parent-focus');
}
}
return false;
});
// Menu Toggle
jQuery('.menu-collapse').click(function() {
if (!$('body').hasClass('hidden-left')) {
if ($('.headerwrapper').hasClass('collapsed')) {
$('.headerwrapper, .mainwrapper').removeClass('collapsed');
} else {
$('.headerwrapper, .mainwrapper').addClass('collapsed');
$('.children').hide(); // hide sub-menu if leave open
}
} else {
if (!$('body').hasClass('show-left')) {
$('body').addClass('show-left');
} else {
$('body').removeClass('show-left');
}
}
return false;
});
// Add class nav-hover to mene. Useful for viewing sub-menu
jQuery('.leftpanel .nav li').hover(function() {
$(this).addClass('nav-hover');
}, function() {
$(this).removeClass('nav-hover');
});
// For Media Queries
jQuery(window).resize(function() {
hideMenu();
});
hideMenu(); // for loading/refreshing the page
function hideMenu() {
if ($('.header-right').css('position') == 'relative') {
$('body').addClass('hidden-left');
$('.headerwrapper, .mainwrapper').removeClass('collapsed');
} else {
$('body').removeClass('hidden-left');
}
// Seach form move to left
if ($(window).width() <= 360) {
if ($('.leftpanel .form-search').length == 0) {
$('.form-search').insertAfter($('.profile-left'));
}
} else {
if ($('.header-right .form-search').length == 0) {
$('.form-search').insertBefore($('.btn-group-notification'));
}
}
}
collapsedMenu(); // for loading/refreshing the page
function collapsedMenu() {
if ($('.logo').css('position') == 'relative') {
$('.headerwrapper, .mainwrapper').addClass('collapsed');
} else {
$('.headerwrapper, .mainwrapper').removeClass('collapsed');
}
}
});
\ No newline at end of file
// var jQuery = require('jquery');
// jQuery(document).ready(function() {
// "use strict";
// var $ = jQuery;
// // Tooltip
// jQuery('.tooltips').tooltip({
// container: 'body'
// });
// // Popover
// jQuery('.popovers').popover();
// // Show panel buttons when hovering panel heading
// jQuery('.panel-heading').hover(function() {
// jQuery(this).find('.panel-btns').fadeIn('fast');
// }, function() {
// jQuery(this).find('.panel-btns').fadeOut('fast');
// });
// // Close Panel
// jQuery('.panel .panel-close').click(function() {
// jQuery(this).closest('.panel').fadeOut(200);
// return false;
// });
// // Minimize Panel
// jQuery('.panel .panel-minimize').click(function() {
// var t = jQuery(this);
// var p = t.closest('.panel');
// if (!jQuery(this).hasClass('maximize')) {
// p.find('.panel-body, .panel-footer').slideUp(200);
// t.addClass('maximize');
// t.find('i').removeClass('fa-minus').addClass('fa-plus');
// jQuery(this).attr('data-original-title', 'Maximize Panel').tooltip();
// } else {
// p.find('.panel-body, .panel-footer').slideDown(200);
// t.removeClass('maximize');
// t.find('i').removeClass('fa-plus').addClass('fa-minus');
// jQuery(this).attr('data-original-title', 'Minimize Panel').tooltip();
// }
// return false;
// });
// // Menu Toggle
// jQuery('.menu-collapse').click(function() {
// if (!$('body').hasClass('hidden-left')) {
// if ($('.headerwrapper').hasClass('collapsed')) {
// $('.headerwrapper, .mainwrapper').removeClass('collapsed');
// } else {
// $('.headerwrapper, .mainwrapper').addClass('collapsed');
// $('.children').hide(); // hide sub-menu if leave open
// }
// } else {
// if (!$('body').hasClass('show-left')) {
// $('body').addClass('show-left');
// } else {
// $('body').removeClass('show-left');
// }
// }
// return false;
// });
// // Add class nav-hover to mene. Useful for viewing sub-menu
// jQuery('.leftpanel .nav li').hover(function() {
// $(this).addClass('nav-hover');
// }, function() {
// $(this).removeClass('nav-hover');
// });
// // For Media Queries
// jQuery(window).resize(function() {
// hideMenu();
// });
// hideMenu(); // for loading/refreshing the page
// function hideMenu() {
// if ($('.header-right').css('position') == 'relative') {
// $('body').addClass('hidden-left');
// $('.headerwrapper, .mainwrapper').removeClass('collapsed');
// } else {
// $('body').removeClass('hidden-left');
// }
// // Seach form move to left
// if ($(window).width() <= 360) {
// if ($('.leftpanel .form-search').length == 0) {
// $('.form-search').insertAfter($('.profile-left'));
// }
// } else {
// if ($('.header-right .form-search').length == 0) {
// $('.form-search').insertBefore($('.btn-group-notification'));
// }
// }
// }
// collapsedMenu(); // for loading/refreshing the page
// function collapsedMenu() {
// if ($('.logo').css('position') == 'relative') {
// $('.headerwrapper, .mainwrapper').addClass('collapsed');
// } else {
// $('.headerwrapper, .mainwrapper').removeClass('collapsed');
// }
// }
// });
\ No newline at end of file
... ...
{
"name": "yohobuy-portal",
"version": "0.3.4",
"version": "0.3.5",
"description": "yohobuy-portal",
"keywords": [],
"homepage": "",
... ... @@ -15,8 +15,7 @@
"dependencies": {
"jquery": "2.1.4",
"import-style": "1.0.0",
"yoho.handlebars": "3.0.3",
"yoho.bootstrap": "0.0.4"
"yoho.handlebars": "3.0.3"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
... ... @@ -7,9 +7,9 @@
.edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;}
.edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)}
.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('../images/upload1.png')}
.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('../assets/images/upload1.png')}
.edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;}
.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('../images/upload2.png')}
.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('../assets/images/upload2.png')}
.edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px;
color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;}
... ... @@ -38,5 +38,5 @@
/*common*/
.edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;}
.edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;}
.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('../images/close.png');width:17px;height:17px;cursor:pointer;z-index:1}
.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('../assets/images/close.png');width:17px;height:17px;cursor:pointer;z-index:1}
.edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;}
... ...
... ... @@ -107,8 +107,8 @@ ul {
border: 1px solid #ddd;
margin: 0;
padding-left: 20px;
background: #fff url("/images/ico-search.png") 4px center no-repeat;
background-image: -webkit-image-set(url("/images/ico-search.png") 1x, url("/images/ico-search@2x.png") 2x);
background: #fff url("../assets/images/ico-search.png") 4px center no-repeat;
background-image: -webkit-image-set(url("../assets/images/ico-search.png") 1x, url("../assets/images/ico-search@2x.png") 2x);
border-radius: 2px;
-webkit-transition: width linear 0.25s;
-moz-transition: width linear 0.25s;
... ...
... ... @@ -58,7 +58,7 @@
position:absolute;
top: 10px;
right: 10px;
background: url(../images/close-white.png) no-repeat center center;
background: url(../assets/images/close-white.png) no-repeat center center;
cursor:pointer;
width:10px;
height:11px;
... ...
... ... @@ -66,8 +66,8 @@
margin: 0;
padding:0;
background-repeat: no-repeat;
background-image: url(../images/icons.png);
background-image: url(../images/icons.gif) \9;
background-image: url(../assets/images/icons.png);
background-image: url(../assets/images/icons.gif) \9;
}
/*状态反射*/
... ... @@ -230,8 +230,8 @@
*zoom:1;
width: 8px;
height: 20px;
background: url(../images/icons.png) -741px 0;
_background: url(../images/icons.gif) -741px 0;
background: url(../assets/images/icons.png) -741px 0;
_background: url(../assets/images/icons.gif) -741px 0;
}
.edui-btn-toolbar .edui-splitbutton,
... ... @@ -295,8 +295,8 @@
width: 12px;
margin: 0;
padding: 0;
background: url(../images/icons.png) -741px 0;
_background: url(../images/icons.gif) -741px 0;
background: url(../assets/images/icons.png) -741px 0;
_background: url(../assets/images/icons.gif) -741px 0;
}
.edui-btn-toolbar .edui-combobox.edui-disabled{
opacity: 0.2;
... ... @@ -352,7 +352,7 @@
height: 25px;
background: red;
vertical-align: bottom;
background: url(../images/ok.gif) no-repeat 1000px 1000px;
background: url(../assets/images/ok.gif) no-repeat 1000px 1000px;
}
.edui-combobox-menu .edui-combobox-checked .edui-combobox-icon {
... ... @@ -514,7 +514,7 @@
margin-top: 2px;
padding: 1px;
border: 0;
background: url("../images/close.png") no-repeat center center;
background: url("../assets/images/close.png") no-repeat center center;
cursor: pointer;
}
.edui-modal-header .edui-close.edui-hover {
... ... @@ -604,7 +604,7 @@
}
.edui-popup{
display: none;
background: url('../images/pop-bg.png') repeat #fff;
background: url('../assets/images/pop-bg.png') repeat #fff;
padding: 2px;
}
.edui-popup .edui-popup-body{
... ... @@ -616,10 +616,10 @@
height: 11px;
}
.edui-popup .edui-popup-caret.up{
background:url('../images/caret.png') no-repeat 0 0;
background:url('../assets/images/caret.png') no-repeat 0 0;
}
.edui-popup .edui-popup-caret.down{
background:url('../images/caret.png') no-repeat 0 0;
background:url('../assets/images/caret.png') no-repeat 0 0;
}
... ... @@ -762,8 +762,8 @@
width: 2px;
height: 20px;
padding: 1px 2px;
background: url(../images/icons.png) -179px 1px;
background: url(../images/icons.gif) -179px 1px \9;
background: url(../assets/images/icons.png) -179px 1px;
background: url(../assets/images/icons.gif) -179px 1px \9;
display: inline-block ;
vertical-align: top;
*display: inline ;
... ...
... ... @@ -163,11 +163,11 @@
line-height: 48px;
padding: 0 0 0 50px;
margin: 0 200px;
background: url(../images/excel.png) no-repeat left center;
background: url(../assets/images/excel.png) no-repeat left center;
}
.load {
background-image: url(../images/loading.gif);
background-image: url(../assets/images/loading.gif);
background-repeat: no-repeat;
background-position: center center;
}
\ No newline at end of file
... ...