...
|
...
|
@@ -55,39 +55,16 @@ var g = new common.grid({ |
|
|
g.init("/video/queryVideosList");
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
var Bll = {
|
|
|
pictureBoList: [],
|
|
|
selectedBoId: [],
|
|
|
clonePics: [],
|
|
|
//重新渲染图片列表
|
|
|
rendBoList: function (pictureBoList) {
|
|
|
$(".image-list").html('');
|
|
|
$("#addPic").prepend(common.util.__template2($("#template2").html(),
|
|
|
{
|
|
|
pictureBoList: pictureBoList
|
|
|
}
|
|
|
));
|
|
|
},
|
|
|
//获取编辑时新增的图片
|
|
|
getNewPics: function (pictureBoList) {
|
|
|
var newPic = [];
|
|
|
if (pictureBoList.length > 0) {
|
|
|
for (var i = 0; i < pictureBoList.length; i++) {
|
|
|
if (!pictureBoList[i].id) {
|
|
|
newPic.push(pictureBoList[i])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return newPic
|
|
|
},
|
|
|
//模态
|
|
|
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),
|
|
|
title: "添加视频",
|
|
|
width: '50%',
|
|
|
content: common.util.__template2($("#template").html(), item),
|
|
|
button: [
|
|
|
{
|
|
|
value: "提交", callback: function () {
|
...
|
...
|
@@ -122,20 +99,22 @@ var Bll = { |
|
|
}
|
|
|
]
|
|
|
});
|
|
|
Bll.rendBoList(Bll.pictureBoList);
|
|
|
/*Bll.rendBoList(Bll.pictureBoList);*/
|
|
|
common.edit.ajaxfileupload(".picfile", {
|
|
|
params: {
|
|
|
__type: "upload",
|
|
|
bucket: "goodsimg"
|
|
|
__type: "import-video",
|
|
|
bucket: "goodsvideo"
|
|
|
},
|
|
|
valid_extensions: ['png', 'jpg', 'jpeg'],
|
|
|
valid_extensions: ['mp4'],
|
|
|
onComplete: function (response) {
|
|
|
console.log("批量接口返回数据",response);
|
|
|
if (response.status && response.code == 200) {
|
|
|
for (var i = 0; i < response.datas.length; i++) {
|
|
|
alert(" 上传成功")
|
|
|
/*for (var i = 0; i < response.datas.length; i++) {
|
|
|
var name = response.names[i];
|
|
|
var index = name.indexOf('.');
|
|
|
var name1 = name.substr(0, index);
|
|
|
//判断图片名称是否符合标准
|
|
|
//判断图片名称是否符合标准
|
|
|
if ((/^[0-9]+[_][0-9]+$/).test(name1) || (/^[1-9]\d*$/).test(name1)) {
|
|
|
Bll.pictureBoList.push({
|
|
|
"fileName": response.datas[i],
|
...
|
...
|
@@ -150,7 +129,7 @@ var Bll = { |
|
|
common.util.__tip("图片应以sku命名", "warning");
|
|
|
}
|
|
|
}
|
|
|
Bll.rendBoList(Bll.clonePics);
|
|
|
Bll.rendBoList(Bll.clonePics);*/
|
|
|
}
|
|
|
else {
|
|
|
common.util.__tip(response.message, 'warning');
|
...
|
...
|
@@ -159,54 +138,26 @@ var Bll = { |
|
|
});
|
|
|
}
|
|
|
};
|
|
|
//上传图片--点击事件
|
|
|
$('#upload-btn').on('click', function () {
|
|
|
|
|
|
//添加
|
|
|
$('#addVideo').on('click', function () {
|
|
|
var item = {
|
|
|
__state: "add"
|
|
|
"__state": "add",
|
|
|
'englishName': "",//英文名
|
|
|
'height': "",//身高
|
|
|
'dressSize': "",//穿衣尺码
|
|
|
'modelName': "",//名称
|
|
|
'modelType': 1,//模特类型:1 拍摄模特 2 试穿模特
|
|
|
'nationality': "",//国籍
|
|
|
'status': 1,//模特状态:0 禁用 1 启用
|
|
|
'shoeSize': "",//鞋尺码
|
|
|
'vitalStatistics': "",//三围
|
|
|
"Bust": "",//胸围
|
|
|
"waist": "",//腰围
|
|
|
"hips": "",//臀围
|
|
|
'weight': "",//体重
|
|
|
'avatar': "",//头像
|
|
|
'modelCard': ""//模特卡
|
|
|
};
|
|
|
Bll.clonePics = [];
|
|
|
Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) {
|
|
|
return {
|
|
|
productPhotoAddStrList: JSON.stringify(pictureBoList)
|
|
|
}
|
|
|
});
|
|
|
Bll.toast('/shotManage/model/addModel', item, "添加视频");
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
|
|
|
/*下拉选择*/
|
|
|
new common.dropDown({
|
|
|
el: "#shopId",
|
|
|
ajax: "queryShopPass",
|
|
|
hash: true
|
|
|
});
|
|
|
|
|
|
//编辑
|
|
|
$(document).on('click', '.update', function () {
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
item.__state = "update";
|
|
|
Bll.clonePics = [];
|
|
|
Array.prototype.push.apply(Bll.clonePics, item.pictureBoList);
|
|
|
Bll.toast('/shotManage/proPhoto/add', item, function (pictureBoList, selectedBoId) {
|
|
|
return {
|
|
|
productSkn: item.productSkn,
|
|
|
ids: JSON.stringify(selectedBoId),
|
|
|
productPhotoAddStrList: JSON.stringify(pictureBoList)
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
//删除单张图片
|
|
|
$(document).on('click', '.remove1', function () {
|
|
|
var index = $(this).data("index");
|
|
|
if (Bll.clonePics[index].id) {
|
|
|
Bll.selectedBoId.push(Bll.clonePics[index].id);
|
|
|
}
|
|
|
Bll.clonePics.splice(index, 1);
|
|
|
Bll.rendBoList(Bll.clonePics);
|
|
|
});
|
|
|
|
|
|
//查询按钮--点击事件
|
|
|
$(document).on('click', '#filter-btn', function () {
|
|
|
g.reload(1);
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
|