|
@@ -189,7 +189,15 @@ class Input
|
|
|
{
|
|
|
$html = '';
|
|
|
if (isset($param['upload']) && $param['upload'] == 'qiniu') {
|
|
|
- $html = '';
|
|
|
+ $upload = Dever::load('upload/qiniu.token');
|
|
|
+ $domain = $upload['domain'];
|
|
|
+ $token = $upload['uptoken'];
|
|
|
+ $host = $upload['host'];
|
|
|
+ $html = ' m="qiniu" domain="'.$domain.'" host="'.$host.'" token="'.$token.'" ';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isset($param['large']) && $param['large']) {
|
|
|
+ $html .= ' l=1 ';
|
|
|
}
|
|
|
|
|
|
return $html;
|
|
@@ -213,10 +221,32 @@ class Input
|
|
|
if (layadmin()) {
|
|
|
$class .= 'padding-left:0px;';
|
|
|
}
|
|
|
- return '<input type="button" style="'.$class.'" class="form-control image_upload" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>
|
|
|
+ $type = 'button';
|
|
|
+ $qiniu = self::qiniu($param);
|
|
|
+ if (strstr($qiniu, 'l=1')) {
|
|
|
+ $type = 'file';
|
|
|
+
|
|
|
+ $button = '<div class="layui-input" style=" position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ border-radius: 2px;
|
|
|
+ color: black;
|
|
|
+ text-decoration: none;
|
|
|
+ text-indent: 0;
|
|
|
+ line-height: 37px;
|
|
|
+ height: 37px;
|
|
|
+ width: 97px;
|
|
|
+ padding-left: 19px;"><input type="'.$type.'" style="'.$class.';position: absolute;
|
|
|
+ font-size: 21px;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ opacity: 0;" class="form-control image_upload" '.$qiniu.' v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>本地上传</div>';
|
|
|
|
|
|
- <input type="button" style="'.$class.'" class="form-control upload_show" v="' . $param['name'] . '_' . $param['index'] . '" id="file_show_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="图库"/>
|
|
|
+ } else {
|
|
|
+ $button = '<input type="'.$type.'" style="'.$class.'" class="form-control image_upload" '.$qiniu.' v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>';
|
|
|
+ }
|
|
|
+ return $button .'
|
|
|
|
|
|
+ <input type="button" style="'.$class.'" class="form-control upload_show" v="' . $param['name'] . '_' . $param['index'] . '" id="file_show_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="图库"/>
|
|
|
<div style="margin-top:10px;display:none;" class="layui-progress layui-progress-big" id="file_' . $param['name'] . '_' . $param['index'] . '_progress" lay-filter="file_' . $param['name'] . '_' . $param['index'] . '_progress" lay-showPercent="true">
|
|
|
<div class="layui-progress-bar" lay-percent="0%"></div>
|
|
|
</div>
|