Authored by liuyue

网销图片,样式修正

Showing 100 changed files with 907 additions and 450 deletions

Too many changes to show.

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

var gulp=require('gulp'),
fs=require('fs'),
var gulp = require('gulp'),
fs = require('fs'),
ftp = require('gulp-ftp'),
gutil = require('gulp-util'),
path=require('path'),
path = require('path'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
... ... @@ -10,9 +10,9 @@ var gulp=require('gulp'),
// md5 = require("gulp-md5"),
autoprefixer = require('gulp-autoprefixer'),
server = require('gulp-develop-server'),
minifycss = require('gulp-minify-css'),
minifycss = require('gulp-minify-css'),
webpack = require('webpack');
var crypto=require("crypto");
var crypto = require("crypto");
var rename = require("gulp-rename");
var clean = require('gulp-clean');
... ... @@ -22,7 +22,6 @@ var env = process.env.NODE_ENV || 'development';
var config = JSON.parse(fs.readFileSync('./package.json').toString());
var assets_dir = 'dist/' + config.name + '/assets';
var public_dir = '../public';
... ... @@ -35,7 +34,7 @@ var dist_dir = {
};
var cdn_domain = 'http://cdn.yoho.cn/';
var md5="";//+crypto.createHash('md5').update(new Date().toString()).digest('hex');;
var md5 = ""; //+crypto.createHash('md5').update(new Date().toString()).digest('hex');;
var ftpConfig = {
host: '218.94.75.58',
... ... @@ -44,43 +43,47 @@ var ftpConfig = {
};
gulp.task('default',["sass","js"]);
gulp.task('default', ["sass", "js"]);
gulp.task('start',["default","default-watch","server"]);
gulp.task('start', ["default", "default-watch", "server"]);
gulp.task('build',["clean"],function(){
gulp.start(["buildjs","assets","static-config"]);
});//"static-config"
gulp.task('build', ["clean"], function() {
gulp.start(["buildjs", "assets", "static-config"]);
}); //"static-config"
//预编译css
gulp.task('sass', function() {
gulp.src(['sass/index.scss','sass/login.scss'])
gulp.src('sass/index.scss')
.pipe(plumber())
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(minifycss())
.pipe(autoprefixer({
browsers: ['last 5 versions'],
cascade: false
}))
.pipe(gulp.dest(path.join(public_dir,"dist")));
.pipe(gulp.dest(path.join(public_dir, "dist")));
});
//预编译js
gulp.task('js',function(cb){
wconfig.output.path=path.join(public_dir,"dist");
gulp.task('js', function(cb) {
wconfig.output.path = path.join(public_dir, "dist");
webpack(wconfig, cb);
});
//监控css和js
gulp.task("default-watch",function(){
gulp.task("default-watch", function() {
gulp.watch('sass/**/*.scss', ['sass']);
gulp.watch('js/**/*.js', ['js']);
});
gulp.task("clean",function(){
return gulp.src(dist_dir.js+"/", {read: false})
.pipe(clean());
gulp.task("clean", function() {
return gulp.src(dist_dir.js + "/", {
read: false
})
.pipe(clean());
});
//发布js文件
gulp.task("buildjs",["js"],function(){
gulp.src(path.join(public_dir,"dist") + '/*.js')
gulp.task("buildjs", ["js"], function() {
gulp.src(path.join(public_dir, "dist") + '/*.js')
.pipe(uglify())
// .pipe(rename({
// suffix:md5
... ... @@ -94,10 +97,10 @@ gulp.task('assets', function() {
gulp.src(public_dir + '/fonts/*')
.pipe(gulp.dest(dist_dir.font));
gulp.src(path.join(public_dir,"dist") + '/*.css')
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/';
... ... @@ -109,19 +112,19 @@ gulp.task('assets', function() {
});
//配置静态资源文件
gulp.task("static-config",function(){
gulp.task("static-config", function() {
// var files = fs.readdirSync('./dist/libs');
var staticConfig={
test:{
path:'/dist'
var staticConfig = {
test: {
path: '/dist'
},
preview: {
path: cdn_domain + config.name + '/' + config.version,
md5:md5
md5: md5
},
production: {
path: cdn_domain + config.name + '/' + config.version,
md5:md5
md5: md5
}
}
fs.writeFileSync('../server/staticConfig.js', "exports.staticDir = " + JSON.stringify(staticConfig));
... ... @@ -142,8 +145,8 @@ gulp.task('server', function() {
});
gulp.watch([
server_dir + '/app.js',
server_dir+"/{interface,adapter,config,mid,stub,util}/**/*.js",
server_dir+"/views/**/*.html"], server.restart);
});
server_dir + "/{interface,adapter,config,mid,stub,util}/**/*.js",
server_dir + "/views/**/*.html"
], server.restart);
});
\ No newline at end of file
... ...
... ... @@ -41,7 +41,7 @@ var util = {
success: function(res) {
res = res.data;
if (res.code != 200) {
util.__tip(res.message, "danger");
util.__tip(res.message, "warning");
} else {
return callback.bind(this, res)();
}
... ... @@ -96,7 +96,6 @@ var util = {
},
__template2: function(str, source) {
// console.log(str);
var result = "";
var script = [];
script.push('var each=function(obj,fn){');
script.push(' var that=this;');
... ... @@ -112,65 +111,81 @@ var util = {
script.push(' }');
script.push(' return;');
script.push(' }');
script.push('}');
result = script.join('') + ";\n";
script.push('};');
var formstr = function(code) {
return "'" + code
.replace(/('|\\)/g, '\\$1')
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n') + "'";
return "'" + code
.replace(/('|\\)/g, '\\$1')
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n') + "'";
}
var formJs = function(code) {
var trim = code.replace(/^\s+|\s+$/, '');
//each goodsSizeList as item __index
if (/^each/.test(trim)) {
return trim.replace(/^each\b([\w\W]+)\bas\b([\w\W]+)\b([\w\W]+)/, function($0, $1, $2, $3) {
return 'each\( ' + $1 + ',function(' + $3 + ',' + $2 + '){';
});
} else if (/^\/each/.test(trim)) {
return trim.replace(/^\/each/, '});')
} else if (/^if/.test(trim)) {
return trim.replace(/^if(.+)/, function($0, $1) {
return 'if(' + $1 + '){';
});
} else if (/^\/if/.test(trim)) {
return trim.replace(/^\/if/, '};')
} else if (/^else$/.test(trim)) {
return trim.replace(/else/, '}else{');
} else {
return "result.push(" + code + ")";
}
}
//获取参数
var params = [];
// var PARAMS={};
var OBJECT = /\.\w+|'.*'|".*"/g;
var KEYWORDS = 'for,if,else,each,as';
var SPECHAR = /\W/g;
var NUMBER = /^\d[^,]*|,\d[^,]*/g;
var SPLIT2_RE = /^$|,+/;
var REGEXKEYWORDS = new RegExp("\\b" + [KEYWORDS.replace(/,/g, '\\b|\\b')].join('|'), 'g');
var getVar = function(code) {
var strArr = code.replace(OBJECT, '')
.replace(SPECHAR, ',')
.replace(REGEXKEYWORDS, '')
.replace(NUMBER, '')
.split(SPLIT2_RE);
for (var key in strArr) {
if (strArr[key] && !source.hasOwnProperty(strArr[key])) {
source[strArr[key]] = "";
}
}
}
var html = "";
html = str.replace(/\[\[(.*?)\]\]/igm, function(name, $1) {
var trim = $1.replace(/^\s+|\s+$/, '');
if (/^each/.test(trim)) {
trim = trim.replace(/^each\s+([a-zA-Z0-1.]+)\s+as\s+(\w+)\s+(\w+)/, function($0, $1, $2, $3) {
params.push($1);
return 'each\( ' + $1 + ',function(' + $3 + ',' + $2 + '){';
});
return "[[" + trim + "]]";
} else
if (/^\/each/.test(trim)) {
trim = trim.replace(/^\/each/, '});')
return "[[" + trim + "]]";
} else if (/^if/.test(trim)) {
trim = trim.replace(/^if(.+)/, function($0, $1) {
params.push($1);
return 'if(' + $1 + '){';
});
return "[[" + trim + "]]";
} else if (/^\/if/.test(trim)) {
trim = trim.replace(/^\/if/, '};')
return "[[" + trim + "]]";
} else if (/^else$/.test(trim)) {
trim = trim.replace(/else/, '}else{');
return "[[" + trim + "]]";
var code = [],
params = {};
var arr = str.split(/\[\[|\]\]/).map(function(item, index) {
if (index % 2) {
return {
value: item,
regex: true
};
} else {
params.push(trim);
return "[[+" + trim + "+]]";
return {
value: item,
regex: false
};
}
});
// console.log(params);
//.match(/(\w+)+/g)
for (var i in params) {
var aps = params[i].split(/\+|\-|\*|\/|\=|\!|\~|'|"/g);
for (var j in aps) {
var ap = aps[j].replace(/^\s+|\s+$/, '');
// console.log(":" + ap + ":");
if (!/^[0-9]+$/.test(ap) && !/^\s*$/.test(ap) && !/\./g.test(ap)) {
if (!source.hasOwnProperty(ap)) {
source[ap] = "";
// console.log(":" + ap + ":");
}
}
arr.forEach(function(item, index) {
if (item.regex) {
getVar(item.value);
code.push(formJs(item.value));
} else {
code.push("result.push(" + formstr(item.value) + ");");
}
}
});
// var header="var result=[],";
// header+=Object.keys(source).join(',')+";"
var keys = [];
for (var key in source) {
... ... @@ -180,55 +195,51 @@ var util = {
keys.push(key + "=" + JSON.stringify(source[key]));
}
}
var header = "var " + keys.join(',') + ";";
var header = "var result=[]," + keys.join(',') + ";";
html = html.replace(/(^|\]\])(.*?)(\[\[|$)/igm, function(name, $1, $2) {
var trim = $2.replace(/^\s+|\s+$/, '');
return trim ? formstr($2) : '';
});
// var result="var result='';result+=";
var arr = html.split(/\n+/igm);
result += "var p=[];\n";
for (var i = 0; i < arr.length; i++) {
if (/^'/.test(arr[i])) {
result += "p.push(" + (arr[i]) + ");\n";
} else {
result += (arr[i]);
}
}
result += "return p.join('');\n";
// console.log(result);
var result = header + code.join('\n') + "return result.join('');";
var fn = new Function(header + result);
var b = fn.call(source);
return b;
var fn = new Function(script.join('') + result);
return fn.call(source);
},
__input: function(id) {
return !!~$.trim($('#' + id).val()) ? $('#' + id).val() : ""
},
__dateFormat:function(data,format) {
var date = {
"M+": data.getMonth() + 1,
"d+": data.getDate(),
"h+": data.getHours(),
"m+": data.getMinutes(),
"s+": data.getSeconds(),
"q+": Math.floor((data.getMonth() + 3) / 3),
"S+": data.getMilliseconds()
};
if (/(y+)/i.test(format)) {
format = format.replace(RegExp.$1, (data.getFullYear() + '').substr(4 - RegExp.$1.length));
}
for (var k in date) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1
? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
__dateFormat: function(data, format) {
if (!isNaN(data)) {
var date = {
"M+": data.getMonth() + 1,
"d+": data.getDate(),
"h+": data.getHours(),
"m+": data.getMinutes(),
"s+": data.getSeconds(),
"q+": Math.floor((data.getMonth() + 3) / 3),
"S+": data.getMilliseconds()
};
if (/(y+)/i.test(format)) {
format = format.replace(RegExp.$1, (data.getFullYear() + '').substr(4 - RegExp.$1.length));
}
for (var k in date) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
}
}
return format;
} else {
return "";
}
},
__filterNull: function(obj, prop) {
// 判断item里面 instr属性是不是为空
if (obj[prop]) {
return obj[prop];
} else {
return "";
}
return format;
}
}
module.exports = util;
\ No newline at end of file
... ...
... ... @@ -7,7 +7,6 @@ require('../util/custom.js');
*/
window.NETSALEDATA = require('./partials/data.js');
window.GOLABDATA = {
on: function(key, callback) {
var that = this;
... ... @@ -33,13 +32,17 @@ window.GOLABDATA = {
}
} else {
var map = {},
args = [].slice.call(arguments, 1);
args = [].slice.call(arguments, 1),
listeners = null;
for (var key in that.registerEvent) {
var listeners = that.registerEvent[key];
listeners = that.registerEvent[key];
for (var i in listeners) {
map[key] = listeners[i].apply(this, args);
}
}
console.log(map);
return map;
}
... ... @@ -70,8 +73,12 @@ if ($('.contentpanel').data('type') == 'info') {
$('.contentpanel').find('input').prop('disabled', true);
$('.contentpanel').find('.btn').addClass('disabled');
$('.panel-footer').remove();
$('#edit-recommender, #edit-descriptioner').prop('contenteditable', false);
$('#saveAllInfo').hide();
$(".goods-img i").remove();
$("#search-key-list").hide();
$(".brand-list").hide();
// 上架审核的查看页面
if ($('.contentpanel').data('action') != 'audit') {
... ... @@ -81,7 +88,7 @@ if ($('.contentpanel').data('type') == 'info') {
} else {
var status = NETSALEDATA.baseProductInfo.baseProduct.status;
//待审核状态 或者 再上架待审核
if (status !=2 && status != 5) {
if (status != 2 && status != 5) {
$('#passBtn').hide();
$('#rejectBtn').hide();
}
... ... @@ -93,10 +100,14 @@ if ($('.contentpanel').data('type') == 'info') {
$('#rejectBtn').hide();
}
//保存完整网销信息
var e = new common.edit('#netsaleAllInfo');
$(document).on("click", "#saveAllInfo", function() {
var data = {};
$.each(GOLABDATA.fire(), function(key, value) {
var allData = GOLABDATA.fire();
$.each(allData, function(key, value) {
if (typeof value == 'string') {
data = value;
return;
... ... @@ -104,30 +115,20 @@ $(document).on("click", "#saveAllInfo", function() {
$.extend(data, value, true);
});
/*common.util.__ajax({
url: '/goods/product/saveNetSaleAllInfo',
data: data
}, function(res) {
});*/
e.submit('/goods/product/saveNetSaleAllInfo', function(option) {
option.data = data;
option.success = function(res) {
res = res.data;
if (res.code == '200') {
e.$tip(res.message, function() {
location.href = '/goods/netsale/index';
history.go(-1);
}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
}
})
});
})
... ... @@ -181,4 +182,28 @@ $(document).on("click", "#passBtn", function() {
};
}
Bll.toast("确定要通过该申请吗?", data);
});
\ No newline at end of file
});
//类似描点跳转,描点会影响history.go(-1)
$('.floatnav').on('click', 'li', function() {
var name = $(this).attr('name'),
scrollTop = $('.netsale-position[name="' + name + '"]').offset().top;
$(window).scrollTop(scrollTop);
return false;
});
//导航样式
$('.floatnav').on('mouseenter', function() {
$('.floatnav').addClass('show');
}).on('mouseleave', function() {
$('.floatnav').removeClass('show');
});
if (location.hash) {
var hashPos = location.hash.substring(1);
setTimeout(function() {
$('.floatnav').find('li[name="' + hashPos + '"]').trigger('click');
}, 500);
}
\ No newline at end of file
... ...
... ... @@ -36,18 +36,26 @@ var ENUM = {
'all': 0
},
isVIP: {
'N': '否',
'Y': '是'
"Y": "是",
"N": "否",
"B": "品牌设置"
}
};
var tabTree = new common.tabTree("#sortTree");
tabTree.init();
/*new common.dropDown({
el: '#shopId',
ajax: 'shopsRest'
});
new common.dropDown({
el: '#brandId',
ajax: 'brand'
});
});*/
var editPostion = '';
... ... @@ -57,6 +65,7 @@ var t = new common.tab({
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;
... ... @@ -66,7 +75,10 @@ var t = new common.tab({
if (columnname == 1 || columnname == 2) {
editPostion = '#position9';
} else {
editPostion = '';
}
g.init($("#gridurl").val());
},
columns: [{
... ... @@ -87,7 +99,7 @@ var t = new common.tab({
display: "上架后信息缺失({4})"
}, {
name: "all",
value: '',
value: 'all',
display: "全部商品({all})"
}]
}).init(ENUM.tab);
... ... @@ -99,7 +111,6 @@ var loadtab = function() {
common.util.__ajax({
url: '/goods/product/queryTabProductNum',
data: g.options.parms()
}, function(res) {
var __dt = $.extend({}, ENUM.tab, res.data);
t.init(__dt);
... ... @@ -129,7 +140,8 @@ var g = new common.grid({
isOutLets: common.util.__input("isOutLets"),
productStatus: common.util.__input("productStatus"),
size: common.util.__input("size"),
productStatusStr: t.value
productStatusStr: t.value,
tab: $('#basicTab').find('.active').index()
};
},
columns: [{
... ... @@ -154,6 +166,7 @@ var g = new common.grid({
}
}, {
display: '商品信息',
width: '30%',
render: function(item) {
var productName = item.productName ? item.productName : '',
brandName = item.brandName ? item.brandName : '',
... ... @@ -240,7 +253,7 @@ var g = new common.grid({
}
}, {
display: '上架状态',
name: 'status', // -1待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。
name: 'status', // 8待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过。
render: function(item) {
var html = '';
if (ENUM.status[item.status]) {
... ... @@ -265,12 +278,12 @@ var g = new common.grid({
render: function(item) {
var HtmArr = [];
if (item.status == 4 || item.status == 1 || item.status == 5 || item.status == 0 || item.status == 6) {
if (item.status == 4 || item.status == 1 || item.status == 5 || item.status == 6) {
HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + editPostion + '" class="btn btn-info btn-xs edit-btn">编辑</a>');
HtmArr.push('<a href="javascript:;" class="btn btn-danger btn-xs shelve-btn" data-skn="' + item.productSkn + '">下架</a>');
} else if (item.status == 3 || item.status == 8 || item.status == 2) {
HtmArr.push('<a href="javascript:;" class="btn btn-danger btn-xs shelve-btn" data-index="' + item.__index + '">下架</a>');
} else if (item.status == 3 || item.status == 8 || item.status == 2 || item.status == 0) {
HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + editPostion + '" class="btn btn-info btn-xs edit-btn">编辑</a>');
HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs shelve-btn" data-skn="' + item.productSkn + '">上架</a>');
HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs shelve-btn" data-index="' + item.__index + '">上架</a>');
}
HtmArr.push('<a href="/goods/netsale/info/' + item.productSkn + editPostion + '" class="btn btn-info btn-xs info-btn">查看</a>');
return HtmArr.join('');
... ... @@ -305,7 +318,7 @@ function shelveModal(title, html) {
});
shelveLayer = common.dialog.open({
title: '上架',
title: title,
content: html
});
... ... @@ -328,7 +341,12 @@ function shelveModal(title, html) {
g.reload();
}, 'growl-success');
} else {
e.$tip(res.data.message);
//e.$tip(res.data.message);
var html = '';
$.each(res.data.data, function(key, value) {
html += key + ':' + value + '<br>';
});
e.$tip(html);
}
}
});
... ... @@ -351,10 +369,8 @@ $('#export-btn').on('click', function() {
len = selectedArr.length,
data = g.options.parms();
$.each(data, function(key, value) {
if (value && value != '' && key != 'size') {
if (value && value != '' && key != 'size' && key != 'tab') {
count++;
}
});
... ... @@ -375,101 +391,134 @@ $('#export-btn').on('click', function() {
window.open("/ajax/down?queryConf=" + JSON.stringify(data) + "&type=netSale");
});
//sku skc上架表格
var shelveTable = new common.grid({
el: "#shelve-table",
secondIndex: 2,
columns: [{
display: 'SKC(商品信息)',
render: function(item) {
return 'SKC:' + item.productSkc + '<br>' +
'颜色:' + item.goodsName;
}
}, {
display: 'SKC上架操作(状态)',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success btnskc" data-type="1" data-index="' + item.__index + '" href="javascript:;">点击上架</a>';
} else {
return '<a class="btn btn-danger btnskc" data-type="0" data-index="' + item.__index + '" href="javascript:;">点击下架</a>';
}
}
}, {
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)
}
}]
});
/*代码优惠*/
var goodsList = {},
shelveLayer = null;
//单个sku,skc上下架
$('#basicTable').on('click', '.shelve-btn', function() {
var that = this,
skn = $(this).data('skn'),
shelveModalHtml = '',
shelveLayer = null;
var item = g.rows[$(this).data("index")];
var that = this;
$(that).addClass('disabled');
common.util.__ajax({
url: '/goods/netsale/getdata',
data: {
param: skn
}
}, function(res) {
shelveModalHtml = common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct);
getdata(item.productSkn, function(res) {
shelveLayer = common.dialog.open({
title: '上/下架',
width: 900,
content: shelveModalHtml
content: common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct)
});
$(that).removeClass('disabled');
goodsList = res.data.goodsList;
shelveTable.init(goodsList);
});
var shelveTable = new common.grid({
el: "#shelve-table",
secondIndex: 2,
columns: [{
display: 'SKC(商品信息)',
render: function(item) {
return 'SKC:' + item.productSkc + '<br>' +
'颜色:' + item.goodsName;
}
}, {
display: 'SKC上架操作(状态)',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success" data-type="1" data-skc="' + item.productSkc + '" href="javascript:;">点击上架</a>';
} else {
return '<a class="btn btn-danger" data-type="0" data-skc="' + item.productSkc + '" href="javascript:;">点击下架</a>';
}
}
}, {
display: 'SKU',
name: 'productSku'
}, {
display: '尺码',
name: 'sizeName'
}, {
display: '库存',
name: 'stock'
}, {
display: 'SKU上架操作',
render: function(item) {
if (item.status == 0) {
return '下架';
} else {
return '上架';
}
}
}, {
display: 'SKU上架操作',
render: function(item) {
if (item.status == 0) {
return '<a class="btn btn-success" data-type="1" data-sku="' + item.productSku + '" href="javascript:;">上架</a>';
} else {
return '<a class="btn btn-danger" data-type="0" data-sku="' + item.productSku + '" href="javascript:;">下架</a>';
}
}
}]
});
shelveTable.init(res.data.goodsList, 'goodsSizeList');
$('#shelve-table').on('click', '.btn', function() {
var param = {},
reqUrl = '';
if ($(this).data('skc')) {
param.productSkc = $(this).data('skc');
reqUrl = '/goods/product/updateGoodsStatus';
} else if ($(this).data('sku')) {
param.productSku = $(this).data('sku');
reqUrl = '/goods/product/updateProductSkuStatus';
}
});
param.targetStatus = $(this).data('type');
common.util.__ajax({
url: reqUrl,
data: param
}, function(res) {
if (res.code == 200) {
shelveLayer.close();
}
})
})
function getdata(Skn, callback) {
common.util.__ajax({
url: '/goods/netsale/getdata',
data: {
param: Skn
}
}, function(res) {
callback && callback(res);
}, true);
}
$(document).on("click", ".btnskc", function() {
var item = goodsList[$(this).data("index")];
console.log(item);
common.util.__ajax({
url: '/goods/product/updateGoodsStatus',
data: {
productSkc: item.productSkc,
targetStatus: item.status ? 0 : 1
}
}, function(res) {
if (res.code == 200) {
getdata(item.productSkn, function(res) {
goodsList = res.data.goodsList;
shelveTable.init(res.data.goodsList);
});
}
})
});
$(document).on("click", ".btnsku", function() {
var item = goodsList[$(this).data("index")]
var item1 = item.goodsSizeList[$(this).data("subindex")];
common.util.__ajax({
url: '/goods/product/updateProductSkuStatus',
data: {
productSku: item1.productSku,
targetStatus: item1.status ? 0 : 1
}
}, function(res) {
if (res.code == 200) {
getdata(item.productSkn, function(res) {
goodsList = res.data.goodsList;
console.log(goodsList);
shelveTable.init(res.data.goodsList);
});
}
})
});
$(document).on("change", ".wqt_checkbox,.wqt_all", function() {
var _count1 = 0,
_count2 = 0;
$.each(g.selected, function(index, item) {
/*添加兼容逻辑*/
if (item.status == 8 || item.status == 3 || item.status == 2 || item.status == 0) {
_count1++; //上
} else {
_count2++; //下
}
});
if (_count1 == g.selected.length) {
$('#onshelve').removeClass('disabled');
} else {
$('#onshelve').addClass('disabled');
}
if (_count2 == g.selected.length) {
$('#offshelve').removeClass('disabled');
} else {
$('#offshelve').addClass('disabled');
}
});
\ No newline at end of file
... ...
... ... @@ -8,6 +8,8 @@ var e = new common.edit('#addinfo-wrap'),
comfort = NETSALEDATA.specialAttrBo ? NETSALEDATA.specialAttrBo.wearSenses : "";
/*上架补全信息*/
$('#saveAddInfo').on('click', function() {
e.submit('/goods/product/saveAfterSaleInfo', function(option) {
option.data = GOLABDATA.fire('LYaddInfo');
... ... @@ -31,7 +33,8 @@ GOLABDATA.on("LYaddInfo", function() {
}
});
option.data.productSkn = $('#productSkn').val();
option.data.wearSense = sense();
//option.data.wearSense = sense();
option.data.attributeProValuesTwo = JSON.stringify(attributeObj());
function sense() {
... ... @@ -50,7 +53,19 @@ GOLABDATA.on("LYaddInfo", function() {
} else {
return '';
}
}
function attributeObj() {
var attributeArr = [];
$('.attribute-group').each(function() {
attributeArr.push({
productSkn: option.data.productSkn,
attributeId: $(this).find('[id]').attr('id'),
attributeValueId: $(this).find('[id]').val().split('|').join(',')
})
});
return attributeArr;
}
option.debug = true;
});
... ... @@ -61,8 +76,8 @@ $.ajax({
url: '/goods/product/queryAfterSaleInfo',
data: {
saleType: 2,
displayPosition: 2,
categoryId: basicInfo.maxSortId
displayPosition: 3,
categoryId: basicInfo.smallSortId
},
dataType: 'json',
success: function(res) {
... ... @@ -88,6 +103,17 @@ $.ajax({
}
});
if (NETSALEDATA.attributeProValuesBosTwo) {
$.each(NETSALEDATA.attributeProValuesBosTwo, function(i, value) {
$.each(data.attributes.data, function(i2, value2) {
if (value.attributeId == value2.attributeId) {
value2.selectedValues = value.attributeValueId.replace(/,/g, "|");
}
});
});
}
$.each(data.productComfort.data, function(index, item) {
if (comfort && comfort[index]) {
... ... @@ -133,14 +159,87 @@ $.ajax({
brandId: basicInfo.brandId
}
});
e.init();
if ($('.contentpanel').data('type') == 'info') {
$('.contentpanel').find('input').prop('disabled', true);
$('.contentpanel').find('select').prop('disabled', true);
$('.contentpanel').find('.btn').addClass('disabled');
$('#addinfo-wrap').find('input').not(":checked").parents('label').hide();
}
e.init();
}
});
//去编辑商品名称
$('#editProductName').on('click', function() {
$('#productName').focus();
})
/*商品参数*/
var goodsParamArr = [];
var goodsParamEdit = new common.edit('#goodsParamWrap');
common.util.__ajax({
url: '/goods/product/queryAttributesByConfEx',
data: {
saleType: 2,
displayPosition: 2,
categoryId: basicInfo.smallSortId
}
}, function(res) {
var data = res.data;
if (NETSALEDATA.attributeProValuesBosOne) {
$.each(NETSALEDATA.attributeProValuesBosOne, function(i, value) {
$.each(data, function(i2, value2) {
if (value.attributeId == value2.attributeId) {
value2.selectedValues = value.attributeValueId.replace(/,/g, "|");
}
});
});
}
if (res.data.length == 0) {
$("#goodsParams-footer").hide();
}
$('#goodsParamWrap').html(common.util.__template2($('#goodsParamTemp').html(), {
data: data
}));
goodsParamEdit.init();
if ($('.contentpanel').data('type') == 'info') {
$('.contentpanel').find('input').prop('disabled', true);
$('.contentpanel').find('select').prop('disabled', true);
$('.contentpanel').find('.btn').addClass('disabled');
$('#goodsParamWrap').find('input').not(":checked").parents('label').hide();
}
})
\ No newline at end of file
}, true);
GOLABDATA.on("TYcaizhi", function() {
var a = goodsParamEdit.submit(false, function(option) {
$('.goods-param-group').each(function() {
goodsParamArr.push({
productSkn: $('#productSkn').val(),
attributeId: $(this).find(':hidden').attr('id'),
attributeValueId: $(this).find(':hidden').val().split('|').join(',')
});
});
option.data.attributeProValuesOne = JSON.stringify(goodsParamArr);
option.data.productSkn = $('#productSkn').val();
option.debug = true;
});
return a ? a : goodsParamEdit.errMessage;
});
$("#propertySave").on('click', function() {
common.util.__ajax({
url: '/netSale/saveProductParam',
data: GOLABDATA.fire('TYcaizhi')
}, function() {});
});
\ No newline at end of file
... ...
... ... @@ -2,6 +2,12 @@ var $ = require('jquery'),
common = require('../../common/common');
var basicInfohtml = '',
ENUM = {
isSuppled: {
'Y': '是',
'N': '否'
}
},
convertObj = {
ageLevel: {
'1': '成人',
... ... @@ -15,11 +21,12 @@ var basicInfohtml = '',
},
grade: {
'1': '是',
'null': '否'
'0': '否'
},
isOutLets: {
'Y': '是',
'N': '否'
'N': '否',
'B': '品牌设置'
},
isLimited: {
'Y': '是',
... ... @@ -40,6 +47,27 @@ var basicInfohtml = '',
attribute: {
1: '普通',
2: '赠品'
},
goodsSeason: {
0: '四季',
1: '春',
2: '夏',
3: '秋',
4: '冬',
5: '春夏',
6: '秋冬'
},
seasons: {
'seasons': '四季',
'spring': '春',
'summer': '夏',
'autumn': '秋',
'winter': '冬'
},
isVip: {
'Y': '是',
'N': '否',
'B': '品牌设置'
}
},
basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '',
... ... @@ -58,7 +86,10 @@ function convert(basicInfo, obj) {
return basicInfo;
}
var basicInfoData = convert(basicInfo, convertObj);
basicInfoData.expectArrivalTime = common.util.__dateFormat(new Date(basicInfoData.expectArrivalTime * 1000), "yyyy-MM-dd hh:mm:ss");
basicInfoData.expectShelfTime = common.util.__dateFormat(new Date(basicInfoData.expectShelfTime * 1000), "yyyy-MM-dd hh:mm:ss");
//基本信息
basicInfoData.renderType = $('.contentpanel').data('type');
... ... @@ -66,17 +97,34 @@ basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
$('#basic-info').html(basicInfohtml);
//能否补货
$('#goods-table').html(common.util.__template2($('#goodsList').html(), {
goodsList: NETSALEDATA.goodsList
}));
var suppledTable = new common.grid({
el: '#suppled-table',
hash: false,
secondIndex: 1,
columns: [{
display: 'SKC(厂家颜色)',
render: function(item) {
return item.productSkc + '(' + item.goodsName + ')';
}
}, {
display: 'SKU(尺码)',
render: function(item) {
return item.productSku + '(' + item.sizeName + ')';
}
}, {
display: '能否补货',
render: function(item) {
return ENUM.isSuppled[item.isSuppled];
}
}]
});
suppledTable.init(NETSALEDATA.goodsList, 'goodsSizeList')
//上架必填
productExtBo.renderType = $('.contentpanel').data('type');
productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : '';
productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : '';
//productExtBo.shopList =
//productExtBo.shopList =
common.util.__ajax({
url: '/goods/ShopsRest/queryShopsByBrandId',
data: {
... ... @@ -84,13 +132,23 @@ common.util.__ajax({
}
}, function(res) {
productExtBo.shopList = res.data;
productExtBo.shopIds = '';
if (productExtBo.shopIdList && productExtBo.shopIdList.length > 0) {
//如有选择店铺
productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : '';
} else if (res.data.length > 0) {
//如没有已选择店铺,默认选择全部
$.each(res.data, function(i, value) {
productExtBo.shopIds += value.shopsId + '|';
});
}
//
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
e.init();
}, true);
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
//如果是info页,所有input btn置灰
if ($('.contentpanel').data('type') == 'info') {
$('.contentpanel').find('input').prop('disabled', true);
$('.contentpanel').find('.btn').addClass('disabled');
... ... @@ -99,6 +157,7 @@ if ($('.contentpanel').data('type') == 'info') {
var e = new common.edit('#basicInfoWrap');
e.init();
//保存基本信息
$('#saveBasicInfo').on('click', function() {
e.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
option.data = GOLABDATA.fire("LYbasicInfo");;
... ... @@ -130,6 +189,5 @@ GOLABDATA.on("LYbasicInfo", function() {
data[key] = $(this).val().split('|').join(',');
}
});
console.log(data);
return data;
});
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ var $ = require('jquery'),
var e = new common.edit('#brandWrap'),
brandSelectArr = [];
common.util.__ajax({
url: '/goods/brands/queryBrandsByStatus'
}, function(res) {
... ... @@ -25,9 +26,13 @@ common.util.__ajax({
map['0-9'].push(item);
}
});
$('.brand-list').html(common.util.__template2($('#brandTemp').html(), {
var brandHtml = common.util.__template2($('#brandTemp').html(), {
map: map
}));
});
// var docFrag = new DocumentFragment();
// docFrag.firstChild.nodeValue = brandHtml;
$('#brand-list').html(brandHtml);
if (NETSALEDATA.brandRelationList) {
$('.selected-brand').html(common.util.__template2($('#brandShowTemp').html(), {
... ... @@ -76,9 +81,14 @@ $('#saveBrandRelation').on('click', function() {
});
GOLABDATA.on("LYbrandRelation", function() {
return e.submit('', function(option) {
return {
productSkn: $('#productSkn').val(),
brandRelationList: JSON.stringify($('#brandRelationList').val().split('|'))
}
/*return e.submit('', function(option) {
option.data.productSkn = $('#productSkn').val();
option.data.brandRelationList = JSON.stringify(option.data.brandRelationList.split('|'));
option.debug = true;
});
});*/
});
\ No newline at end of file
... ...
... ... @@ -8,6 +8,8 @@ require('../../common/zh-cn');
var productSkn, BUCKET = {
bucket: "goodsimg"
};
var editType = $('.contentpanel').data('type');
if (window.NETSALEDATA && window.NETSALEDATA.baseProductInfo && window.NETSALEDATA.baseProductInfo.baseProduct.productSkn) {
productSkn = window.NETSALEDATA.baseProductInfo.baseProduct.productSkn;
}
... ... @@ -18,6 +20,8 @@ window.UMdescriptioner = UM.getEditor('edit-descriptioner');
if (window.NETSALEDATA && window.NETSALEDATA.productExtBo.productDesc && window.NETSALEDATA.productExtBo.productDesc) {
UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc)
}
$(document).on("click", "#btn-descriptioner", function() {
common.util.__ajax({
url: '/netSale/saveProductDesc',
... ... @@ -31,11 +35,12 @@ $(document).on("click", "#btn-descriptioner", function() {
return false;
});
window.UMrecommender = UM.getEditor('edit-recommender');
/*小编推荐*/
window.UMrecommender = UM.getEditor('edit-recommender');
if (window.NETSALEDATA && window.NETSALEDATA.productExtBo && window.NETSALEDATA.productExtBo.recommend) {
UMrecommender.setContent(window.NETSALEDATA.productExtBo.recommend);
}
$(document).on("click", "#btn-recommand", function() {
common.util.__ajax({
url: '/netSale/saveNetSaleRecommend',
... ... @@ -50,12 +55,29 @@ $(document).on("click", "#btn-recommand", function() {
});
GOLABDATA.on("bianjiqi", function() {
/*if (UMdescriptioner.getContent() != '') {
return {
recommend: UMrecommender.getContent(),
productDesc: UMdescriptioner.getContent()
}
} else {
common.util.__tip('商品描述不可为空', 'warning');
return;
}
*/
$('#productDesc').val(UMdescriptioner.getContent());
return {
recommend: UMrecommender.getContent(),
productDesc: UMdescriptioner.getContent()
productDesc: $('#productDesc').val()
}
});
if (editType == 'info') {
window.UMrecommender.setDisabled('fullscreen');
window.UMdescriptioner.setDisabled('fullscreen');
}
/*逛*/
common.util.__ajax({
url: '/goods/article/queryArticlesBySKN',
... ... @@ -96,15 +118,22 @@ var g = new common.grid({
}, {
display: "发表时间",
render: function(item) {
var date = new Date(item.createTime * 1000);
return common.util.__dateFormat(new Date(item.createTime * 1000), "yyyy-MM-dd hh:mm:ss");
//return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
}
}, {
display: "操作",
render: function(item) {
var html = [];
html.push('<button type="button" data-index="' + item.__index + '" class="delete btn btn-danger btn-xs">删除</button>');
html.push('<button type="button" data-index="' + item.__index + '" class="edit btn btn-info btn-xs">修改</button>');
return html.join(',');
if (editType == 'edit') {
html.push('<button type="button" data-index="' + item.__index + '" class="delete btn btn-danger btn-xs">删除</button>');
html.push('<button type="button" data-index="' + item.__index + '" class="edit btn btn-info btn-xs">修改</button>');
return html.join(',');
} else {
return '';
}
}
}]
});
... ... @@ -118,11 +147,12 @@ var Bll = {
var d = new common.dialog({
title: title,
width: '60%',
width: '800px',
content: common.util.__template2($("#wqt-template1").html(), item),
button: [{
value: "提交",
callback: function() {
e.submit(url, function(option) {
option.data.id = item.id;
option.data.productSkn = productSkn;
... ... @@ -162,7 +192,9 @@ var Bll = {
$(document).on("dblclick", ".poseditimg img", function(e) {
var pos = {
top: e.pageY - $(this).offset().top,
left: e.pageX - $(this).offset().left
left: e.pageX - $(this).offset().left,
width: 150,
height: 150
}
Bll.posData.push(pos);
var _pos = $(common.util.__template2($("#kapian").html(), {
... ... @@ -182,6 +214,10 @@ $(document).on("click", ".poseditimg .close", function(e) {
});
$(document).on("change", ".poseditimg .pos-text", function() {
var item = Bll.posData[$(this).data("index")];
/*if ($.trim($(this).val()).length > 8) {
common.util.__tip('skn不能超过8位', 'warning');
return;
};*/
item.id = $(this).val();
});
... ... @@ -210,12 +246,13 @@ $(document).on("click", "#dapeiTable .delete", function() {
//修改
$(document).on("click", "#dapeiTable .edit", function() {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
common.util.__ajax2({
url: '/netSale/selectCollocationById',
data: {
param: item.id
}
}, function(data) {
console.log(data.data);
Bll.toast("添加搭配", data.data, "/netSale/updateCollocation");
});
// item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}];
... ... @@ -238,7 +275,7 @@ common.edit.ajaxfileupload(".fenmianfile", {
__type: "upload",
bucket: "goodsimg"
},
valid_extensions: ['gif', 'png', 'jpg', 'jpeg'],
valid_extensions: ['png', 'jpg', 'jpeg'],
onComplete: function(response) {
console.log(response);
if (response.status && response.code == 200) {
... ... @@ -257,54 +294,73 @@ common.edit.ajaxfileupload(".fenmianfile", {
item.push(data);
goodsList[$(this).data("index")].goodsImagesList = item;
$(this).parents(".cover-image-item").before(common.util.__template2($("#fenmianImgTemp").html(), data));
$('#cover-color').append($($('#colorCoverTemp').html()));
} else {
common.util.__tip(response.message);
common.util.__tip(response.message, 'warning');
}
}
});
$('#cover-color').on("click", ".btn-metro", function() {
var index = $(this).parents(".form-group").siblings().find('.cover-image-list').data("index");
var index1 = $(this).parents(".cover-color-box").index();
//颜色封面点击事件
$('.cover-image-list').on("click", ".btn-metro", function() {
var index = $(this).parents(".cover-image-list").data("index");
var index1 = $(this).parents(".cover-image-item").index();
var item = goodsList[index].goodsImagesList[index1];
var $groups = $(this).parents(".cover-color-box");
var colorIndex = $(this).index();
if ($(this).hasClass('info')) {
$(this).removeClass('info');
} else {
$('.cover-color-box').each(function() {
$(this).parents('.cover-image-item').siblings().each(function() {
$(this).find('.btn-metro').eq(colorIndex).removeClass('info');
});
$(this).siblings('.btn-metro').removeClass('info').end().addClass('info');
}
item.isDefault = $groups.find('.btn-metro').eq(0).hasClass('info') ? 'Y' : 'N';
var isDefault = $(this).parents('.cover-color').find('.btn-metro').eq(0).hasClass('info') ? 'Y' : 'N';
var genderCover = $(this).parents('.cover-color').find('.info').index() >= 0 ? $(this).parents('.cover-color').find('.info').index() : 0;
$.each(goodsList[index].goodsImagesList, function(i, value) {
if (value.genderCover == genderCover) {
value.genderCover = 0;
}
if (value.isDefault == isDefault) {
value.isDefault = 'N';
}
});
item.genderCover = genderCover;
item.isDefault = isDefault;
if ($groups.find('.btn-metro').eq(1).hasClass('info')) {
item.genderCover = 1;
} else if (item.genderCover = $groups.find('.btn-metro').eq(2).hasClass('info')) {
item.genderCover = 2;
} else {
item.genderCover = 0;
}
});
$(document).on("click", ".goods-color a", function() {
//商品封面点击事件
$(document).on("click", ".cover-goods a", function() {
var index = $(this).data("index");
var item = goodsList[index];
if ($(this).hasClass("info")) {
$(this).removeClass("info");
} else {
$('.cover-goods a').removeClass("info");
$(this).addClass("info");
}
item.isDefault = $(this).hasClass("info") ? "Y" : "N";
});
//封面图删除
$(document).on('click', '.remove-item-btn', function() {
var index = $(this).parents(".cover-image-list").data("index");
var index1 = $(this).parents(".cover-image-item").index();
$(this).parents('.cover-image-item').remove();
goodsList[index].goodsImagesList.splice(index1, 1);
console.log(goodsList[index].goodsImagesList);
});
//单独保存封面
$(document).on("click", "#fenMainSave", function() {
var data = GOLABDATA.fire("fenmian");
if (typeof data == "undefined") {
return false;
}
common.util.__ajax({
url: '/netSale/manageProductImg',
data: data
... ... @@ -317,16 +373,14 @@ GOLABDATA.on("fenmian", function() {
goodsImagesBoList: []
};
$.each(goodsList, function(index, item) {
if (item.isDefault == "Y") {
map.productSkc = item.productSkc;
map.productSkn = item.productSkn;
}
if (!item.goodsImagesList) {
common.util.__tip('请设置skc:' + item.productSkc + '的封面', 'danger');
if (!item.goodsImagesList || item.goodsImagesList == 0) {
common.util.__tip('请设置skc:' + item.productSkc + '的封面', 'warning');
return;
}
$.each(item.goodsImagesList, function(_index, _item) {
... ...
var $ = require('jquery'),
/*var $ = require('jquery'),
common = require('../../common/common');
var specialAttrBo = window.NETSALEDATA.specialAttrBo || {
... ... @@ -9,8 +9,6 @@ var specialAttrBo = window.NETSALEDATA.specialAttrBo || {
var washTipsList = specialAttrBo.washTipsList;
var materialList = specialAttrBo.materialList;
console.log(window.NETSALEDATA);
var e = new common.edit("#taoyu1");
common.util.__ajax({
... ... @@ -59,6 +57,7 @@ common.util.__ajax({
});
}, true);
$("#propertySave").on('click', function() {
var washTips = $("#washTips").val() || "";
... ... @@ -74,4 +73,4 @@ $("#propertySave").on('click', function() {
}, function() {
// body...
});
});
\ No newline at end of file
});*/
\ No newline at end of file
... ...
var $ = require('jquery'),
common = require('../../common/common');
common = require('../../common/common'),
util = require('../../common/util');
if (window.NETSALEDATA) {
{ //商品参数
var baseProduct = window.NETSALEDATA.baseProductInfo.baseProduct;
var specialAttrBo = {
productSkn: baseProduct.productSkn,
washTipsList: [],
materialList: []
};
if (window.NETSALEDATA.specialAttrBo) {
specialAttrBo = window.NETSALEDATA.specialAttrBo;
}
var washTipsList = specialAttrBo.washTipsList || [];
var materialList = specialAttrBo.materialList || [];
var e = new common.edit("#taoyu1");
//材质初始化
common.util.__ajax({
url: '/netSale/queryAllBySortId4Select',
data: {
param: baseProduct.maxSortId
}
}, function(res) {
$("#material-group").html(common.util.__template2($("#material-params").html(), res || {}));
var materials = [];
for (var i = 0; i < materialList.length; i++) {
materials[i] = materialList[i].id;
}
$("#material").val(materials.join("|"));
e.init();
}, true);
//{ //商品参数
/*var baseProduct = window.NETSALEDATA.baseProductInfo.baseProduct;
var specialAttrBo = {
productSkn: baseProduct.productSkn,
washTipsList: [],
materialList: []
};
if (window.NETSALEDATA.specialAttrBo) {
specialAttrBo = window.NETSALEDATA.specialAttrBo;
}
var washTipsList = specialAttrBo.washTipsList || [];
var materialList = specialAttrBo.materialList || [];
//洗涤提示初始化
common.util.__ajax({
url: '/netSale/getAll4Select',
data: {}
}, function(res) {
$("#washTip-group").html(common.util.__template2($("#washTip-params").html(), res || {}));
var washTips = [];
for (var i = 0; i < washTipsList.length; i++) {
washTips[i] = washTipsList[i].sortId;
}
$("#washTips").val(washTips.join("|"));
e.init();
}, true);
var e = new common.edit("#taoyu1");
//材质初始化
common.util.__ajax({
url: '/netSale/queryAllBySortId4Select',
data: {
param: baseProduct.maxSortId
}
}, function(res) {
$("#material-group").html(common.util.__template2($("#material-params").html(), res || {}));
var materials = [];
for (var i = 0; i < materialList.length; i++) {
materials[i] = materialList[i].id;
}
$("#material").val(materials.join("|"));
e.init();
}, true);
//洗涤提示初始化
common.util.__ajax({
url: '/netSale/getAll4Select',
data: {}
}, function(res) {
$("#washTip-group").html(common.util.__template2($("#washTip-params").html(), res || {}));
var washTips = [];
for (var i = 0; i < washTipsList.length; i++) {
washTips[i] = washTipsList[i].sortId;
}
$("#washTips").val(washTips.join("|"));
e.init();
}, true);
$(document).on('change', '.material', function() {
var items = $("#material").val().split("|");
for (var i = 0; i < items.length; i++) {
materialList[i] = {
"id": parseInt(items[i])
};
}
});
$(document).on('change', '.washTips', function() {
var items = $("#washTips").val().split("|");
for (var i = 0; i < items.length; i++) {
washTipsList[i] = {
"sortId": parseInt(items[i])
};
}
});
$(document).on('change', '.material', function() {
var items = $("#material").val().split("|");
for (var i = 0; i < items.length; i++) {
materialList[i] = {
"id": parseInt(items[i])
};
}
});
$(document).on('click', "#propertySave", function() {
$(document).on('change', '.washTips', function() {
var items = $("#washTips").val().split("|");
for (var i = 0; i < items.length; i++) {
washTipsList[i] = {
"sortId": parseInt(items[i])
};
}
});*/
var washTips = $("#washTips").val() || "";
var productMaterial = $("#material").val() || "";
/*$(document).on('click', "#propertySave", function() {
common.util.__ajax({
url: '/netSale/saveProductParam',
data: {
productSkn: specialAttrBo.productSkn,
washTips: washTips.replace(/\|/g, ","),
productMaterial: productMaterial.replace(/\|/g, ",")
}
}, function() {
// body...
});
});
var washTips = $("#washTips").val() || "";
var productMaterial = $("#material").val() || "";
window.GOLABDATA.on('TYcaizhi', function() {
var washTips = $("#washTips").val() || "";
var productMaterial = $("#material").val() || "";
return {
"washTips": washTips.replace(/\|/g, ","),
"productMaterial": productMaterial.replace(/\|/g, ",")
};
common.util.__ajax({
url: '/netSale/saveProductParam',
data: {
productSkn: specialAttrBo.productSkn,
washTips: washTips.replace(/\|/g, ","),
productMaterial: productMaterial.replace(/\|/g, ",")
}
});
}
return false;
});*/
/*window.GOLABDATA.on('TYcaizhi', function() {
var washTips = $("#washTips").val() || "";
var productMaterial = $("#material").val() || "";
return {
"washTips": washTips.replace(/\|/g, ","),
"productMaterial": productMaterial.replace(/\|/g, ",")
};
});*/
//}
{ //搜索关键词
... ... @@ -128,9 +128,13 @@ if (window.NETSALEDATA) {
$(document).on('click', '.add', function() {
var item = g.rows[$(this).data("index")];
var value = $("#searchKeys").val();
if (value) value += ",";
$("#searchKeys").val(value + item.content);
searchKeys = $("#searchKeys").val();
if(value.indexOf(item.content) == -1) {
if (value) value += ",";
$("#searchKeys").val(value + item.content);
searchKeys = $("#searchKeys").val();
} else {
util.__tip("商品关键词不能重复");
}
});
$("#save-searchKey").on('click', function() {
... ... @@ -140,9 +144,8 @@ if (window.NETSALEDATA) {
productSkn: window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,
searchKeys: searchKeys
}
}, function(res) {
});
return false;
});
window.GOLABDATA.on('TYsearchKey', function() {
... ... @@ -206,9 +209,8 @@ if (window.NETSALEDATA) {
data: {
searchSortList: JSON.stringify(searchSortList)
}
}, function() {
});
return false;
});
$("#sort0").on('change', function() {
... ...
... ... @@ -10,6 +10,9 @@
@import "common/ionicons.min";
@import "common/newselect2";
@import "common/jquery.gritter";
@import "common/global";
@import "common/umeditor";
@import "module/default";
@import "module/datepicker";
... ... @@ -19,4 +22,5 @@
@import "module/brand";
@import "module/template";
@import "module/shop-pc";
@import "module/shop-app";
\ No newline at end of file
@import "module/shop-app";
@import "module/base";
... ...
.panel-heading {
position: relative;
}
.panel-btns {
position: absolute;
top: 10px;
right: 10px;
display: none;
a {
border-color: #fff;
color: #999;
opacity: .75;
font-size: 11px;
padding: 3px 4px;
border: 1px solid #bbb;
line-height: 10px!important;
border-radius: 50px;
display: inline-block;
}
}
\ No newline at end of file
... ...
... ... @@ -31,17 +31,15 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
.cover-image-list {
li {
float: left;
width: auto;
width: 135px;
height: auto;
border: none;
}
.btn {
padding: 2px 5px;
}
.goods-img {
margin: 0 auto;
margin: 10px auto 0;
border: 2px dashed #CCC;
}
... ... @@ -51,6 +49,29 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
}
}
.cover-image-list {
.cover-color {
width: auto;
text-align: center;
height: 40px;
line-height: 40px;
.btn {
padding: 2px 5px;
}
}
}
.fm-side {
width: 110px;
.cover-color {
text-align: left;
}
.goods-img {
margin: 10px 0 0;
}
}
.goods-img {
position: relative;
width: 110px;
... ... @@ -62,12 +83,30 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
height: 100%;
line-height: 150px;
overflow: hidden;
img {
max-width: 100%;
max-height: 100%;
}
}
.remove-item-btn {
position: absolute;
font-size: 20px;
top: -10px;
right: -10px;
cursor: pointer;
color: #ccc;
&:hover {
color: #000;
}
}
}
.poseditimg{
position: relative;
width: 700px;
height: 600px;
width: 100%;
height: auto;
img{
display: block;
width: 100%;
... ... @@ -83,6 +122,12 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
}
}
}
#dapei-form {
label {
min-width: 60px;
}
}
.btn.info{
color: #fff;
background-color: #5bc0de;
... ... @@ -92,9 +137,15 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
.floatnav{
padding: 0;
position: fixed;
right: 20px;
top: 20%;
right: 0;
top: 50%;
z-index: 999;
margin: -280px 0 0;
transform: translateX(150px);
ul {
padding: 0;
}
li {
width: 150px;
... ... @@ -135,4 +186,72 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
}
}
.glyphicon {
position: absolute;
font-size: 20px;
width: 30px;
height: 40px;
background: #f2dede;
border-radius: 10px 0 0 10px;
border: 1px solid #ebccd1;
left: -30px;
top: 50%;
margin: -20px 0 0 0;
color: #fff;
text-align: center;
line-height: 40px;
cursor: pointer;
&.glyphicon-chevron-right {
display: none;
}
}
}
.floatnav.show {
transform: translateX(0);
transition: transform .5s;
.glyphicon-chevron-right {
display: inline;
}
.glyphicon-chevron-left {
display: none;
}
}
.netsale-position {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: -100%;
z-index:-1;
}
.w-goods-text{
border-radius: 3px;
background-color: #fff;
border: 1px solid #ccc;
padding: 5px;
}
.modal-dialog{
margin-top: 70px;
}
.subhhead{
span{
width: 100px;
display: inline-block;
height: 100%;
text-align: center;
}
}
.edui-editor-body {
img {
max-width: 100%;
}
}
\ No newline at end of file
... ...
var path = require('path');
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var fs=require('fs'),
path=require('path');
var fs = require('fs'),
path = require('path');
var commons=["./js/common/common.js"];
var commons = ["./js/common/common.js"];
var config = JSON.parse(fs.readFileSync('./package.json').toString());
var spmroot=path.join(__dirname, 'spm_modules');
var alias={};
for(key in config.spm.dependencies){
var spmroot = path.join(__dirname, 'spm_modules');
var alias = {};
for (key in config.spm.dependencies) {
var edition = path.join(key, config.spm.dependencies[key]);
var edition=path.join(key,config.spm.dependencies[key]);
var json=path.join(spmroot,path.join(edition,'package.json'));
var json = path.join(spmroot, path.join(edition, 'package.json'));
var mainjs=JSON.parse(fs.readFileSync(json).toString()).spm.main;
if(!alias[key]){
alias[key]=path.join(edition,mainjs).replace('/\\/ig','/');
var mainjs = JSON.parse(fs.readFileSync(json).toString()).spm.main;
if (!alias[key]) {
alias[key] = path.join(edition, mainjs).replace('/\\/ig', '/');
}
}
for (key in config.spm.dependencies) {
commons.push(key);
commons.push(key);
}
var entry={index:[],libs:[]};
entry.libs=commons;
var entry = {
index: [],
libs: []
};
entry.libs = commons;
var readfile=function(dir,callback){
var readfile = function(dir, callback) {
var files = fs.readdirSync(dir);
files.forEach(function (file) {
var filePath = path.join(dir, file);
if (fs.statSync(filePath).isFile() && /.*\.js$/i.test(file)) {
callback && callback(filePath);
}else{
if(file!="common"&&file!="util"){
readfile(filePath,callback);
}
files.forEach(function(file) {
var filePath = path.join(dir, file);
if (fs.statSync(filePath).isFile() && /.*\.js$/i.test(file)) {
callback && callback(filePath);
} else {
if (file != "common" && file != "util" && file != "partials") {
readfile(filePath, callback);
}
}
});
}
var index=[];
readfile('./js',function(src){
var index = [];
readfile('./js', function(src) {
index.push(src);
});
//区分不同系统环境
var __reg=/(js\\)|\\|(\.js)/g;
if(path.sep=="/"){
__reg=/(js\/)|\/|(\.js)/g;
var __reg = /(js\\)|\\|(\.js)/g;
if (path.sep == "/") {
__reg = /(js\/)|\/|(\.js)/g;
}
for(var i in index){
var __name=index[i].replace(__reg,'');
entry[__name]='.'+path.sep+index[i];
for (var i in index) {
var __name = index[i].replace(__reg, '');
entry[__name] = '.' + path.sep + index[i];
}
var plugins=[
//获取公共js
new webpack.optimize.CommonsChunkPlugin('libs','libs.js')
//全局引入jquery
// new webpack.ProvidePlugin({
// $: "jquery",
// jQuery: "jquery",
// "window.jQuery": "jquery"
// })
var plugins = [
//获取公共js
new webpack.optimize.CommonsChunkPlugin('libs', 'libs.js')
//全局引入jquery
// new webpack.ProvidePlugin({
// $: "jquery",
// jQuery: "jquery",
// "window.jQuery": "jquery"
// })
];
module.exports = {
entry: entry,
output: {
path:path.join("../public","dist"),
filename:'[name].js'
},
resolve:{
root: [spmroot],
extension:['','.js'],
alias:alias
},
plugins:plugins
entry: entry,
output: {
path: path.join("../public", "dist"),
filename: '[name].js'
},
resolve: {
root: [spmroot],
extension: ['', '.js'],
alias: alias
},
plugins: plugins
};
\ No newline at end of file
... ...