Commit 05f3a363 authored by yaobaizheng's avatar yaobaizheng

上传VR

parent a5f11ba0
......@@ -70,12 +70,15 @@
<!-- <input name="associationName" class="form-control" type="text">-->
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">转跳链接:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="linkUrl" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">视频VR封面:</label>
<div class="col-sm-8">
<input type="hidden" name="videoCover" >
<div class="file-loading">
<input class="form-control img-upload" id="videoCover" name="file" type="file">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
......@@ -121,21 +124,22 @@
$.modal.close(index);
}
//
// $(".img-upload").fileinput({
// uploadUrl: ctx + 'sysFile/uploadImgHuawei',
// initialPreviewAsData: true,
// initialPreview: [val],
// maxFileCount: 1,
// autoReplace: true
// }).on('filebatchuploadsuccess', function (event, data, previewId, index) {
// // var rsp = data.response;
// $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
// }).on('fileremoved', function (event, id, index) {
// $("input[name='" + event.currentTarget.id + "']").val('')
// })
$(".img-upload").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
// 'uploadUrl': ctx + 'common/upload',
'uploadUrl': ctx + 'sysFile/uploadImgHuawei',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
</script>
</body>
</html>
\ No newline at end of file
......@@ -71,6 +71,18 @@
<!-- <input name="associationName" th:field="*{associationName}" class="form-control" type="text">-->
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">视频VR封面:</label>
<!-- <div class="col-sm-8">-->
<!-- <input name="videoCover" th:field="*{videoCover}" class="form-control" type="text">-->
<!-- </div>-->
<div class="col-sm-8">
<input type="hidden" name="videoCover" th:field="*{videoCover}">
<div class="file-loading">
<input class="form-control img-upload" id="videoCover" name="file" type="file">
</div>
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">转跳链接:</label>-->
<!-- <div class="col-sm-8">-->
......@@ -120,22 +132,23 @@
$.modal.close(index);
}
// $(".img-upload").each(function (i) {
// var val = $("input[name='" + this.id + "']").val()
// $(this).fileinput({
// // 'uploadUrl': ctx + 'common/upload',
// 'uploadUrl': ctx + 'sysFile/uploadImgHuawei',
// initialPreviewAsData: true,
// initialPreview: [val],
// maxFileCount: 1,
// autoReplace: true
// }).on('fileuploaded', function (event, data, previewId, index) {
// $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
// }).on('fileremoved', function (event, id, index) {
// $("input[name='" + event.currentTarget.id + "']").val('')
// })
// $(this).fileinput('_initFileActions');
// });
$(".img-upload").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
// 'uploadUrl': ctx + 'common/upload',
'uploadUrl': ctx + 'sysFile/uploadImgHuawei',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment