diff --git a/service/Application/Admin/Lang/zh-cn/goods.php b/service/Application/Admin/Lang/zh-cn/goods.php
index 478e66800..37df73c4a 100755
--- a/service/Application/Admin/Lang/zh-cn/goods.php
+++ b/service/Application/Admin/Lang/zh-cn/goods.php
@@ -97,5 +97,8 @@ return array(
'goods_home_recommended_images_tips'=> '留空则取相册第一张图',
'goods_brand_id_text' => '品牌',
+
+ 'goods_video_text' => '短视频',
+ 'goods_video_tips' => '视频比图文更有具带入感,仅支持 mp4 格式',
);
?>
\ No newline at end of file
diff --git a/service/Application/Admin/View/Default/Goods/SaveInfo.html b/service/Application/Admin/View/Default/Goods/SaveInfo.html
index 6e64a37b1..50d46462a 100755
--- a/service/Application/Admin/View/Default/Goods/SaveInfo.html
+++ b/service/Application/Admin/View/Default/Goods/SaveInfo.html
@@ -25,9 +25,9 @@
{{:L('goods_nav_photo_name')}}
-
+
{{:L('goods_nav_attribute_name')}}
@@ -178,10 +178,22 @@
-
+
+
+
diff --git a/service/Application/Common/Lang/zh-cn.php b/service/Application/Common/Lang/zh-cn.php
index 2e9667f2f..cc42891ed 100755
--- a/service/Application/Common/Lang/zh-cn.php
+++ b/service/Application/Common/Lang/zh-cn.php
@@ -94,6 +94,8 @@ return array(
'common_select_file_tips' => '请选择需要上传的文件',
'common_select_images_text' => '选择图片',
'common_select_images_tips' => '请选择需要上传的图片',
+ 'common_select_video_text' => '选择视频',
+ 'common_select_video_tips' => '请选择需要上传的视频',
'common_unknown_error' => '未知错误',
'common_on_fill_in_images' => '暂无图片',
'common_unlimited_text' => '不限',
diff --git a/service/Public/Admin/Default/Css/Common.css b/service/Public/Admin/Default/Css/Common.css
index 12d9bcd41..998fce571 100755
--- a/service/Public/Admin/Default/Css/Common.css
+++ b/service/Public/Admin/Default/Css/Common.css
@@ -396,7 +396,6 @@ ul {margin-top:0;}
.common-left-menu a:hover,.common-left-menu-active {background:#ececec;color:#333 !important;}
#ifcontent {border:0px;width:100%;overflow-x:hidden;}
.am-table > tbody > tr > td {vertical-align:top;}
-.am-form-file input[type="file"] { margin-top: 0; }
/**
* excel导入窗口
diff --git a/service/Public/Common/Js/Common.js b/service/Public/Common/Js/Common.js
index 916a072c1..88e0d4b45 100755
--- a/service/Public/Common/Js/Common.js
+++ b/service/Public/Common/Js/Common.js
@@ -628,6 +628,83 @@ function ImageFileUploadShow(class_name, show_img, default_images)
});
}
+/**
+ * [VideoFileUploadShow 视频上传预览]
+ * @param {[string]} class_name [class名称]
+ * @param {[string]} show_video [预览视频id或class]
+ * @param {[string]} default_video [默认视频]
+ */
+function VideoFileUploadShow(class_name, show_video, default_video)
+{
+ $(document).on("change", class_name, function(imgFile)
+ {
+ show_video = $(this).data('video-tag') || null;
+ var status = false;
+ if((imgFile.target.value || null) != null)
+ {
+ var filextension = imgFile.target.value.substring(imgFile.target.value.lastIndexOf("."),imgFile.target.value.length);
+ filextension = filextension.toLowerCase();
+ if(filextension != '.mp4')
+ {
+ Prompt("视频格式错误,请重新上传");
+ } else {
+ if(document.all)
+ {
+ Prompt('ie浏览器不可用');
+ /*imgFile.select();
+ path = document.selection.createRange().text;
+ $(this).parent().parent().find('img').attr('src', '');
+ $(this).parent().parent().find('img').attr('src', path); //使用滤镜效果 */
+ } else {
+ var url = window.URL.createObjectURL(imgFile.target.files[0]);// FF 7.0以上
+ $(show_video).attr('src', url);
+ status = true;
+ }
+ }
+ }
+ var default_video = $(show_video).data('default') || null;
+ if(status == false && ((default_video || null) != null || default_video != null))
+ {
+ $(show_video).attr('src', default_video || default_video);
+ }
+ });
+}
+
+
+// 校验浏览器是否支持视频播放
+function CheckVideo()
+{
+ if(document.createElement('video').canPlayType)
+ {
+ var vid_test = document.createElement("video");
+ var ogg_test = vid_test.canPlayType('video/ogg; codecs="theora, vorbis"');
+ if(!ogg_test)
+ {
+ h264_test = vid_test.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
+ if(!h264_test)
+ {
+ document.getElementById("checkVideoResult").innerHTML = "Sorry. No video support."
+ } else {
+ if(h264_test == "probably")
+ {
+ document.getElementById("checkVideoResult").innerHTML = "Yes! Full support!";
+ } else {
+ document.getElementById("checkVideoResult").innerHTML = "Well. Some support.";
+ }
+ }
+ } else {
+ if(ogg_test == "probably")
+ {
+ document.getElementById("checkVideoResult").innerHTML = "Yes! Full support!";
+ } else {
+ document.getElementById("checkVideoResult").innerHTML = "Well. Some support.";
+ }
+ }
+ } else {
+ document.getElementById("checkVideoResult").innerHTML = "Sorry. No video support."
+ }
+}
+
/**
* 弹窗加载
* @author Devil
@@ -1369,6 +1446,31 @@ $(function()
ImageFileUploadShow('.images-file-event');
}
+ // 视频上传
+ $(document).on('change', '.video-file-event', function()
+ {
+ // 显示选择的图片名称
+ var fileNames = '';
+ $.each(this.files, function()
+ {
+ fileNames += '' + this.name + ' ';
+ });
+ $($(this).data('tips-tag')).html(fileNames);
+
+ // 触发配合显示input地址事件
+ var input_tag = $(this).data('choice-one-to') || null;
+ if(input_tag != null)
+ {
+ $(input_tag).trigger('blur');
+ }
+ });
+
+ // 视频预览
+ if($('.video-file-event').length > 0)
+ {
+ VideoFileUploadShow('.video-file-event');
+ }
+
// 图片组合input清除按钮
$(document).on('click', '.original-images-url-delete', function()
{