Authored by 姜敏

模特管理(合并两种类型的模特管理)

/**
* Created by JiangMin on 2016/3/22.
* 试穿模特管理
*/
var $ = require('jquery');
var common = require('../common/common');
/**
* 列表显示数据
* @type {common.grid}
*/
var g = new common.grid({
el: '#content-list',
hash: false,
//查询参数
parms: function () {
return {
modelName: common.util.__input('content-filter1'),
englishName: common.util.__input('content-filter2'),
status: common.util.__input('status-filter')
};
},
//列表显示
columns: [
{display: "ID", name: "id"},
{display: "姓名", name: "modelName"},
{
display: "头像", name: "avatar", render: function (item) {
return '<img src="' + item.avatar + '" width="100" height="60"/>'
}
},//图片显示
{display: "身高", name: "height",render: function (item) {
return item.height+"cm"
}},
{display: "体重", name: "weight",render: function (item) {
return item.weight+"kg"
}},
{
display: "三围",name:vitalStatistics, render: function (item) {
return item.vitalStatistics+"cm";
}
},
{
display: "创建时间",name:time
},
{
display: "操作", name: "", render: function (item) {
var arr = [];
arr.push('<a class="btn btn-info update" data-index="' + item.__index + '">编辑</a>');
arr.push('<a class="btn btn-info delete" data-index="' + item.__index + '">删除</a>');
return arr.join('');
}
}
]
});
g.init("/meterManage/tryModel/index2");
... ... @@ -16,7 +16,8 @@ var g = new common.grid({
return {
modelName: common.util.__input('content-filter1'),
englishName: common.util.__input('content-filter2'),
status: common.util.__input('status-filter')
status: common.util.__input('status-filter'),
modelType: parseInt($("#aa").val())
};
},
//列表显示
... ... @@ -85,8 +86,8 @@ var Bll = {
//验证英文名
e.on("validate", function () {
var englishName = $.trim($("#englishName").val());
var a=(/^[a-zA-Z]+$/).test(englishName);
if(!a){
var a = (/^[a-zA-Z]+$/).test(englishName);
if (!a) {
return "英文名有误"
}
return true;
... ... @@ -95,13 +96,13 @@ var Bll = {
common.util.__template2($("#template").html(), item),
function () {
e.submit(url, function (option) {
option.data.modelType = 1;//模特类型,默认拍摄模特
option.data.modelType = parseInt($("#aa").val());//模特类型,1拍摄模特,2试穿模特
option.data.status = 1;//模特状态,默认启用
option.data.height = parseInt($("#height").val());//模特身高
option.data.weight = parseInt($("#weight").val());//模特体重
option.data.status = 1;//模特状态,默认启用
option.data.vitalStatistics = $("#Bust").val() + '|' + $("#waist").val() + "|" + $("#hips").val();//模特三围,拼接字符串
console.log("data", option.data);
//console.log("data", option.data);
//option.debug = true;//调试状态
option.success = function (res) {
//判断接口请求状态
... ...
... ... @@ -25,17 +25,34 @@ var g = new common.grid({
//列表显示
columns: [
{display: "SKN", name: "productSkn"},
{display: "最后上传时间", name: "endTime"},
{
display: "图片", name: "avatar", render: function (item) {
console.log("item",item);
display: "最后上传时间", name: "updateTime",
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: "pictureBoList", render: function (item) {
var a=item.pictureBoList;
if(a.length>0){
var b;
for(var i=0;i< a.length;i++){
b=b+'<img src="' + item.pictureBoList[i].fileName + '" width="100" height="60"/>'
}
return b.substr(9);
}
//return '<img src="' + item.pictureBoList[0].fileName + '" width="100" height="60"/>'
//console.log("item.pictureBoList", item.pictureBoList);
}
},
{
display: "操作", name: "", render: function (item) {
var arr = [];
arr.push('<a class="btn btn-info update" data-index="' + item.__index + '">修改</a>');
arr.push('<a class="btn btn-info delete" data-index="' + item.__index + '">删除</a>');
arr.push('<a class="btn btn-danger delete" data-index="' + item.__index + '">删除</a>');
return arr.join('');
}
}
... ...
... ... @@ -12,7 +12,10 @@ exports.res = [
route: '/shotManage/model/index',//访问路由
method: 'GET',//方法
view: 'pages/shotManage/model',//视图
src: '/shotManage/model'//控制层
src: '/shotManage/model',//控制层
data:{
type:1
}
},
//api请求数据
{
... ...
... ... @@ -11,12 +11,15 @@ exports.res = [
{
route: '/meterManage/tryModel/index',//访问路由
method: 'GET',//方法
view: 'pages/meterManage/tryModel',//视图
src: '/meterManage/tryModel'//控制层
view: 'pages/shotManage/model',//视图
src: '/shotManage/model',//控制层
data: {
type: 2
}
},
//api请求数据
{
route: '/meterManage/tryModel/index2',
route: '/shotManage/model/getAllModels',
method: 'POST',
url: '/model/queryModelList',
params: [
... ...
<!--试穿模特管理界面-->
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">尺码测量管理</a></li>
<li>试穿管理</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>试穿模特管理</h4>
</div>
</div>
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default" style="...">
<div class="panel-heading">
<a class="btn btn-success " id="add-content"><i class="fa fa-plus"></i> 添加试穿模特</a>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<input type="text" value="" name="modelName" id="content-filter1" placeholder="姓名"
class="form-control">
</div>
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
<input type="text" value="" name="englishName" id="content-filter2" placeholder="英文名"
class="form-control">
</div>
<div class="panel-col">
<select name="status" id="status-filter" tabindex="-1" title=""
class="form-control">
<option value="">全部</option>
<option value="0">禁用</option>
<option value="1">启用</option>
</select>
</div>
<input id="route" type="hidden" value="/operation/terms/searchWordsList">
<a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
</div>
</div>
</div>
<div id="content-list"></div>
</div>
<script type="text/template" id="template">
<div class="rows" id="baseform" >
<div class="form-group">
<label class="col-sm-2 control-label" for="avatar">头像</label>
<input type="hidden" value="[[id]]" id="id"/>
<div class="col-sm-6">
<input type="file" value="[[avatar]]" class="form-control" id="avatar" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="modelName">姓名</label>
<div class="col-sm-3">
<input type="text" value="[[modelName]]" class="form-control" id="modelName" required="required"/>
</div>
<label class="col-sm-2 control-label" for="englishName">英文名</label>
<div class="col-sm-3">
<input type="text" value="[[englishName]]" class="form-control" id="englishName" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="nationality">国籍</label>
<div class="col-sm-3">
<input type="text" value="[[nationality]]" class="form-control" id="nationality" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="height">身高</label>
<div class="col-sm-3">
<input type="number" value="[[height]]" class="form-control" id="height"
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"
placeholder="(kg)" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="dressSize">穿衣尺码</label>
<div class="col-sm-3">
<input type="text" value="[[dressSize]]" class="form-control" id="dressSize" required="required"/>
</div>
<label class="col-sm-2 control-label" for="shoeSize">鞋码</label>
<div class="col-sm-3">
<input type="text" value="[[shoeSize]]" class="form-control" id="shoeSize" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">三围</label>
<div class="col-sm-3">
<input type="text" value="[[Bust]]" class="form-control" id="Bust"
placeholder="胸围" required="required"/>
</div>
<div class="col-sm-3">
<input type="text" value="[[waist]]" class="form-control" id="waist"
placeholder="腰围" required="required"/>
</div>
<div class="col-sm-3">
<input type="text" value="[[hips]]" class="form-control" id="hips"
placeholder="臀围" required="required"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="modelCard">模特卡</label>
<div class="col-sm-10">
<input type="file" value="[[modelCard]]" class="form-control" id="modelCard" />
</div>
</div>
</div>
</script>
... ... @@ -7,7 +7,7 @@
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">拍摄管理</a></li>
<li><a href="">模特管理</a></li>
<li>模特管理</li>
</ul>
<div>
... ... @@ -48,6 +48,7 @@
</div>
</div>
<div id="content-list"></div>
<input type="hidden" id="aa" value="{{type}}"/>
</div>
<script type="text/template" id="template">
... ...