You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/frontend/views/image/image-upload.php

50 lines
1.8 KiB

5 years ago
<link rel="stylesheet" type="text/css" href="/js/webuploader/webuploader.css" />
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<div>
<select id="image-category-id" onchange="changeCategory()">
<?php if(!empty($image_category)): ?>
<?php foreach ($image_category as $category): ?>
<option value="<?= $category->id ?>"><?= $category->name ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
<div id="wrapper">
<div id="container">
<!--头部,相册选择和格式选择-->
<div id="uploader">
<div class="queueList">
<div id="dndArea" class="placeholder">
<div id="filePicker"></div>
</div>
</div>
<div class="statusBar" style="display:none;">
<div class="progress">
<span class="text">0%</span>
<span class="percentage"></span>
</div><div class="info"></div>
<div class="btns">
<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="/js/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/js/upload.js"></script>
<script>
changeCategory();
function changeCategory(){
var obj = new Object();
obj.uid = 222;
obj._csrf = '<?= Yii::$app->getRequest()->getCsrfToken() ?>';
obj.category = '<?= $type ?>';
obj.fix_id = '<?= $id ?>';
obj.image_category_id = $('#image-category-id').val();
uploader.options.formData = obj;
}
</script>