...
|
...
|
@@ -59,44 +59,38 @@ g.init("/video/queryVideosList"); |
|
|
//
|
|
|
var Bll = {
|
|
|
newVideo: {},
|
|
|
selectedBoId = [],
|
|
|
rendBoList: function (pictureBoList) {
|
|
|
$(".image-list").html('');
|
|
|
$("#addPic").prepend(common.util.__template2($("#template2").html(),
|
|
|
{
|
|
|
pictureBoList: pictureBoList
|
|
|
}
|
|
|
));
|
|
|
rendBoList: function (obj) {
|
|
|
$("#imgTag").attr("src",obj.url+"?vframe/jpg/offset/0");
|
|
|
$("#imgTag").show();
|
|
|
$("#imgATag").hide();
|
|
|
},
|
|
|
toast: function (url, item, datacall) {
|
|
|
Bll.selectedBoId = [];
|
|
|
var a = new common.dialog({
|
|
|
title: "添加视频",
|
|
|
title: "视频",
|
|
|
width: '50%',
|
|
|
content: common.util.__template2($("#template").html(), item),
|
|
|
button: [
|
|
|
{
|
|
|
value: "提交", callback: function () {
|
|
|
var data = {};
|
|
|
if (item.__state == 'add') {
|
|
|
data = datacall && datacall(Bll.newVideo, Bll.selectedBoId);
|
|
|
} else {
|
|
|
data = datacall && datacall(Bll.getNewPics(Bll.clonePics), Bll.selectedBoId);
|
|
|
}
|
|
|
/*if(item.__state == "edit" ){
|
|
|
Bll.newVideo.url=item.url;
|
|
|
Bll.newVideo.fileName=item.fileName;
|
|
|
Bll.newVideo.videoSize=item.fileSize;
|
|
|
}*/
|
|
|
|
|
|
console.log("ajax提交的参数:"+data)
|
|
|
Bll.newVideo.id=item.id;
|
|
|
Bll.newVideo.videoName = $.trim($("#videoName").val());
|
|
|
Bll.newVideo.skn = $.trim($("#skn").val());
|
|
|
Bll.newVideo.note = $.trim($("#note").val());
|
|
|
|
|
|
console.log("提交的参数:"+JSON.stringify(Bll.newVideo));
|
|
|
common.util.__ajax({
|
|
|
url: url,
|
|
|
data: data
|
|
|
data: Bll.newVideo
|
|
|
}, function (res) {
|
|
|
if (res.code == '200') {
|
|
|
if (res.data.length > 0) {
|
|
|
var mess = "失败列表:";
|
|
|
for (var i = 0; i < res.data.length; i++) {
|
|
|
mess = mess + '<p>' + res.data[i].originalName + ';' + '</p>';
|
|
|
}
|
|
|
common.util.__tip(mess, 'warning');
|
|
|
}
|
|
|
/*common.util.__tip("上传成功", 'success');*/
|
|
|
g.reload();
|
|
|
a.close();
|
|
|
}
|
...
|
...
|
@@ -110,38 +104,27 @@ var Bll = { |
|
|
}
|
|
|
]
|
|
|
});
|
|
|
/*Bll.rendBoList(Bll.pictureBoList);*/
|
|
|
//Bll.rendBoList(Bll.pictureBoList);
|
|
|
// var loadModal = null;
|
|
|
common.edit.ajaxfileupload(".picfile", {
|
|
|
params: {
|
|
|
__type: "import-video",
|
|
|
bucket: "goodsvideo"
|
|
|
},
|
|
|
valid_extensions: ['mp4'],
|
|
|
// onStart: function(params) {
|
|
|
// loadModal = common.dialog.load();
|
|
|
// },
|
|
|
onComplete: function (response) {
|
|
|
console.log("批量接口返回数据",response);
|
|
|
if (response.status && response.code == 200) {
|
|
|
Bll.newVideo.url=response.data.url;
|
|
|
Bll.newVideo.fileName=response.data.fileName;
|
|
|
/*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],
|
|
|
"originalName": response.names[i]
|
|
|
});
|
|
|
Bll.clonePics.push({
|
|
|
"fileName": response.datas[i],
|
|
|
"originalName": response.names[i]
|
|
|
})
|
|
|
}
|
|
|
else {
|
|
|
common.util.__tip("图片应以sku命名", "warning");
|
|
|
}
|
|
|
}
|
|
|
Bll.rendBoList(Bll.clonePics);*/
|
|
|
Bll.newVideo.videoSize=response.data.fileSize;
|
|
|
// if (loadModal) {
|
|
|
// loadModal.close();
|
|
|
// }
|
|
|
Bll.rendBoList(Bll.newVideo);
|
|
|
}
|
|
|
else {
|
|
|
common.util.__tip(response.message, 'warning');
|
...
|
...
|
@@ -157,26 +140,48 @@ var Bll = { |
|
|
//添加
|
|
|
$('#addVideo').on('click', function () {
|
|
|
var item = {
|
|
|
"__state": "add",
|
|
|
'englishName': "",//英文名
|
|
|
'height': "",//身高
|
|
|
'dressSize': "",//穿衣尺码
|
|
|
'modelName': "",//名称
|
|
|
'modelType': 1,//模特类型:1 拍摄模特 2 试穿模特
|
|
|
'nationality': "",//国籍
|
|
|
'status': 1,//模特状态:0 禁用 1 启用
|
|
|
'shoeSize': "",//鞋尺码
|
|
|
'vitalStatistics': "",//三围
|
|
|
"Bust": "",//胸围
|
|
|
"waist": "",//腰围
|
|
|
"hips": "",//臀围
|
|
|
'weight': "",//体重
|
|
|
'avatar': "",//头像
|
|
|
'modelCard': ""//模特卡
|
|
|
"__state":"add",
|
|
|
"videoName": "",
|
|
|
'skn': "",
|
|
|
'url': "",
|
|
|
'note': ""
|
|
|
};
|
|
|
Bll.toast('/shotManage/model/addModel', item, function(){
|
|
|
|
|
|
Bll.toast('/video/addVideo', item, function(){
|
|
|
return {
|
|
|
productPhotoAddStrList: JSON.stringify(pictureBoList)
|
|
|
productPhotoAddStrList: "32423"
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
//查询按钮--点击事件
|
|
|
$(document).on('click', '#filter-btn', function () {
|
|
|
g.reload(1);
|
|
|
});
|
|
|
|
|
|
//删除--点击事件
|
|
|
$(document).on('click', '.delete', function () {
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
common.dialog.confirm("警告",
|
|
|
"确认删除?",
|
|
|
function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/video/delVideo',
|
|
|
data: {
|
|
|
id: item.id
|
|
|
}
|
|
|
}, function () {
|
|
|
g.reload(1);
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
//修改--点击事件
|
|
|
$(document).on('click', '.update', function () {
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
item.__state="edit";
|
|
|
console.log("修改"+ item.url);
|
|
|
|
|
|
Bll.toast('/video/addVideo', item, "修改视频");
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|