Authored by tanling

Merge branch 'dev_524_5.8逛二期' into test5.8

... ... @@ -856,6 +856,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">上传视频:</label>
<div class="col-sm-6">
<div class="cover-image-list col-sm-10">
<ul class="cover-image-list col-sm-10" id="addVideo" style="padding: 0;margin: 0;">
... ... @@ -863,18 +864,31 @@
<div class="goods-img">
<a class="fileinput-button-icon" id="imgATag" href="javascript:void(0);">+</a>
<input type="file" data-field="0.url" class="goods-img-upload picfile" name="picfile" id="picfile" placeholder="图片" multiple="true">
[[if contentData.data.src]]
<img id="imgTag" width="106" height="146" src="[[contentData.data.src]]?vframe/jpg/offset/0" >
[[else]]
<img id="imgTag" width="106" height="146">
[[/if]]
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="form-group">
<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="addImage" style="padding: 0;margin: 0;">
<li class="cover-image-item fileinput-button">
<div class="goods-img">
<a class="fileinput-button-icon" id="imgBTag" href="javascript:void(0);">+</a>
<input type="file" data-field="0.url" name="cover_image" id="cover_image" placeholder="图片" multiple="true">
[[if contentData.data.src]]
<img id="imgTag2" width="106" height="146" src="[[contentData.data.cover_image]]" >
[[else]]
<img id="imgTag2" width="106" height="146">
[[/if]]
</div>
</li>
</ul>
</div>
</div>
</div>
</script>
<script type="text/template" id="template_default_1">
... ...
... ... @@ -142,6 +142,7 @@ var Bll = {
module.contentData.data.src = $("#video_src").val();
module.contentData.data.size = $("#video_size").val();
module.contentData.data.video_intro = $("#video_intro").val();
module.contentData.data.cover_image = $("#imgTag2").val();
}
// 对于图片资源位,增加图片的原始尺寸
if(module.contentData.dialog == 'template_dialog_grid' || module.contentData.dialog == 'template_dialog_grid2') {
... ... @@ -195,8 +196,23 @@ var Bll = {
baidu.setContent(module.contentData.data.text);
};
if (module.contentData.dialog == "template_dialog_video") {
common.edit.ajaxfileupload("#cover_image", {
params: {
bucket: "article"
},
onComplete:function (response) {
console.log("url",response.data);
if (response.status && response.code == 200) {
$("#imgTag2").attr("src",response.data);
$("#imgTag2").val(response.data);
$("#imgTag2").show();
$("#imgBTag").hide();
}else {
common.util.__tip(response.message, 'warning');
}
}
});
};
common.edit.ajaxfileupload(".picfile", {
params: {
__type: "import-video",
... ... @@ -209,15 +225,11 @@ var Bll = {
onComplete: function (response) {
console.log("批量接口返回数据",response);
if (response.status && response.code == 200) {
if(response.data.fileSize>50){
common.util.__tip("视频不能超过50M", 'warning');
if(response.data.fileSize>200){
common.util.__tip("视频不能超过200M", 'warning');
}else{
$("#video_src").val(response.data.url);
$("#video_size").val(response.data.fileSize);
// if (loadModal) {
$("#imgTag").attr("src",response.data.url+"?vframe/jpg/offset/0");
$("#imgTag").show();
$("#imgATag").hide();
}
}
else {
... ... @@ -225,6 +237,9 @@ var Bll = {
}
}
});
};
},
renderDialog: function (templater) {
Bll.__render(".modal-body", templater, Bll.module);
... ... @@ -442,7 +457,8 @@ var Button = [
data: {
"src":"",
"video_intro":"",
"size":""
"size":"",
"cover_image":""
}
}];
$("#content_btns").html(common.util.__template2($("#template_content_btns").html(), {
... ...