Authored by liuyue

网销

... ... @@ -3,17 +3,85 @@ var $ = require('jquery'),
common = require('../common/common');
require('../util/custom.js');
/*
* 获取业务数据
*/
window.NETSALEDATA=require('./partials/data.js');
* 获取业务数据
*/
window.NETSALEDATA = require('./partials/data.js');
console.log(window.NETSALEDATA);
//console.log(NETSALEDATA);
/*加载其他模块*/
require('./partials/editor_recommend');
require('./partials/model');
var basicInfohtml = '',
convertObj = {
ageLevel: {
'1': '成人',
'2': '大童',
'3': '小童'
},
gender: {
1: '男',
2: '女',
3: '通用'
},
grade: {
'1': '是',
'null': '否'
},
isOutLets: {
'Y': '是',
'N': '否'
},
isLimited: {
'Y': '是',
'N': '否'
},
isPromotionalGifts: {
'Y': '是',
'N': '否'
},
isAdvance: {
'Y': '是',
'N': '否'
},
isLimitbuy: {
'Y': '是',
'N': '否'
},
attribute: {
1: '普通',
2: '赠品'
}
}
console.log(NETSALEDATA.baseProductInfo.baseProduct);
/*
* 基本信息value值转换
* @param: basicInfo(请求的要渲染的数据), obj(转换的对象)
*/
function convert(basicInfo, obj) {
$.each(basicInfo, function(key, value) {
if (convertObj[key]) {
basicInfo[key] = convertObj[key][value];
}
});
return basicInfo;
}
var basicInfoData = convert(NETSALEDATA.baseProductInfo.baseProduct, convertObj);
basicInfoData.renderType = $('#basicInfoForm').data('type');
basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
$('#basic-info').html(basicInfohtml);
// var e = new common.edit('#basicForm');
// e.init();
... ...
... ... @@ -189,7 +189,7 @@ var g = new common.grid({
HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + '" 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-info btn-xs info-btn">查看</a>');
HtmArr.push('<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs info-btn">查看</a>');
return HtmArr.join('');
}
}]
... ... @@ -209,7 +209,7 @@ function shelveModal(title, html) {
var selectedArr = g.selected,
len = selectedArr.length,
productSknList = [],
shelveModal = null;
shelveLayer = null;
if (len <= 0) {
common.util.__tip('请选择要' + title + '的商品', 'warning');
... ... @@ -220,7 +220,7 @@ function shelveModal(title, html) {
productSknList.push(value['productSkn']);
});
shelveModal = common.dialog.open({
shelveLayer = common.dialog.open({
title: '上架',
content: html
});
... ... @@ -239,7 +239,7 @@ function shelveModal(title, html) {
option.success = function(res) {
if (res.data.code == 200) {
e.$tip(res.data.message, function() {
shelveModal.close();
shelveLayer.close();
}, 'growl-success');
} else {
e.$tip(res.data.message);
... ... @@ -267,9 +267,7 @@ $('#basicTable').on('click', '.shelve-btn', function() {
var that = this,
skn = $(this).data('skn'),
shelveModalHtml = '',
shelveModal = null;
var shelveModalHtml = common.util.__template($('#template').html());
shelveLayer = null;
$(that).addClass('disabled');
... ... @@ -280,7 +278,7 @@ $('#basicTable').on('click', '.shelve-btn', function() {
}
}, function(res) {
shelveModalHtml = common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct);
shelveModal = common.dialog.open({
shelveLayer = common.dialog.open({
title: '上/下架',
width: 900,
content: shelveModalHtml
... ... @@ -356,8 +354,8 @@ $('#basicTable').on('click', '.shelve-btn', function() {
data: param
}, function(res) {
console.log(res);
if (res.data.code == 200) {
shelveModal.close();
if (res.code == 200) {
shelveLayer.close();
}
})
})
... ...
'use strict';
var $ = require('jquery'),
common = require('../../common/common');
var modelCardTable = new common.grid({
el: "#model-card",
hash: false,
columns: [{
display: '模特',
name: 'modelName'
}, {
display: '尺码',
name: 'size'
}, {
display: '模特卡',
render: function(item) {
return '<img src="' + item.modelImg + '"/>';
}
}]
}).init(NETSALEDATA.modelcardList);
var modelTryTable = new common.grid({
el: "#model-try",
hash: false,
columns: [{
display: '模特',
name: 'modelName'
}, {
display: '身高/体重',
render: function(item) {
return item.height + 'cm/' + item.weight + 'kg';
}
}, {
display: '三围',
name: 'vitalStatistics',
render: function(item) {
return item.vitalStatistics + 'cm';
}
}, {
display: '试穿尺码',
render: function(item) {
return item.fitModelBo.fit_size;
}
}, {
display: '试穿描述',
render: function(item) {
return item.fitModelBo.feel;
}
}, {
display: '备注',
return: function(item) {
return item.fitModelBo.fit_remark;
}
}]
}).init(NETSALEDATA.modelTryList);
\ No newline at end of file
... ...
... ... @@ -193,14 +193,14 @@ exports.res = [
// url: '/product/getNetSaleInfo',
src: '/goods/netsale-edit',
data: {
action: ''
type: 'edit'
}//,
} //,
// params: [{
// name: 'param',
// type: 'number'
// }]
},{
}, {
route: '/goods/netsale/getdata',
method: 'POST',
url: '/product/getNetSaleInfo',
... ...
... ... @@ -29,7 +29,7 @@
<div class="panel-body">
<div class="panel panel-default">
<form class="form-horizontal form-bordered">
<form id="basicInfoForm" class="form-horizontal form-bordered" data-type="{{type}}">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
... ... @@ -37,66 +37,10 @@
<h2 class="panel-title">基本信息</h2>
</div>
<div class="panel-body nopadding">
{{# baseProductInfo}}
{{# baseProduct}}
<div class="form-group">
<blockquote>基本信息:</blockquote>
</div>
<div class="form-group">
<div class="col-sm-3">店铺:{{shopName}}</div>
<div class="col-sm-3">品牌:{{brandName}}</div>
<div class="col-sm-3">供应商:{{supplierName}}</div>
<div class="col-sm-3">厂家编号:{{factoryCode}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">品类:</div>
<div class="col-sm-3">货品年:{{goodsYears}}</div>
<div class="col-sm-3">货品季:{{goodsSeason}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">SKN:{{productSkn}}</div>
<div class="col-sm-3">商品类型:</div>
</div>
<div class="form-group">
<div class="col-sm-1 height40">商品名称<i class="red">*</i></div>
<div class="col-sm-8"><input class="form-control" placeholder="基础商品名称" type="text"></div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div>
</div>
<div class="form-group">
<div class="col-sm-12">商品话题:{{productTag}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">年龄层:{{ageLevel}}</div>
<div class="col-sm-3">性别:{{gender}}</div>
<div class="col-sm-3">重点款:{{grade}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否奥莱:{{isOutLets}}</div>
<div class="col-sm-3">限量款:{{isLimited}}</div>
<div class="col-sm-3">促销礼品:{{isPromotionalGifts}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否预售:{{isAdvance}}</div>
<div class="col-sm-3" style="color: #ccc;">预售库存:{{stock}}</div>
<div class="col-sm-3">预计到货时间:{{expectArrivalTime}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否限购:{{isLimitbuy}}</div>
<div class="col-sm-3">适销季:{{seasons}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">吊牌价:{{retailPrice}}</div>
<div class="col-sm-3">销售价:{{salesPrice}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否VIP:</div>
<div class="col-sm-3">预计上架时间:{{expectShelfTime}}</div>
</div>
{{/ baseProduct}}
{{/ baseProductInfo}}
<div id="basic-info">
</div>
<div class="form-group">
<div class="col-sm-12">
<h4>能否补货:</h4>
<table class="table table-bordered">
<thead>
... ... @@ -117,7 +61,6 @@
</tbody>
</table>
</div>
</div>
<div class="form-group">
<blockquote>上架必填:</blockquote>
... ... @@ -251,3 +194,64 @@
</div>
</div>
</script>
<script type="text/template" id="basicInfo">
<div class="form-group">
<blockquote>基本信息:</blockquote>
</div>
<div class="form-group">
<div class="col-sm-3">店铺:[[shopName]]</div>
<div class="col-sm-3">品牌:[[brandName]]</div>
<div class="col-sm-3">供应商:[[supplierName]]</div>
<div class="col-sm-3">厂家编号:[[factoryCode]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">品类:</div>
<div class="col-sm-3">货品年:[[goodsYears]]</div>
<div class="col-sm-3">货品季:[[goodsSeason]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">SKN[[productSkn]]</div>
<div class="col-sm-3">商品类型:[[attribute]]</div>
</div>
<div class="form-group">
<div class="col-sm-1 height40">商品名称<i class="red">*</i>:</div>
[[if renderType == 'edit']]
<div class="col-sm-8"><input class="form-control" placeholder="基础商品名称" type="text"></div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div>
[[else]]
<div class="col-sm-8">[[productName]]</div>
[[/if]]
</div>
<div class="form-group">
<div class="col-sm-12">商品话题:[[productTag]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">年龄层:[[ageLevel]]</div>
<div class="col-sm-3">性别:[[gender]]</div>
<div class="col-sm-3">重点款:[[grade]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否奥莱:[[isOutLets]]</div>
<div class="col-sm-3">限量款:[[isLimited]]</div>
<div class="col-sm-3">促销礼品:[[isPromotionalGifts]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否预售:[[isAdvance]]</div>
<div class="col-sm-3" style="color: #ccc;">预售库存:[[stock]]</div>
<div class="col-sm-3">预计到货时间:[[expectArrivalTime]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否限购:[[isLimitbuy]]</div>
<div class="col-sm-3">适销季:[[seasons]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">吊牌价:[[retailPrice]]</div>
<div class="col-sm-3">销售价:[[salesPrice]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否VIP</div>
<div class="col-sm-3">预计上架时间:[[expectShelfTime]]</div>
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -6,7 +6,12 @@
</div>
<h2 class="panel-title">模特</h2>
</div>
<div class="panel-body nopadding">
<div class="panel-body">
<h4>模特卡</h4>
<div id="model-card"></div>
<h4>试穿模特</h4>
<div id="model-try"></div>
<h4>尺码规范:</h4>
</div>
</form>
</div>
\ No newline at end of file
... ...
<div class="panel panel-default">
<form action="" class="form-horizontal form-bordered">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
<h2 class="panel-title">视频</h2>
</div>
<div class="panel-body nopadding">
<div class="video-file-wrap">
<span>请上传视频</span>
<input id="videofile" name="videofile" type="file" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10">
</div>
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
</div>
</form>
</div>
\ No newline at end of file
... ...