Authored by 姜敏

拍摄管理和测量管理功能(基本完成)

... ... @@ -9,6 +9,11 @@ var param = location.href.match(/(info)\/(\d+)/);
//尺码列表
var modelLists = [];
common.util.__ajax({url: '/meterManage/tryInfo/info1', data: {productSkn: param[2]}}, function (data) {
var feelIds = {
1: "合适",
2: "偏大",
3: "偏小"
};
var infoLists = data.data || {};
modelLists = infoLists.tryModelList || [];
//如果存在试穿信息
... ... @@ -17,13 +22,12 @@ common.util.__ajax({url: '/meterManage/tryInfo/info1', data: {productSkn: param[
for (var i = 0; i < modelLists.length; i++) {
if (tryInfo[modelLists[i].id]) {
modelLists[i].tryInfo = {};
tryInfo[modelLists[i].id].feel_id = [tryInfo[modelLists[i].id].feel_id];
modelLists[i].tryInfo = tryInfo[modelLists[i].id];
modelLists[i].tryInfo.fell_name = feelIds[tryInfo[modelLists[i].id].feel_id];
}
else {
modelLists[i].tryInfo = {};
modelLists[i].tryInfo.fit_size = "";
modelLists[i].tryInfo.feel_id = "";
modelLists[i].tryInfo.fit_remark = "";
}
}
... ... @@ -48,22 +52,22 @@ $(document).on("change", ".tryInfo1", function () {
var name = $(this).data('name');
item[name] = $(this).val();
});
//保存试穿信息
$(document).on("click", "#addInfo", function () {
var newList = [];
for (var i = 0; i < modelLists.length; i++) {
newList[i]={};
newList[i] = {};
newList[i].model_id = modelLists[i].id;
if(modelLists[i].tryInfo){
if (modelLists[i].tryInfo) {
newList[i].feel_id = modelLists[i].tryInfo.feel_id;
newList[i].fit_size = modelLists[i].tryInfo.fit_size;
newList[i].fit_remark = modelLists[i].tryInfo.fit_remark;
}
else{
newList[i].feel_id ="";
else {
newList[i].feel_id = "";
newList[i].fit_size = "";
newList[i].fit_remark ="";
newList[i].fit_remark = "";
}
}
common.util.__ajax({
url: '/meterManage/tryInfo/add',
... ... @@ -71,10 +75,20 @@ $(document).on("click", "#addInfo", function () {
productSkn: param[2],
productModelTry: JSON.stringify(newList)
}
}, function () {
console.log("成功")
}, function (res) {
if (res.code == '200') {
window.location.href = "/meterManage/tryInfo/index"
}
else {
}
});
});
//返回
$(document).on("click", ".back", function () {
window.location.href = "/meterManage/tryInfo/index"
});
... ...
... ... @@ -17,7 +17,7 @@ var g = new common.grid({
modelName: common.util.__input('content-filter1'),
englishName: common.util.__input('content-filter2'),
status: common.util.__input('status-filter'),
modelType: $("#aa").val()
modelType: parseInt($("#aa").val())
};
},
... ...
... ... @@ -61,27 +61,50 @@ var g = new common.grid({
]
});
g.init("/shotManage/proPhoto/index2");
var pictureBoList = [];
var Bll = {
toast: function (url, item, hint) {
var a = common.dialog.confirm(hint,
common.util.__template2($("#template1").html(), item),
function () {
pictureBoList: [],
selectedBoId: [],
//重新渲染图片列表
rendBoList: function (pictureBoList) {
$(".image-list").html('');
$("#addPic").append(common.util.__template2($("#template2").html(),
{
pictureBoList: pictureBoList
}
));
},
toast: function (url, item, datacall) {
Bll.pictureBoList = item.pictureBoList || [];
Bll.selectedBoId = [];
var a = new common.dialog({
title: "图片",
width: '80%',
content: common.util.__template2($("#template1").html(), item),
button: [
{
value: "提交", callback: function () {
var data = datacall && datacall(Bll.pictureBoList, Bll.selectedBoId);
common.util.__ajax({
url: url,
data: {
productSku: parseInt($("#Sku").val()),
productPhotoAddStrList: JSON.stringify(pictureBoList)
}
data: data
}, function (res) {
if (res.code == '200') {
g.reload();
a.close();
pictureBoList = [];
}
});
return false;
}, css: "btn-primary"
},
{
"value":"取消",
css: "btn-info"
}
]
});
Bll.rendBoList(Bll.pictureBoList);
common.edit.ajaxfileupload(".picfile", {
params: {
__type: "upload",
... ... @@ -90,17 +113,13 @@ var Bll = {
valid_extensions: ['png', 'jpg', 'jpeg'],
onComplete: function (response) {
if (response.status && response.code == 200) {
//console.log("response",response);
console.log("response", response);
var data = {
"fileName": response.data,
"originalName": "1035027.jpg"
};
pictureBoList.push(data);
$("#addPic").html(common.util.__template2($("#template2").html(),
{
pictureBoList: pictureBoList
}
));
Bll.pictureBoList.push(data);
Bll.rendBoList(Bll.pictureBoList);
}
else {
common.util.__tip(response.message, 'warning');
... ... @@ -112,55 +131,39 @@ var Bll = {
};
//上传图片--点击事件
$('#upload-btn').on('click', function () {
var item = {};
Bll.toast('/shotManage/proPhoto/add', item, "上传图片");
var item = {
__state: "add"
};
Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) {
return {
productSku: parseInt($("#Sku").val()),
productPhotoAddStrList: JSON.stringify(pictureBoList)
}
});
});
//上传图片时 删除单张图片
//删除单张图片
$(document).on('click', '.remove1', function () {
var index = $(this).parents(".cover-image-item").index();
//界面删除
$(this).parents('.cover-image-item').remove();
//数组中删除
pictureBoList.splice(index, 1);
//console.log("pictureBoList", pictureBoList);
var index = $(this).data("index");
Bll.selectedBoId.push(Bll.pictureBoList[index].id);
Bll.pictureBoList.splice(index, 1);
Bll.rendBoList(Bll.pictureBoList);
});
//查询按钮--点击事件
$(document).on('click', '#filter-btn', function () {
g.reload(1);
});
var ids = [];
//编辑
$(document).on('click', '.update', function () {
var item = g.rows[$(this).data("index")];
var pics = item.pictureBoList || [];
console.log("pics",pics);
$(document).on('click', '.remove2', function () {
var index = $(this).parents(".cover-image-item").index();
//界面删除
$(this).parents('.cover-image-item').remove();
console.log(pics[index]);
console.log("pics[index].id",pics[index].id);
ids.push(pics[index].id);
pics.splice(index, 1);
});
var b = common.dialog.confirm("编辑", common.util.__template2($("#template3").html(), item),
function () {
common.util.__ajax({
url: "/shotManage/proPhoto/update",
data: {
item.__state = "update";
Bll.toast('/shotManage/proPhoto/update', item, function (pictureBoList, selectedBoId) {
return {
productSkn: item.productSkn,
ids: JSON.stringify(ids)
}
}, function (res) {
//console.log("res",res);
if (res.code == '200') {
g.reload();
ids = [];
ids: JSON.stringify(selectedBoId)
}
});
})
});
//查询按钮--点击事件
$(document).on('click', '#filter-btn', function () {
g.reload(1);
});
... ...
... ... @@ -3,8 +3,8 @@
* 模特管理
*/
//exports.domain = require('../config/common.js').domain;
exports.domain = 'http://172.16.6.162:8088/platform'; //李建
//exports.domain = 'http://192.168.102.216:8180/platform'; //测试环境
//exports.domain = 'http://172.16.6.162:8088/platform'; //李建
exports.domain = 'http://192.168.102.216:8180/platform'; //测试环境
exports.res = [
//主界面
... ...
... ... @@ -34,8 +34,8 @@ exports.res = [
view: 'pages/meterManage/info',
src: '/meterManage/info'
},
{
// 获取商品详情数据
{
route: '/meterManage/tryInfo/info1',
method: 'POST',
url: '/productExtraInfo/queryProdExtraInfo',
... ...
... ... @@ -3,7 +3,7 @@
* 试穿模特管理
*/
//exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.162:8080/platform'; //李建
//exports.domain = 'http://172.16.6.162:8088/platform'; //李建
exports.domain = 'http://192.168.102.216:8180/platform'; //测试环境
exports.res = [
... ...
... ... @@ -20,7 +20,7 @@
</div>
<div class="col-sm-4">
<a class="btn btn-info addInfo" id="addInfo">保存</a>
<!--<a class="btn btn-primary back" >返回</a>-->
<a class="btn btn-primary back" >返回</a>
</div>
</div>
... ... @@ -41,13 +41,18 @@
</select>
</th>
<th>
<select name="status" value="[[item.tryInfo.feel_id]]" data-name="feel_id" data-index="[[index]]" title="" class="form-controller tryInfo1">
[[if item.tryInfo.feel_id]]
<select name="status" data-name="feel_id" data-index="[[index]]" title="" class="form-controller col-sm-8 tryInfo1">
<option value="[[item.tryInfo.feel_id]]">[[item.tryInfo.fell_name]]</option>
</select>
[[else]]
<select name="status" data-name="feel_id" data-index="[[index]]" title="" class="form-controller col-sm-8 tryInfo1">
<option value="-1">[['请选择试穿描述']]</option>
<option value="1">[['合适']]</option>
<option value="2">[['偏大']]</option>
<option value="3">[['偏小']]</option>
</select>
[[/if]]
</th>
<th>
<input type="text" data-name="fit_remark" data-index="[[index]]" value="[[item.tryInfo.fit_remark]]" name="fit_remark" id="fit_remark" class="tryInfo1 "
... ...
... ... @@ -42,7 +42,6 @@
<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>
... ... @@ -58,7 +57,7 @@
<input type="hidden" value="[[id]]" id="id"/>
<div class="col-sm-6">
<input type="file" value="[[avatar]]" class="form-control avatar" id="avatar" name="avatar" />
<input type="file" value="[[avatar]]" class="form-control avatar" id="avatar" name="avatar" required="required"/>
</div>
</div>
<div class="form-group">
... ... @@ -130,7 +129,7 @@
<label class="col-sm-2 control-label" for="modelCard">模特卡</label>
<div class="col-sm-10">
<input type="file" value="[[modelCard]]" class="form-control modelCard" id="modelCard" name="modelCard"/>
<input type="file" value="[[modelCard]]" class="form-control modelCard" id="modelCard" name="modelCard" required="required"/>
</div>
</div>
</div>
... ...
... ... @@ -23,14 +23,14 @@
<div class="panel panel-default" style="...">
<div class="panel-body">
<div class="row">
<div class="panel-col2">
<input type="text" id="starttime" class="form-control panel-input hasDatepicker" name="start_time"
placeholder="开始时间" value="">
</div>
<div class="panel-col2">
<input type="text" id="endtime" class="form-control panel-input hasDatepicker" name="end_time"
placeholder="结束时间" value="">
</div>
<!--<div class="panel-col2">-->
<!--<input type="text" id="starttime" class="form-control panel-input hasDatepicker" name="start_time"-->
<!--placeholder="开始时间" value="">-->
<!--</div>-->
<!--<div class="panel-col2">-->
<!--<input type="text" id="endtime" class="form-control panel-input hasDatepicker" name="end_time"-->
<!--placeholder="结束时间" value="">-->
<!--</div>-->
<div class="panel-col">
<input type="text" value="" name="productSkn" id="content-filter1" placeholder="skn"
class="form-control">
... ... @@ -47,7 +47,6 @@
<a id="filter-btn" href="javascript:;" class="btn btn-info">查询</a>
<a id="upload-btn" href="javascript:;" class="btn btn-info">上传图片</a>
</div>
</div>
</div>
</div>
... ... @@ -57,6 +56,7 @@
<!--上传图片-->
<script type="text/template" id="template1">
<div class="rows" style="height: 400px;overflow: auto">
[[if __state=='add']]
<div class="form-group">
<label class="col-sm-2 control-label" for="Sku">SKU</label>
... ... @@ -64,68 +64,44 @@
<input type="text" value="[[productSku]]" class="form-control" id="Sku"/>
</div>
</div>
[[else]]
<div class="form-group">
<label class="col-sm-2 control-label">图片</label>
<label class="col-sm-2">SKN</label>
<div class="cover-image-list col-sm-10" id="addPic">
<div class="col-sm-6">
<input type="text" value=[[productSkn]] class="form-control" disabled="disabled">
</div>
</div>
[[/if]]
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<ul class="cover-image-list col-sm-10" style="padding: 0;margin: 0;">
<label class="col-sm-2 control-label">图片</label>
<div class="cover-image-list col-sm-10">
<!-- 用于修改 -->
<ul class="cover-image-list col-sm-10" id="addPic" style="padding: 0;margin: 0;">
<!-- 修改时不存在 -->
[[if __state=='add']]
<li class="cover-image-item fileinput-button">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">+</a>
<input type="file" class="goods-img-upload picfile" name="picfile">
</div>
</li>
[[/if]]
</ul>
</div>
</div>
</script>
<script type="text/template" id="template2">
<ul class="cover-image-list col-sm-10" style="padding: 0;margin: 0;">
[[each pictureBoList as _item _index]]
<li class="cover-image-item" data-index=[[_index]]>
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[_item.fileName]]">
</a>
<i class="remove-item-btn remove1 glyphicon glyphicon-remove-circle"></i>
</div>
</li>
[[/each]]
</ul>
</script>
<script type="text/template" id="template3">
<div class="row" style="height: 400px;overflow: auto">
<div class="form-group">
<label class="col-sm-2">SKN</label>
<div class="col-sm-6">
<input type="text" value=[[productSkn]] disabled="disabled">
</div>
</div>
<div class="form-group">
<label class="col-sm-2">图片</label>
<div class="col-sm-10">
<ul class="cover-image-list col-sm-10" style="padding: 0;margin: 0;">
<!--图片列表-->
<script type="text/template" id="template2">
[[each pictureBoList as _item _index]]
<li class="cover-image-item" data-index=[[_index]]>
<li class="cover-image-item image-list" data-index=[[_index]]>
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">
<img src="[[_item.fileName]]">
</a>
<i class="remove-item-btn remove2 glyphicon glyphicon-remove-circle"></i>
<i class="remove-item-btn remove1 glyphicon glyphicon-remove-circle" data-index="[[_index]]"></i>
</div>
</li>
[[/each]]
</ul>
</div>
</div>
</div>
</script>
... ...