Authored by 姜敏

模特管理,图片上传,试穿信息界面优化

... ... @@ -41,7 +41,7 @@ var g = new common.grid({
g.init("/meterManage/tryInfo/index2");
var modelLists = [];
//根据productSkn获取所有试穿信息并拼接返回
var getAllInfo = function (productSkn, callback) {
var getAllInfo = function (productSkn, maxSortId,callback) {
common.util.__ajax({url: '/meterManage/tryInfo/info1', data: {productSkn: productSkn}}, function (data) {
var feelIds = {
1: "合适",
... ... @@ -75,7 +75,12 @@ var getAllInfo = function (productSkn, callback) {
callback(modelLists);
new common.dropDown({
el: '.fit_size',
ajax: 'sortsize'
ajax: 'sortsize2',
params: function(){
return {
"sortId" : maxSortId
};
}
});
}, true);
};
... ... @@ -102,7 +107,7 @@ var getNewLists = function (modelLists, callback) {
//详情模态
var Bll = {
toast: function (url, item) {
getAllInfo(item.productSkn, function (data) {
getAllInfo(item.productSkn, item.maxSortId,function (data) {
var a = new common.dialog({
title: "试穿信息",
width: '80%',
... ...
... ... @@ -19,15 +19,12 @@ var g = new common.grid({
parms: function () {
return {
modelName: common.util.__input('content-filter1'),
englishName: common.util.__input('content-filter2'),
status: common.util.__input('status-filter'),
startTime: $('#starttime').val(),
endTime: $('#endtime').val(),
modelType: parseInt($("#aa").val()),
beginTime:((new Date($('#beginTime').val())).getTime())/1000,
endTime: ((new Date($('#endTime').val())).getTime())/1000,
modelType:parseInt($("#aa").val()),
status: parseInt($("#bb").val())
};
},
//列表显示
columns: [
{display: "ID", name: "id"},
... ... @@ -81,14 +78,44 @@ var Bll = {
toast: function (url, item, hint) {
var e = new common.edit("#baseform", {
bucket: "modelCard"//真实的
//bucket: "goodsimg"//测试
});
//验证英文名
//验证身高
e.on("validate", function () {
var height = $.trim($("#height").val());
if (height>250) {
return "身高值应小于250"
}
return true;
});
//验证体重
e.on("validate", function () {
var weight = $.trim($("#weight").val());
if (weight>200) {
return "体重值应小于200"
}
return true;
});
//验证胸围
e.on("validate", function () {
var Bust = $.trim($("#Bust").val());
if (Bust>200) {
return "胸围值应小于200"
}
return true;
});
//验证腰围
e.on("validate", function () {
var waist = $.trim($("#waist").val());
if (waist>200) {
return "腰围值应小于200"
}
return true;
});
//验证臀围
e.on("validate", function () {
var englishName = $.trim($("#englishName").val());
var a = (/^[a-zA-Z]+$/).test(englishName);
if (!a) {
return "英文名有误"
var hips = $.trim($("#hips").val());
if (hips>200) {
return "臀围值应小于200"
}
return true;
});
... ...
... ... @@ -21,15 +21,12 @@ var g = new common.grid({
modelName: common.util.__input('content-filter1'),
englishName: common.util.__input('content-filter2'),
status: common.util.__input('status-filter'),
startTime: $('#starttime').val(),
endTime: $('#endtime').val(),
modelType: parseInt($("#aa").val())
};
},
//列表显示
columns: [
{display:"ID",name:"id"},
{display: "姓名", name: "modelName"},
{display: "英文名", name: "englishName"},
{
... ... @@ -37,7 +34,7 @@ var g = new common.grid({
return '<img src="' + item.avatar + '" width="100" height="60"/>'
}
},//图片显示
{display: "国籍", name: "nationality" },
{display: "国籍", name: "nationality"},
{display: "身高", name: "height"},
{display: "体重", name: "weight"},
{
... ... @@ -66,14 +63,15 @@ var g = new common.grid({
}
},
{
display: "状态", name: "status",render: function (item) {
if (item.status == 1) {
return status = "启用"
}
else {
return status = "禁用"
}
display: "状态", name: "status", render: function (item) {
if (item.status == 1) {
return "启用"
}
else {
return "禁用"
}
}
},
{
... ... @@ -102,6 +100,46 @@ var Bll = {
}
return true;
});
//验证身高
e.on("validate", function () {
var height = $.trim($("#height").val());
if (height>250) {
return "身高值应小于250"
}
return true;
});
//验证体重
e.on("validate", function () {
var weight = $.trim($("#weight").val());
if (weight>200) {
return "体重值应小于200"
}
return true;
});
//验证胸围
e.on("validate", function () {
var Bust = $.trim($("#Bust").val());
if (Bust>200) {
return "胸围值应小于200"
}
return true;
});
//验证腰围
e.on("validate", function () {
var waist = $.trim($("#waist").val());
if (waist>200) {
return "腰围值应小于200"
}
return true;
});
//验证臀围
e.on("validate", function () {
var hips = $.trim($("#hips").val());
if (hips>200) {
return "臀围值应小于200"
}
return true;
});
var a = common.dialog.confirm(hint,
common.util.__template2($("#template").html(), item),
function () {
... ... @@ -110,9 +148,14 @@ var Bll = {
option.data.status = 1;//模特状态,默认启用
option.data.height = parseInt($("#height").val());//模特身高
option.data.weight = parseInt($("#weight").val());//模特体重
option.data.status = parseInt($("#status").val());//模特状态,默认启用
if (item.__state == 'add') {
option.data.status = 1;//模特状态,默认启用
}
else {
option.data.status = parseInt($("#status").val());//模特状态,默认启用
}
option.data.vitalStatistics = $("#Bust").val() + '|' + $("#waist").val() + "|" + $("#hips").val();//模特三围,拼接字符串
//console.log("option.data", option.data);
console.log("option.data", option.data);
//option.debug = true;//调试状态
option.success = function (res) {
//判断接口请求状态
... ... @@ -138,7 +181,7 @@ var Bll = {
//添加模特--点击事件
$('#add-content').on('click', function () {
var item = {
"__state":"add"
"__state": "add"
};
Bll.toast('/shotManage/model/addModel', item, "添加模特");
});
... ... @@ -150,7 +193,7 @@ var STATUS = {
//修改模特--点击事件
$(document).on('click', '.update', function () {
var item = g.rows[$(this).data("index")];
item.__state="update";
item.__state = "update";
var a = item.vitalStatistics.split(/[,|/]/g);
item.Bust = a[0];
item.waist = a[1];
... ...
... ... @@ -8,8 +8,7 @@ var common = require('../common/common');
$('.hasDatepicker').fdatepicker({
format: 'yyyy-mm-dd'
});
var starttime=new Date($('#starttime').val()).getTime();
var endtime=new Date($('#endtime').val()).getTime();
/**
* 列表显示数据
* @type {common.grid}
... ... @@ -23,8 +22,8 @@ var g = new common.grid({
productSkn: common.util.__input('content-filter1'),
productSkc: common.util.__input('content-filter2'),
productSku: common.util.__input('content-filter3'),
startTime: $('#starttime').val(),
endTime: $('#endtime').val()
startTime:((new Date($('#starttime').val())).getTime())/1000,
endTime: ((new Date($('#endtime').val())).getTime())/1000
};
},
//列表显示
... ...
... ... @@ -14,7 +14,6 @@ exports.res = [
view: 'pages/shotManage/model',//视图
src: '/shotManage/model',//控制层
data:{
search:true,
type:1,
typeName:'拍摄模特管理'
}
... ...
... ... @@ -40,18 +40,13 @@ exports.res = [
method: 'POST',
url: '/model/addModel',
params: [
{name: 'englishName', type: 'string'},//英文名
{name: 'height', type: 'Number'},//身高
{name: 'dressSize', type: 'string'},//穿衣尺码
{name: 'modelName', type: 'string'},//名称
{name: 'modelType', type: 'Number'},//模特类型:1 拍摄模特 2 试穿模特
{name: 'nationality', type: 'string'},//国籍
{name: 'status', type: 'Number'},//模特状态:0 禁用 1 启用
{name: 'shoeSize', type: 'string'},//鞋尺码
{name: 'vitalStatistics', type: 'string'},//三围
{name: 'weight', type: 'Number'},//体重
{name: 'avatar', type: 'string'},//头像
{name: 'modelCard', type: 'string'}//模特卡
{name: 'avatar', type: 'string'}//头像
]
},
//修改模特
... ... @@ -61,13 +56,9 @@ exports.res = [
url: '/model/updateModel',
params: [
{name: 'id', type: 'Number'},//主键
{name: 'englishName', type: 'string'},//英文名
{name: 'height', type: 'Number'},//身高
{name: 'dressSize', type: 'string'},//穿衣尺码
{name: 'modelName', type: 'string'},//名称
{name: 'modelType', type: 'Number'},//模特类型:1 拍摄模特 2 试穿模特
{name: 'nationality', type: 'string'},//国籍
{name: 'shoeSize', type: 'string'},//鞋尺码
{name: 'status', type: 'Number'},//模特状态:0 禁用 1 启用
{name: 'vitalStatistics', type: 'string'},//三围
{name: 'weight', type: 'Number'},//体重
... ...
... ... @@ -27,11 +27,11 @@
<div class="panel-body">
<div class="row">
<div class="panel-col2">
<input type="text" id="starttime" class="form-control panel-input hasDatepicker time" name="start_time"
<input type="text" id="beginTime" class="form-control panel-input hasDatepicker " name="begin_time"
placeholder="开始时间" value="" >
</div>
<div class="panel-col2">
<input type="text" id="endtime" class="form-control panel-input hasDatepicker time" name="end_time"
<input type="text" id="endTime" class="form-control panel-input hasDatepicker " name="end_time"
placeholder="结束时间" value="" >
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
... ... @@ -73,12 +73,10 @@
match="numbers" placeholder="身高(cm)" required="required"/>
</div>
<label class="col-sm-2 control-label" for="weight">体重</label>
<div class="col-sm-3">
<input type="number" value="[[weight]]" class="form-control" id="weight"
match="numbers" placeholder="体重(kg)" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">三围</label>
... ...
... ... @@ -37,7 +37,7 @@
<div class="panel-col">
<select name="status" id="status-filter" tabindex="-1" title=""
class="form-control">
<option value="">全部</option>
<option value="-1">全部</option>
<option value="0">禁用</option>
<option value="1">启用</option>
</select>
... ...
... ... @@ -26,14 +26,6 @@
</div>
<div class="panel-body">
<div class="row">
<!--<div class="panel-col">-->
<!--<select name="status" id="status-filter" tabindex="-1" title=""-->
<!--class="form-control">-->
<!--<option value="">状态</option>-->
<!--<option value="1">可用</option>-->
<!--<option value="0">不可用</option>-->
<!--</select>-->
<!--</div>-->
<div class="panel-col">
<select name="type" id="type-filter" tabindex="-1" title=""
class="form-control" required="required">
... ... @@ -58,7 +50,8 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="type">选择类别</label>
<div class="col-sm-6">
<select id="type" class="form-control" value="[[type]]">
<select id="type" class="form-control" value="[[type]]" placeholder="类别" required="required">
<option value="-1">请选择 </option>
<option value="1">拍摄类型 </option>
<option value="2">拍摄风格</option>
<option value="3">模特类型</option>
... ... @@ -71,7 +64,7 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="name">名称</label>
<div class="col-sm-6">
<input type="text" value="[[name]]" class="form-control" id="name" />
<input type="text" value="[[name]]" class="form-control" id="name" placeholder="名称" required="required"/>
</div>
</div>
... ...