mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]整理模板代码
This commit is contained in:
parent
6b928b146d
commit
898f2f02b3
@ -39,14 +39,19 @@
|
||||
callback: {
|
||||
beforeClick: function (treeId, treeNode) {
|
||||
if (treeNode.children.length < 1) {
|
||||
window.roleForm.ztree.checkNode(treeNode, !treeNode.checked, null, true);} else {
|
||||
window.roleForm.ztree.expandNode(treeNode);}
|
||||
return false;}}};
|
||||
this.listen();}
|
||||
window.roleForm.ztree.checkNode(treeNode, !treeNode.checked, null, true);
|
||||
} else {
|
||||
window.roleForm.ztree.expandNode(treeNode);
|
||||
}
|
||||
return false;
|
||||
}}};
|
||||
this.listen();
|
||||
}
|
||||
showTree.prototype = {
|
||||
constructor: showTree,
|
||||
listen: function () {
|
||||
this.getData(this);},
|
||||
this.getData(this);
|
||||
},
|
||||
getData: function (self) {
|
||||
$.msg.loading();
|
||||
jQuery.get('{:url()}?id={$vo.id}', {action: 'getNode'}, function (ret) {
|
||||
@ -60,28 +65,41 @@
|
||||
children.name = data[i].title || data[i].node;
|
||||
children.checked = data[i].checked || false;
|
||||
children.children = renderChildren(data[i]._sub_, level + 1);
|
||||
childrenData.push(children);}
|
||||
return childrenData;}
|
||||
childrenData.push(children);
|
||||
}
|
||||
return childrenData;
|
||||
}
|
||||
self.data = renderChildren(ret.data, 1);
|
||||
self.showTree();}, 'JSON');},
|
||||
self.showTree();
|
||||
}, 'JSON');
|
||||
},
|
||||
showTree: function () {
|
||||
this.ztree = jQuery.fn.zTree.init(jQuery("#zTree"), this.setting, this.data);
|
||||
while (true) {
|
||||
var reNodes = this.ztree.getNodesByFilter(function (node) {
|
||||
return (!node.node && node.children.length < 1);});
|
||||
return (!node.node && node.children.length < 1);
|
||||
});
|
||||
if (reNodes.length < 1) {
|
||||
break;}
|
||||
break;
|
||||
}
|
||||
for (var i in reNodes) {
|
||||
this.ztree.removeNode(reNodes[i]);}}},
|
||||
this.ztree.removeNode(reNodes[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
submit: function () {
|
||||
var nodes = [];
|
||||
var data = this.ztree.getCheckedNodes(true);
|
||||
for (var i in data) {
|
||||
(data[i].node) && nodes.push(data[i].node);}
|
||||
$.form.load('{:url()}?id={$vo.id}&action=save', {nodes: nodes}, 'POST');}};
|
||||
(data[i].node) && nodes.push(data[i].node);
|
||||
}
|
||||
$.form.load('{:url()}?id={$vo.id}&action=save', {nodes: nodes}, 'POST');
|
||||
}};
|
||||
window.roleForm = new showTree();
|
||||
$('[data-submit-role]').on('click', function () {
|
||||
window.roleForm.submit();});});
|
||||
window.roleForm.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{/block}
|
@ -44,14 +44,17 @@
|
||||
{/if}
|
||||
</td>
|
||||
<td class='text-center nowrap'>
|
||||
|
||||
{if auth("$classuri/edit")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
|
||||
{/if}
|
||||
|
||||
{if auth("$classuri/apply")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-open='{:url("$classuri/apply")}?id={$vo.id}' href="javascript:void(0)">授权</a>
|
||||
{/if}
|
||||
|
||||
{if $vo.status eq 1 and auth("$classuri/forbid")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='status' data-value='0'data-action='{:url("$classuri/forbid")}' href="javascript:void(0)">禁用</a>
|
||||
@ -59,10 +62,12 @@
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}' href="javascript:void(0)">启用</a>
|
||||
{/if}
|
||||
|
||||
{if auth("$classuri/del")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}' href="javascript:void(0)">删除</a>
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
@ -30,26 +30,31 @@
|
||||
<label class="col-sm-2 control-label">Region <span class="nowrap">(存储区域)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<select class="layui-input" name="storage_qiniu_region" required="required">
|
||||
|
||||
{if sysconf('storage_qiniu_region') eq '华东'}
|
||||
<option selected value='华东'>华东</option>
|
||||
{else}
|
||||
<option value='华东'>华东</option>
|
||||
{/if}
|
||||
|
||||
{if sysconf('storage_qiniu_region') eq '华北'}
|
||||
<option selected value='华北'>华北</option>
|
||||
{else}
|
||||
<option value='华北'>华北</option>
|
||||
{/if}
|
||||
|
||||
{if sysconf('storage_qiniu_region') eq '华南'}
|
||||
<option selected value='华南'>华南</option>
|
||||
{else}
|
||||
<option value='华南'>华南</option>
|
||||
{/if}
|
||||
|
||||
{if sysconf('storage_qiniu_region') eq '北美'}
|
||||
<option selected value='北美'>北美</option>
|
||||
{else}
|
||||
<option value='北美'>北美</option>
|
||||
{/if}
|
||||
|
||||
</select>
|
||||
<p class="help-block">七牛云存储空间所在区域,需要严格对应储存所在区域才能上传文件</p>
|
||||
</div>
|
||||
@ -127,6 +132,8 @@
|
||||
<script>
|
||||
$(function () {
|
||||
$('[name="storage_type"]').on('change', function () {
|
||||
$("[data-storage-type]").not($("[data-storage-type='" + $(this).val() + "']").show()).hide();}).trigger('change');});
|
||||
$("[data-storage-type]").not($("[data-storage-type='" + $(this).val() + "']").show()).hide();
|
||||
}).trigger('change');
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -1,14 +1,12 @@
|
||||
{extend name="extra@admin/content"}
|
||||
|
||||
{block name="content"}
|
||||
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post"
|
||||
class='form-horizontal' style='padding-top:20px'>
|
||||
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post" class='form-horizontal' style='padding-top:20px'>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">SiteName <span class="nowrap">(网站名称)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="site_name" required="required" title="请输入网站名称" placeholder="请输入网站名称"
|
||||
value="{:sysconf('site_name')}" class="layui-input">
|
||||
<input type="text" name="site_name" required="required" title="请输入网站名称" placeholder="请输入网站名称" value="{:sysconf('site_name')}" class="layui-input">
|
||||
<p class="help-block">网站名称,显示在浏览器标签上</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -16,8 +14,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Copyright <span class="nowrap">(版权信息)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="site_copy" required="required" title="请输入版权信息" placeholder="请输入版权信息"
|
||||
value="{:sysconf('site_copy')}" class="layui-input">
|
||||
<input type="text" name="site_copy" required="required" title="请输入版权信息" placeholder="请输入版权信息" value="{:sysconf('site_copy')}" class="layui-input">
|
||||
<p class="help-block">程序的版权信息设置,在后台登录页面显示</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -25,8 +22,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">AppName <span class="nowrap">(程序名称)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="app_name" required="required" title="请输入程序名称" placeholder="请输入程序名称"
|
||||
value="{:sysconf('app_name')}" class="layui-input">
|
||||
<input type="text" name="app_name" required="required" title="请输入程序名称" placeholder="请输入程序名称" value="{:sysconf('app_name')}" class="layui-input">
|
||||
<p class="help-block">当前程序名称,在后台主标题上显示</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,8 +31,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">AppVersion <span class="nowrap">(程序版本)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="app_version" required="required" title="请输入程序版本" placeholder="请输入程序版本"
|
||||
value="{:sysconf('app_version')}" class="layui-input">
|
||||
<input type="text" name="app_version" required="required" title="请输入程序版本" placeholder="请输入程序版本" value="{:sysconf('app_version')}" class="layui-input">
|
||||
<p class="help-block">当前程序版本号,在后台主标题上标显示</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -68,8 +63,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
|
@ -3,8 +3,8 @@
|
||||
{block name="button"}
|
||||
<div class="nowrap pull-right" style="margin-top:10px">
|
||||
{if auth("$classuri/del")}
|
||||
<button data-update data-field='delete' data-action='{:url("$classuri/del")}'
|
||||
class='layui-btn layui-btn-small layui-btn-danger'><i class='fa fa-remove'></i> 删除日志
|
||||
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-small layui-btn-danger'>
|
||||
<i class='fa fa-remove'></i> 删除日志
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
@ -39,8 +39,7 @@
|
||||
|
||||
<div class="col-xs-3">
|
||||
<div class="form-group">
|
||||
<input type="text" name="content" value="{$Think.get.content|default=''}" placeholder="操作内容"
|
||||
class="input-sm form-control">
|
||||
<input type="text" name="content" value="{$Think.get.content|default=''}" placeholder="操作内容" class="input-sm form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -87,12 +87,16 @@
|
||||
{block name="script"}
|
||||
<script>
|
||||
if (window.location.href.indexOf('#') > -1) {
|
||||
window.location.href = window.location.href.split('#')[0];}
|
||||
window.location.href = window.location.href.split('#')[0];
|
||||
}
|
||||
require(['jquery'], function ($) {
|
||||
$('[name="password"]').on('focus', function () {
|
||||
$('#left-hander').removeClass('initial_left_hand').addClass('left_hand');
|
||||
$('#right-hander').removeClass('initial_right_hand').addClass('right_hand')}).on('blur', function () {
|
||||
$('#right-hander').removeClass('initial_right_hand').addClass('right_hand')
|
||||
}).on('blur', function () {
|
||||
$('#left-hander').addClass('initial_left_hand').removeClass('left_hand');
|
||||
$('#right-hander').addClass('initial_right_hand').removeClass('right_hand')});});
|
||||
$('#right-hander').addClass('initial_right_hand').removeClass('right_hand')
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -1,4 +1,5 @@
|
||||
<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="__SELF__" data-auto="true" method="post">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上级菜单</label>
|
||||
<div class="layui-input-block">
|
||||
@ -13,18 +14,21 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">菜单名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" value='{$vo.title|default=""}' required="required" title="请输入菜单名称" placeholder="请输入菜单名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">菜单链接</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" onblur="(this.value === '') && (this.value = '#')" name="url" autocomplete="off" required="required" title="请输入菜单链接" placeholder="请输入菜单链接" value="{$vo.url|default='#'}" class="layui-input typeahead">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">菜单图标</label>
|
||||
<div class="layui-input-inline" style='width:300px'>
|
||||
@ -35,15 +39,20 @@
|
||||
</span>
|
||||
<button data-icon='icon' type='button' class='layui-btn layui-btn-primary'>选择图标</button>
|
||||
</div>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<div class="layui-form-item text-center">
|
||||
{if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
|
||||
<button class="layui-btn" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
require(['bootstrap.typeahead'], function () {
|
||||
var subjects = JSON.parse('{$nodes|json_encode}');
|
||||
$('.typeahead').typeahead({source: subjects, items: 5});});
|
||||
$('.typeahead').typeahead({source: subjects, items: 5});
|
||||
});
|
||||
</script>
|
||||
|
||||
</form>
|
||||
|
@ -55,10 +55,15 @@
|
||||
$(function () {
|
||||
$('input.title-input').on('blur', function () {
|
||||
$.form.load('{:url("save")}', {name: this.name, value: this.value}, 'POST', function (ret) {
|
||||
return false;});});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
$('input.check-box').on('click', function () {
|
||||
$.form.load('{:url("save")}', {name: this.name, value: this.checked ? 1 : 0}, 'POST', function (ret) {
|
||||
return false;});});});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
{/block}
|
@ -1908,16 +1908,23 @@
|
||||
/* global top */
|
||||
if (document.all) {
|
||||
document.onselectstart = function () {
|
||||
return false;};} else {
|
||||
return false;
|
||||
};
|
||||
} else {
|
||||
document.onmouseup = document.onmousedown = function () {
|
||||
return false;};}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
document.onselectstart = new Function('event.returnValue=false;');
|
||||
$('li').on('click', function () {
|
||||
var className = $(this).find('span.glyphicon,span.fa').get(0).className;
|
||||
if (className) {
|
||||
top.$('[name="{$field}"]').val(className).trigger('change');
|
||||
var index = top.layer.getFrameIndex(window.name);
|
||||
top.layer.close(index);}});});
|
||||
top.layer.close(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -45,11 +45,13 @@
|
||||
$('#' + file.id).attr('data-md5', file.md5).attr('data-src', url);
|
||||
/* {if $mode === 'one'} */
|
||||
top.$('[name="{$field}"]').map(function () {
|
||||
top.$(this).attr('data-srcs', ret.url).attr('data-md5', file.md5).val(url).trigger('change');});
|
||||
top.$(this).attr('data-srcs', ret.url).attr('data-md5', file.md5).val(url).trigger('change');
|
||||
});
|
||||
//top.$.msg.tips('文件上传成功!');
|
||||
var index = top.layer.getFrameIndex(window.name);
|
||||
top.layer.close(index);
|
||||
/* {/if} {$mode}*/}
|
||||
/* {/if} {$mode}*/
|
||||
}
|
||||
|
||||
function confirmSelected() {
|
||||
var srcs = new Array();
|
||||
@ -57,19 +59,26 @@
|
||||
$('[data-md5] .success').map(function () {
|
||||
var $li = $(this).parents('[data-md5]');
|
||||
md5s.push($li.attr('data-md5'));
|
||||
srcs.push($li.attr('data-src'));});
|
||||
srcs.push($li.attr('data-src'));
|
||||
});
|
||||
if (srcs.length < 1) {
|
||||
return top.$.msg.tips('还没有选择文件,请勾选需要使用的文件!');}
|
||||
return top.$.msg.tips('还没有选择文件,请勾选需要使用的文件!');
|
||||
}
|
||||
top.$('[name="{$field}"]').map(function () {
|
||||
top.$(this).attr('data-srcs', srcs.join('|')).attr('data-md5', md5s.join('|')).val(srcs.join('|')).trigger('change');});
|
||||
top.$(this).attr('data-srcs', srcs.join('|')).attr('data-md5', md5s.join('|')).val(srcs.join('|')).trigger('change');
|
||||
});
|
||||
var index = top.layer.getFrameIndex(window.name);
|
||||
top.layer.close(index);}
|
||||
top.layer.close(index);
|
||||
}
|
||||
|
||||
function completed() {
|
||||
var btnHTML = '完成上传';
|
||||
$('.uploadBtn').on('click', function () {
|
||||
if (this.innerHTML === btnHTML) {
|
||||
confirmSelected.call(this);}}).html(btnHTML);}
|
||||
confirmSelected.call(this);
|
||||
}
|
||||
}).html(btnHTML);
|
||||
}
|
||||
|
||||
// 当domReady的时候开始初始化
|
||||
$(function () {
|
||||
@ -104,24 +113,33 @@
|
||||
var support = true;
|
||||
data.onload = data.onerror = function () {
|
||||
if (this.width != 1 || this.height != 1) {
|
||||
support = false;}};
|
||||
support = false;
|
||||
}
|
||||
};
|
||||
data.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
|
||||
return support;}.call(this)),
|
||||
return support;
|
||||
}.call(this)),
|
||||
/*检测是否已经安装flash,检测flash的版本*/
|
||||
flashVersion = (function () {
|
||||
var version;
|
||||
try {
|
||||
version = navigator.plugins[ 'Shockwave Flash' ];
|
||||
version = version.description;} catch (ex) {
|
||||
version = version.description;
|
||||
} catch (ex) {
|
||||
try {
|
||||
version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');} catch (ex2) {
|
||||
version = '0.0';}}
|
||||
version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
|
||||
} catch (ex2) {
|
||||
version = '0.0';
|
||||
}
|
||||
}
|
||||
version = version.match(/\d+/g);
|
||||
return parseFloat(version[ 0 ] + '.' + version[ 1 ], 10);})(),
|
||||
return parseFloat(version[ 0 ] + '.' + version[ 1 ], 10);
|
||||
})(),
|
||||
supportTransition = (function () {
|
||||
var s = document.createElement('p').style, r = 'transition' in s || 'WebkitTransition' in s || 'MozTransition' in s || 'msTransition' in s || 'OTransition' in s;
|
||||
s = null;
|
||||
return r;})(),
|
||||
return r;
|
||||
})(),
|
||||
uploader;
|
||||
if (!WebUploader.Uploader.support('flash') && WebUploader.browser.ie) {
|
||||
/*flash 安装了但是版本过低*/
|
||||
@ -137,27 +155,36 @@
|
||||
break;
|
||||
default:
|
||||
alert('安装已成功,请刷新!');
|
||||
break;}
|
||||
delete window['expressinstallcallback'];};
|
||||
break;
|
||||
}
|
||||
delete window['expressinstallcallback'];
|
||||
};
|
||||
var swf = '__PUBLIC__/static/plugs/uploader/expressInstall.swf';
|
||||
var html = '<object type="application/' + 'x-shockwave-flash" data="' + swf + '" ';
|
||||
if (WebUploader.browser.ie) {
|
||||
html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';}
|
||||
html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
|
||||
}
|
||||
html += 'width="100%" height="100%" style="outline:0">' +
|
||||
'<param name="movie" value="' + swf + '" />' +
|
||||
'<param name="wmode" value="transparent" />' +
|
||||
'<param name="allowscriptaccess" value="always" />' +
|
||||
'</object>';
|
||||
container.html(html);})($wrap);} else {
|
||||
$wrap.html('<a href="http://www.adobe.com/go/getflashplayer" target="_blank" border="0"><img alt="get flash player" src="http://www.adobe.com/macromedia/style_guide/images/160x41_Get_Flash_Player.jpg" /></a>');}
|
||||
return;} else if (!WebUploader.Uploader.support()) {
|
||||
container.html(html);
|
||||
})($wrap);
|
||||
} else {
|
||||
$wrap.html('<a href="http://www.adobe.com/go/getflashplayer" target="_blank" border="0"><img alt="get flash player" src="http://www.adobe.com/macromedia/style_guide/images/160x41_Get_Flash_Player.jpg" /></a>');
|
||||
}
|
||||
return;
|
||||
} else if (!WebUploader.Uploader.support()) {
|
||||
alert('Web Uploader 不支持您的浏览器!');
|
||||
return;}
|
||||
return;
|
||||
}
|
||||
|
||||
WebUploader.Uploader.register({'before-send-file': 'preupload'}, {preupload: function (file) {
|
||||
var me = this, owner = this.owner, deferred = WebUploader.Deferred();
|
||||
owner.md5File(file.source).fail(function () {
|
||||
deferred.reject();}).then(function (md5) {
|
||||
deferred.reject();
|
||||
}).then(function (md5) {
|
||||
file.md5 = md5;
|
||||
var data = {id: file.id, md5: md5, uptype: '{$uptype}', filename: file.name};
|
||||
$.ajax("{:url('admin/plugs/upstate')}", {dataType: 'json', method: 'post', data: data, success: function (ret) {
|
||||
@ -166,29 +193,38 @@
|
||||
uploaded.call(uploader, ret.data, file);
|
||||
percentages[file.id] = [file.size, 1];
|
||||
updateTotalProgress();
|
||||
console.log('文件秒传成功 --> ' + file.name);} else {
|
||||
console.log('文件秒传成功 --> ' + file.name);
|
||||
} else {
|
||||
file.md5 = md5;
|
||||
file.token = ret.data.token;
|
||||
file.key = ret.data.file_url;
|
||||
me.options.server = ret.data.server;}
|
||||
deferred.resolve();}});});
|
||||
return deferred.promise();}});
|
||||
me.options.server = ret.data.server;
|
||||
}
|
||||
deferred.resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
return deferred.promise();
|
||||
}
|
||||
});
|
||||
|
||||
// 实例化
|
||||
uploader = WebUploader.create({
|
||||
pick: {
|
||||
id: '#filePicker',
|
||||
label: '点击选择文件',
|
||||
multiple: false},
|
||||
multiple: false
|
||||
},
|
||||
accept: {
|
||||
title: '选择文件',
|
||||
extensions: '{$types}', //'gif,jpg,jpeg,bmp,png',
|
||||
mimeTypes: '{$mimes}'},
|
||||
mimeTypes: '{$mimes}'
|
||||
},
|
||||
formData: {},
|
||||
/*{if $mode === 'one'}*/
|
||||
fileNumLimit: 1,
|
||||
auto: true,
|
||||
/* {else} */
|
||||
/* {else /} */
|
||||
auto: false,
|
||||
fileNumLimit: 300,
|
||||
/* {/if} */
|
||||
@ -201,7 +237,8 @@
|
||||
server: '{:url("admin/plugs/upload")}',
|
||||
disableGlobalDnd: true,
|
||||
fileSizeLimit: 200 * 1024 * 1024, // 200 M
|
||||
fileSingleSizeLimit: 200 * 1024 * 1024 // 200 M});
|
||||
fileSingleSizeLimit: 200 * 1024 * 1024 // 200 M
|
||||
});
|
||||
|
||||
/**
|
||||
* 处理上传后的结果
|
||||
@ -211,8 +248,10 @@
|
||||
uploader.on('uploadAccept', function (fieldata, ret) {
|
||||
if (ret.code === 'SUCCESS') {
|
||||
uploaded.call(uploader, ret.data, fieldata.file);
|
||||
return true;}
|
||||
return false;});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// 拖拽时不接受 js, txt 文件。
|
||||
uploader.on('dndAccept', function (items) {
|
||||
@ -221,8 +260,11 @@
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (~unAllowed.indexOf(items[ i ].type)) {
|
||||
denied = true;
|
||||
break;}}
|
||||
return !denied;});
|
||||
break;
|
||||
}
|
||||
}
|
||||
return !denied;
|
||||
});
|
||||
|
||||
/* 上传开始前的处理 */
|
||||
uploader.on('uploadBeforeSend', function (file, data, header) {
|
||||
@ -230,15 +272,18 @@
|
||||
data['allowed_types'] = this.options.accept[0].extensions.split(',').join('|');
|
||||
data['md5'] = file.file.md5;
|
||||
data['key'] = file.file.key;
|
||||
data['token'] = file.file.token;});
|
||||
data['token'] = file.file.token;
|
||||
});
|
||||
|
||||
// 添加“添加文件”的按钮,
|
||||
uploader.addButton({
|
||||
id: '#filePicker2',
|
||||
label: '继续添加'});
|
||||
label: '继续添加'
|
||||
});
|
||||
|
||||
uploader.on('ready', function () {
|
||||
window.uploader = uploader;});
|
||||
window.uploader = uploader;
|
||||
});
|
||||
|
||||
// 当有文件添加进来时执行,负责view的创建
|
||||
function addFile(file) {
|
||||
@ -264,51 +309,72 @@
|
||||
break;
|
||||
default:
|
||||
text = '上传失败,请重试';
|
||||
break;}
|
||||
$info.text(text).appendTo($li);};
|
||||
break;
|
||||
}
|
||||
$info.text(text).appendTo($li);
|
||||
};
|
||||
if (file.getStatus() === 'invalid') {
|
||||
showError(file.statusText);} else {
|
||||
showError(file.statusText);
|
||||
} else {
|
||||
// @todo lazyload
|
||||
$wrap.text('预览中');
|
||||
uploader.makeThumb(file, function (error, src) {
|
||||
var img;
|
||||
if (error) {
|
||||
$wrap.text('不能预览');
|
||||
return;}
|
||||
return;
|
||||
}
|
||||
if (isSupportBase64) {
|
||||
img = $('<img src="' + src + '">');
|
||||
$wrap.empty().append(img);} else {
|
||||
$wrap.empty().append(img);
|
||||
} else {
|
||||
$.ajax('{"plugs/file/preview"|url}', {method: 'POST', data: src, dataType: 'json'}).done(function (response) {
|
||||
if (response.result) {
|
||||
img = $('<img src="' + response.result + '">');
|
||||
$wrap.empty().append(img);} else {
|
||||
$wrap.text("预览出错");}});}}, thumbnailWidth, thumbnailHeight);
|
||||
$wrap.empty().append(img);
|
||||
} else {
|
||||
$wrap.text("预览出错");
|
||||
}
|
||||
});
|
||||
}
|
||||
}, thumbnailWidth, thumbnailHeight);
|
||||
percentages[ file.id ] = [file.size, 0];
|
||||
file.rotation = 0;
|
||||
$upload.html('开始上传');}
|
||||
$upload.html('开始上传');
|
||||
}
|
||||
|
||||
file.on('statuschange', function (cur, prev) {
|
||||
if (prev === 'progress') {
|
||||
$prgress.hide().width(0);} else if (prev === 'queued') {
|
||||
$prgress.hide().width(0);
|
||||
} else if (prev === 'queued') {
|
||||
$li.off('mouseenter mouseleave');
|
||||
$btns.remove();}
|
||||
$btns.remove();
|
||||
}
|
||||
// 成功
|
||||
if (cur === 'error' || cur === 'invalid') {
|
||||
showError(file.statusText);
|
||||
percentages[ file.id ][ 1 ] = 1;} else if (cur === 'interrupt') {
|
||||
showError('interrupt');} else if (cur === 'queued') {
|
||||
percentages[ file.id ][ 1 ] = 0;} else if (cur === 'progress') {
|
||||
percentages[ file.id ][ 1 ] = 1;
|
||||
} else if (cur === 'interrupt') {
|
||||
showError('interrupt');
|
||||
} else if (cur === 'queued') {
|
||||
percentages[ file.id ][ 1 ] = 0;
|
||||
} else if (cur === 'progress') {
|
||||
$info.remove();
|
||||
$prgress.css('display', 'block');} else if (cur === 'complete') {
|
||||
$li.append('<span class="success"></span>');}
|
||||
$prgress.css('display', 'block');
|
||||
} else if (cur === 'complete') {
|
||||
$li.append('<span class="success"></span>');
|
||||
}
|
||||
|
||||
$li.removeClass('state-' + prev).addClass('state-' + cur);});
|
||||
$li.removeClass('state-' + prev).addClass('state-' + cur);
|
||||
});
|
||||
|
||||
$li.on('mouseenter', function () {
|
||||
$btns.stop().animate({height: 30});});
|
||||
$btns.stop().animate({height: 30});
|
||||
});
|
||||
|
||||
$li.on('mouseleave', function () {
|
||||
$btns.stop().animate({height: 0});});
|
||||
$btns.stop().animate({height: 0});
|
||||
});
|
||||
|
||||
$btns.on('click', 'span', function () {
|
||||
var index = $(this).index(), deg;
|
||||
@ -321,47 +387,62 @@
|
||||
break;
|
||||
case 2:
|
||||
file.rotation -= 90;
|
||||
break;}
|
||||
break;
|
||||
}
|
||||
if (supportTransition) {
|
||||
deg = 'rotate(' + file.rotation + 'deg)';
|
||||
$wrap.css({'-webkit-transform': deg, '-mos-transform': deg, '-o-transform': deg, 'transform': deg});} else {
|
||||
$wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')');}});
|
||||
$li.appendTo($queue);}
|
||||
$wrap.css({'-webkit-transform': deg, '-mos-transform': deg, '-o-transform': deg, 'transform': deg});
|
||||
} else {
|
||||
$wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')');
|
||||
}
|
||||
});
|
||||
$li.appendTo($queue);
|
||||
}
|
||||
|
||||
// 负责view的销毁
|
||||
function removeFile(file) {
|
||||
var $li = $('#' + file.id);
|
||||
delete percentages[ file.id ];
|
||||
updateTotalProgress();
|
||||
$li.off().find('.file-panel').off().end().remove();}
|
||||
$li.off().find('.file-panel').off().end().remove();
|
||||
}
|
||||
|
||||
function updateTotalProgress() {
|
||||
var loaded = 0, total = 0, spans = $progress.children(), percent;
|
||||
$.each(percentages, function (k, v) {
|
||||
total += v[ 0 ];
|
||||
loaded += v[ 0 ] * v[ 1 ];});
|
||||
loaded += v[ 0 ] * v[ 1 ];
|
||||
});
|
||||
percent = total ? loaded / total : 0;
|
||||
spans.eq(0).text(Math.round(percent * 100) + '%');
|
||||
spans.eq(1).css('width', Math.round(percent * 100) + '%');
|
||||
updateStatus();}
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
function updateStatus() {
|
||||
var text = '', stats;
|
||||
if (state === 'ready') {
|
||||
text = '选中' + fileCount + '个文件,共' + WebUploader.formatSize(fileSize) + '。';} else if (state === 'confirm') {
|
||||
text = '选中' + fileCount + '个文件,共' + WebUploader.formatSize(fileSize) + '。';
|
||||
} else if (state === 'confirm') {
|
||||
stats = uploader.getStats();
|
||||
if (stats.uploadFailNum) {
|
||||
text = '已成功上传' + stats.successNum + '个文件,' + stats.uploadFailNum + '个文件上传失败,<a class="retry" href="#">重新上传</a>失败文件'}} else {
|
||||
text = '已成功上传' + stats.successNum + '个文件,' + stats.uploadFailNum + '个文件上传失败,<a class="retry" href="#">重新上传</a>失败文件'
|
||||
}
|
||||
} else {
|
||||
stats = uploader.getStats();
|
||||
text = '共' + fileCount + '个(' + WebUploader.formatSize(fileSize) + '),已上传' + stats.successNum + '个';
|
||||
if (stats.uploadFailNum) {
|
||||
text += ',失败' + stats.uploadFailNum + '个';}}
|
||||
$info.html(text);}
|
||||
text += ',失败' + stats.uploadFailNum + '个';
|
||||
}
|
||||
}
|
||||
$info.html(text);
|
||||
}
|
||||
|
||||
function setState(val) {
|
||||
var file, stats;
|
||||
if (val === state) {
|
||||
return;}
|
||||
return;
|
||||
}
|
||||
$upload.removeClass('state-' + state);
|
||||
$upload.addClass('state-' + val);
|
||||
state = val;
|
||||
@ -395,41 +476,51 @@
|
||||
stats = uploader.getStats();
|
||||
if (stats.successNum && !stats.uploadFailNum) {
|
||||
setState('finish');
|
||||
return;}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'finish':
|
||||
stats = uploader.getStats();
|
||||
if (stats.successNum) {
|
||||
completed.call(this);} else {
|
||||
completed.call(this);
|
||||
} else {
|
||||
// 没有成功的文件,重设
|
||||
state = 'done';
|
||||
location.reload();}
|
||||
break;}
|
||||
updateStatus();}
|
||||
location.reload();
|
||||
}
|
||||
break;
|
||||
}
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
uploader.onUploadProgress = function (file, percentage) {
|
||||
var $li = $('#' + file.id), $percent = $li.find('.progress span');
|
||||
$percent.css('width', percentage * 100 + '%');
|
||||
percentages[ file.id ][ 1 ] = percentage;
|
||||
updateTotalProgress();};
|
||||
updateTotalProgress();
|
||||
};
|
||||
|
||||
uploader.onFileQueued = function (file) {
|
||||
fileCount++;
|
||||
fileSize += file.size;
|
||||
if (fileCount === 1) {
|
||||
$placeHolder.addClass('element-invisible');
|
||||
$statusBar.show();}
|
||||
$statusBar.show();
|
||||
}
|
||||
addFile(file);
|
||||
setState('ready');
|
||||
updateTotalProgress();};
|
||||
updateTotalProgress();
|
||||
};
|
||||
|
||||
uploader.onfieldequeued = function (file) {
|
||||
fileCount--;
|
||||
fileSize -= file.size;
|
||||
if (!fileCount) {
|
||||
setState('pedding');}
|
||||
setState('pedding');
|
||||
}
|
||||
removeFile(file);
|
||||
updateTotalProgress();};
|
||||
updateTotalProgress();
|
||||
};
|
||||
|
||||
uploader.on('all', function (type) {
|
||||
switch (type) {
|
||||
@ -441,24 +532,34 @@
|
||||
break;
|
||||
case 'stopUpload':
|
||||
setState('paused');
|
||||
break;}});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
uploader.onError = function (code) {
|
||||
//alert('Eroor: ' + code);};
|
||||
//alert('Eroor: ' + code);
|
||||
};
|
||||
|
||||
$upload.on('click', function () {
|
||||
if ($(this).hasClass('disabled')) {
|
||||
return false;}
|
||||
return false;
|
||||
}
|
||||
if (state === 'ready') {
|
||||
uploader.upload();} else if (state === 'paused') {
|
||||
uploader.upload();} else if (state === 'uploading') {
|
||||
uploader.stop();}});
|
||||
uploader.upload();
|
||||
} else if (state === 'paused') {
|
||||
uploader.upload();
|
||||
} else if (state === 'uploading') {
|
||||
uploader.stop();
|
||||
}
|
||||
});
|
||||
|
||||
$info.on('click', '.retry', function () {
|
||||
uploader.retry();});
|
||||
uploader.retry();
|
||||
});
|
||||
|
||||
$upload.addClass('state-' + state);
|
||||
updateTotalProgress();});
|
||||
updateTotalProgress();
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -19,15 +19,13 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" value="{$Think.get.username|default=''}" placeholder="用户名"
|
||||
class="input-sm form-control">
|
||||
<input type="text" name="username" value="{$Think.get.username|default=''}" placeholder="用户名" class="input-sm form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
<div class="form-group">
|
||||
<input type="text" name="phone" value="{$Think.get.phone|default=''}" placeholder="手机号"
|
||||
class="input-sm form-control">
|
||||
<input type="text" name="phone" value="{$Think.get.phone|default=''}" placeholder="手机号" class="input-sm form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,67 +42,67 @@
|
||||
<input type="hidden" value="resort" name="action"/>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='list-table-check-td'>
|
||||
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
|
||||
</th>
|
||||
<th class='text-center'>用户账号</th>
|
||||
<th class='text-center'>手机号</th>
|
||||
<th class='text-center'>电子邮箱</th>
|
||||
<th class='text-center'>登录次数</th>
|
||||
<th class='text-center'>最后登录</th>
|
||||
<th class='text-center'>状态</th>
|
||||
<th class='text-center'>操作</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='list-table-check-td'>
|
||||
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
|
||||
</th>
|
||||
<th class='text-center'>用户账号</th>
|
||||
<th class='text-center'>手机号</th>
|
||||
<th class='text-center'>电子邮箱</th>
|
||||
<th class='text-center'>登录次数</th>
|
||||
<th class='text-center'>最后登录</th>
|
||||
<th class='text-center'>状态</th>
|
||||
<th class='text-center'>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $list as $key=>$vo}
|
||||
<tr>
|
||||
<td class='list-table-check-td'>
|
||||
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
|
||||
</td>
|
||||
<td class='text-center'>{$vo.username}</td>
|
||||
<td class='text-center'>{$vo.phone|default="<span style='color:#ccc'>还没有设置手机号</span>"}</td>
|
||||
<td class='text-center'>{$vo.mail|default="<span style='color:#ccc'>还没有设置邮箱</span>"}</td>
|
||||
<td class='text-center'>{$vo.login_num|default="<span style='color:#ccc'>从未登录</span>"}</td>
|
||||
<td class='text-center'>{$vo.login_at|default="<span style='color:#ccc'>从未登录</span>"}</td>
|
||||
<td class='text-center'>
|
||||
{if $vo.status eq 0}
|
||||
<span>已禁用</span>
|
||||
{elseif $vo.status eq 1}
|
||||
<span style="color:#090">使用中</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class='text-center nowrap'>
|
||||
{if auth("$classuri/edit")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
|
||||
{/if}
|
||||
{if auth("$classuri/auth")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/auth")}?id={$vo.id}' href="javascript:void(0)">授权</a>
|
||||
{/if}
|
||||
{if auth("$classuri/pass")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/pass")}?id={$vo.id}' href="javascript:void(0)">密码</a>
|
||||
{/if}
|
||||
{if $vo.status eq 1 and auth("$classuri/forbid")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}'
|
||||
href="javascript:void(0)">禁用</a>
|
||||
{elseif auth("$classuri/resume")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}'
|
||||
href="javascript:void(0)">启用</a>
|
||||
{/if}
|
||||
{if auth("$classuri/del")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'
|
||||
href="javascript:void(0)">删除</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{foreach $list as $key=>$vo}
|
||||
<tr>
|
||||
<td class='list-table-check-td'>
|
||||
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
|
||||
</td>
|
||||
<td class='text-center'>{$vo.username}</td>
|
||||
<td class='text-center'>{$vo.phone|default="<span style='color:#ccc'>还没有设置手机号</span>"}</td>
|
||||
<td class='text-center'>{$vo.mail|default="<span style='color:#ccc'>还没有设置邮箱</span>"}</td>
|
||||
<td class='text-center'>{$vo.login_num|default="<span style='color:#ccc'>从未登录</span>"}</td>
|
||||
<td class='text-center'>{$vo.login_at|default="<span style='color:#ccc'>从未登录</span>"}</td>
|
||||
<td class='text-center'>
|
||||
{if $vo.status eq 0}
|
||||
<span>已禁用</span>
|
||||
{elseif $vo.status eq 1}
|
||||
<span style="color:#090">使用中</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class='text-center nowrap'>
|
||||
{if auth("$classuri/edit")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
|
||||
{/if}
|
||||
{if auth("$classuri/auth")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/auth")}?id={$vo.id}' href="javascript:void(0)">授权</a>
|
||||
{/if}
|
||||
{if auth("$classuri/pass")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-modal='{:url("$classuri/pass")}?id={$vo.id}' href="javascript:void(0)">密码</a>
|
||||
{/if}
|
||||
{if $vo.status eq 1 and auth("$classuri/forbid")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}'
|
||||
href="javascript:void(0)">禁用</a>
|
||||
{elseif auth("$classuri/resume")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}'
|
||||
href="javascript:void(0)">启用</a>
|
||||
{/if}
|
||||
{if auth("$classuri/del")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'
|
||||
href="javascript:void(0)">删除</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{if isset($page)}<p>{$page}</p>{/if}
|
||||
|
@ -26,12 +26,12 @@
|
||||
<span class='glyphicon glyphicon-refresh'></span>
|
||||
</a>
|
||||
<script>
|
||||
require(['jquery'],function(){
|
||||
$('[data-reload]').hover(function(){
|
||||
$(this).find('.glyphicon').addClass('fa-spin');
|
||||
},function(){
|
||||
$(this).find('.glyphicon').removeClass('fa-spin');
|
||||
});
|
||||
require(['jquery'], function () {
|
||||
$('[data-reload]').hover(function () {
|
||||
$(this).find('.glyphicon').addClass('fa-spin');
|
||||
}, function () {
|
||||
$(this).find('.glyphicon').removeClass('fa-spin');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="topbar-left topbar-user">
|
||||
|
@ -1,57 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSAPI支付DEMO</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body style="text-align:center">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JSAPI支付DEMO</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body style="text-align:center">
|
||||
|
||||
<div class="contrainer">
|
||||
<h3>JSAPI支付DEMO</h3>
|
||||
<hr/>
|
||||
<p class="price">金额: 0.01元</p>
|
||||
<hr/>
|
||||
<p class="orderno"></p>
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10" id="test">
|
||||
<button type="submit" class="btn btn-success">立即支付</button>
|
||||
<div class="contrainer">
|
||||
<h3>JSAPI支付DEMO</h3>
|
||||
<hr/>
|
||||
<p class="price">金额: 0.01元</p>
|
||||
<hr/>
|
||||
<p class="orderno"></p>
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10" id="test">
|
||||
<button type="submit" class="btn btn-success">立即支付</button>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{:url('payqrc')}" class="btn btn-link">扫码支付测试</a>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{:url('payqrc')}" class="btn btn-link">扫码支付测试</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
||||
<script>
|
||||
wx.error(function (e) {
|
||||
console.log(e);
|
||||
});
|
||||
wx.config($.parseJSON('{$jsSign|json_encode}'));
|
||||
wx.ready(function () {
|
||||
$.get('{:url("payjs")}', {'action': 'options'}, function (ret) {
|
||||
$('.orderno').html('订单号:' + ret.order_no);
|
||||
if (ret.code && ret.code === 2) {
|
||||
$('#test').append('<button type="button" class="btn btn-success">已支付,刷新支付号</button>');
|
||||
return $('[type="submit"]').remove();
|
||||
}
|
||||
$('[type="submit"]').on('click', function () {
|
||||
if (ret.code && ret.code === 3) {
|
||||
return alert(ret.msg);
|
||||
}
|
||||
wx.chooseWXPay(ret);
|
||||
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
||||
<script>
|
||||
wx.error(function (e) {
|
||||
console.log(e);
|
||||
});
|
||||
});
|
||||
$('body').on('click', '[type="button"]', function () {
|
||||
$.get('{:url("payjs")}', {'action': 'reset'}, function () {
|
||||
window.location.reload();
|
||||
wx.config($.parseJSON('{$jsSign|json_encode}'));
|
||||
wx.ready(function () {
|
||||
$.get('{:url("payjs")}', {'action': 'options'}, function (ret) {
|
||||
$('.orderno').html('订单号:' + ret.order_no);
|
||||
if (ret.code && ret.code === 2) {
|
||||
$('#test').append('<button type="button" class="btn btn-success">已支付,刷新支付号</button>');
|
||||
return $('[type="submit"]').remove();
|
||||
}
|
||||
$('[type="submit"]').on('click', function () {
|
||||
if (ret.code && ret.code === 3) {
|
||||
return alert(ret.msg);
|
||||
}
|
||||
wx.chooseWXPay(ret);
|
||||
});
|
||||
});
|
||||
$('body').on('click', '[type="button"]', function () {
|
||||
$.get('{:url("payjs")}', {'action': 'reset'}, function () {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,53 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>扫码支付DEMO</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body style="text-align:center">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>扫码支付DEMO</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body style="text-align:center">
|
||||
|
||||
<div class="contrainer">
|
||||
<h3>扫码支付DEMO</h3>
|
||||
<hr/>
|
||||
<p id="showbox"></p>
|
||||
<p class="help-block">请使用其它手机微信扫描二维码。</p>
|
||||
<hr/>
|
||||
<p class="price">金额: 0.01元</p>
|
||||
<hr/>
|
||||
<p id="orderno"></p>
|
||||
<hr/>
|
||||
<button data-reset class="btn btn-default hide">重置订单号</button>
|
||||
<a href="{:url('payjs')}" class="btn btn-link">JSAPI支付测试</a>
|
||||
</div>
|
||||
<div class="contrainer">
|
||||
<h3>扫码支付DEMO</h3>
|
||||
<hr/>
|
||||
<p id="showbox"></p>
|
||||
<p class="help-block">请使用其它手机微信扫描二维码。</p>
|
||||
<hr/>
|
||||
<p class="price">金额: 0.01元</p>
|
||||
<hr/>
|
||||
<p id="orderno"></p>
|
||||
<hr/>
|
||||
<button data-reset class="btn btn-default hide">重置订单号</button>
|
||||
<a href="{:url('payjs')}" class="btn btn-link">JSAPI支付测试</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
|
||||
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
payTest.call(this), setInterval(payTest, 3000);
|
||||
payTest.call(this), setInterval(payTest, 3000);
|
||||
|
||||
/*! 支付测试动作 */
|
||||
function payTest() {
|
||||
$.get('{:url("payqrc")}', {'action': 'payqrc'}, function (ret) {
|
||||
if (ret.code === 2) {
|
||||
$('[data-reset]').removeClass('hide');
|
||||
ret.url = '__PUBLIC__/static/theme/default/img/wechat/qrc_payed.jpg';
|
||||
/*! 支付测试动作 */
|
||||
function payTest() {
|
||||
$.get('{:url("payqrc")}', {'action': 'payqrc'}, function (ret) {
|
||||
if (ret.code === 2) {
|
||||
$('[data-reset]').removeClass('hide');
|
||||
ret.url = '__PUBLIC__/static/theme/default/img/wechat/qrc_payed.jpg';
|
||||
}
|
||||
$('#showbox').html('<img style="width:300px" class="img-thumbnail" src="' + ret.url + '"/>');
|
||||
$('#orderno').html('订单号:' + ret.order_no);
|
||||
});
|
||||
}
|
||||
$('#showbox').html('<img style="width:300px" class="img-thumbnail" src="' + ret.url + '"/>');
|
||||
$('#orderno').html('订单号:' + ret.order_no);
|
||||
});
|
||||
}
|
||||
|
||||
$('[data-reset]').on('click', function () {
|
||||
$.get('{:url("payqrc")}', {'action': 'reset'}, function () {
|
||||
window.location.reload();
|
||||
$('[data-reset]').on('click', function () {
|
||||
$.get('{:url("payqrc")}', {'action': 'reset'}, function () {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -19,8 +19,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">AppID <span class="nowrap">(应用ID)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="wechat_appid" title="请输入以wx开头的18位公众号APPID" placeholder="公众号APPID(必填)"
|
||||
pattern="^wx[0-9a-z]{16}$" maxlength="18" required="required" value="{:sysconf('wechat_appid')}" class="layui-input">
|
||||
<input type="text" name="wechat_appid" title="请输入以wx开头的18位公众号APPID" placeholder="公众号APPID(必填)" pattern="^wx[0-9a-z]{16}$" maxlength="18" required="required" value="{:sysconf('wechat_appid')}" class="layui-input">
|
||||
<p class="help-block">
|
||||
公众号应用ID是所有接口必要参数,可以在公众号平台 [ 开发 >> 基本配置 ] 页面获取。
|
||||
</p>
|
||||
@ -31,9 +30,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">AppSecret <span class="nowrap">(应用密钥)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="password" name="wechat_appsecret" required="required" title="请输入32位公众号AppSecret"
|
||||
placeholder="公众号AppSecret(必填)" value="{:sysconf('wechat_appsecret')}"
|
||||
maxlength="32" pattern="^[0-9a-z]{32}$" class="layui-input">
|
||||
<input type="password" name="wechat_appsecret" required="required" title="请输入32位公众号AppSecret" placeholder="公众号AppSecret(必填)" value="{:sysconf('wechat_appsecret')}" maxlength="32" pattern="^[0-9a-z]{32}$" class="layui-input">
|
||||
<p class="help-block">
|
||||
公众号应用密钥是所有接口必要参数,可以在公众号平台 [ 开发 >> 基本配置 ] 页面授权后获取。
|
||||
</p>
|
||||
@ -44,8 +41,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Token <span class="nowrap">(令牌)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="wechat_token" required="required" title="请输入接口Token(令牌)"
|
||||
placeholder="Token(令牌)" value="{:sysconf('wechat_token')}" class="layui-input">
|
||||
<input type="text" name="wechat_token" required="required" title="请输入接口Token(令牌)" placeholder="Token(令牌)" value="{:sysconf('wechat_token')}" class="layui-input">
|
||||
<p class="help-block">
|
||||
公众号平台与系统对接认证Token,请优先填写此参数并保存,然后再在微信公众号平台操作对接。
|
||||
</p>
|
||||
@ -56,9 +52,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Encoding <span class="nowrap">AESKey</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type="text" name="wechat_encodingaeskey" title="请输入43位消息加密密钥"
|
||||
placeholder="消息加密密钥,若开启了消息加密时必需填写(可选)" value="{:sysconf('wechat_encodingaeskey')}"
|
||||
maxlength="43" class="layui-input">
|
||||
<input type="text" name="wechat_encodingaeskey" title="请输入43位消息加密密钥" placeholder="消息加密密钥,若开启了消息加密时必需填写(可选)" value="{:sysconf('wechat_encodingaeskey')}" maxlength="43" class="layui-input">
|
||||
<p class="help-block">
|
||||
公众号平台接口设置为加密模式,消息加密密钥必需填写并保持与公众号平台一致。
|
||||
</p>
|
||||
|
@ -10,19 +10,17 @@
|
||||
.refund-qrc-test {
|
||||
text-align: center;
|
||||
padding: 8px}
|
||||
</style>
|
||||
{/block}
|
||||
</style>
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post"
|
||||
class='form-horizontal' style='padding-top:20px'>
|
||||
{block name="content"}
|
||||
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post"
|
||||
class='form-horizontal' style='padding-top:20px'>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">MCH_ID <span class="nowrap">(商户ID)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type='tel' placeholder="请输入10位商户MCH_ID(必填)" title='请输入10位数字商户MCH_ID'
|
||||
required="required" pattern="^\d{10}$" maxlength='10' name='wechat_mch_id'
|
||||
value='{:sysconf("wechat_mch_id")}' class='layui-input'/>
|
||||
<input type='tel' placeholder="请输入10位商户MCH_ID(必填)" title='请输入10位数字商户MCH_ID' required="required" pattern="^\d{10}$" maxlength='10' name='wechat_mch_id' value='{:sysconf("wechat_mch_id")}' class='layui-input'/>
|
||||
<p class="help-block">
|
||||
注意:商户ID必需与微信接口配置公众号APPID对应,否则无法使用支付功能!
|
||||
</p>
|
||||
@ -33,9 +31,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">PartnerKey <span class="nowrap">(商户密钥)</span></label>
|
||||
<div class='col-sm-8'>
|
||||
<input type='password' placeholder="请输入32位商户支付密钥(必填)" required title='请输入32位商户支付密钥'
|
||||
pattern="^.{32}$" maxlength="32" name='wechat_partnerkey'
|
||||
value='{:sysconf("wechat_partnerkey")}' class='layui-input'/>
|
||||
<input type='password' placeholder="请输入32位商户支付密钥(必填)" required title='请输入32位商户支付密钥' pattern="^.{32}$" maxlength="32" name='wechat_partnerkey' value='{:sysconf("wechat_partnerkey")}' class='layui-input'/>
|
||||
<p class="help-block">
|
||||
微信支付商户密钥需要在商户平台配置,必需填写密钥之后才能正常使用微信支付功能。
|
||||
</p>
|
||||
@ -49,16 +45,14 @@
|
||||
<div class="nowrap">
|
||||
<input title="apiclient_key.pem" type="hidden" name="wechat_cert_key_md5">
|
||||
<input title="apiclient_cert.pem" type="hidden" name="wechat_cert_cert_md5">
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_key_md5" data-uptype="local"
|
||||
type="button" class="layui-btn layui-btn-primary">
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_key_md5" data-uptype="local" type="button" class="layui-btn layui-btn-primary">
|
||||
{if file_exists(sysconf('wechat_cert_key'))}
|
||||
已上传 apiclient_key.pem
|
||||
{else}
|
||||
请上传 apiclient_key.pem
|
||||
{/if}
|
||||
</button>
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_cert_md5" data-uptype="local"
|
||||
type="button" class="layui-btn layui-btn-primary">
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_cert_md5" data-uptype="local" type="button" class="layui-btn layui-btn-primary">
|
||||
{if file_exists(sysconf('wechat_cert_cert'))}
|
||||
已上传 apiclient_cert.pem
|
||||
{else}
|
||||
@ -91,7 +85,8 @@
|
||||
/*! 证书上传动作 */
|
||||
$('[name="wechat_cert_key_md5"],[name="wechat_cert_cert_md5"]').on('change', function () {
|
||||
this.value = $(this).attr('data-md5');
|
||||
$('[data-field="' + this.name + '"]').html('已选择 ' + this.title);});
|
||||
$('[data-field="' + this.name + '"]').html('已选择 ' + this.title);
|
||||
});
|
||||
|
||||
var isShow = false;
|
||||
var timer = null;
|
||||
@ -102,22 +97,30 @@
|
||||
if (ret.code === 1 || ret.code === 2) {
|
||||
if (ret.code === 2) {
|
||||
ret.url = '__PUBLIC__/static/theme/default/img/wechat/qrc_payed.jpg';
|
||||
timer && window.clearInterval(timer), timer = null;}
|
||||
timer && window.clearInterval(timer), timer = null;
|
||||
}
|
||||
if (isShow) {
|
||||
$('.pay-qrc-test').attr('src', ret.url)} else {
|
||||
$('.pay-qrc-test').attr('src', ret.url)
|
||||
} else {
|
||||
layer.open({
|
||||
type: 1, title: false, closeBtn: 1, shadeClose: true,
|
||||
content: '<img class="pay-qrc-test" src="' + ret.url + '"/>'
|
||||
+ '<p style="text-align:center">请用微信扫码测试支付!</p>'
|
||||
+ '<p class="refund-qrc-test"><a class="btn btn-xs btn-warning">退款测试</a></p>',
|
||||
+ '<p style="text-align:center">请用微信扫码测试支付!</p>'
|
||||
+ '<p class="refund-qrc-test"><a class="btn btn-xs btn-warning">退款测试</a></p>',
|
||||
end: function () {
|
||||
timer && window.clearInterval(timer), timer = null;
|
||||
isShow = false;},
|
||||
isShow = false;
|
||||
},
|
||||
success: function (layero, index) {
|
||||
isShow = true;
|
||||
layIndex = index;
|
||||
timer = setInterval(payTest, 3000);}});}}
|
||||
return false;}, !isShow);}
|
||||
timer = setInterval(payTest, 3000);
|
||||
}});
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}, !isShow);
|
||||
}
|
||||
|
||||
$('[data-pay-test]').on('click', payTest);
|
||||
|
||||
@ -127,7 +130,12 @@
|
||||
if (ret.code === 1) {
|
||||
timer && window.clearInterval(timer), timer = null;
|
||||
return $.msg.success(ret.msg, 3, function () {
|
||||
layer.close(layIndex);}), false;}});});});
|
||||
layer.close(layIndex);
|
||||
}), false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -141,6 +141,7 @@
|
||||
$('body').on('click', '[data-add-tag]', function () {
|
||||
var fans_id = this.getAttribute('data-add-tag');
|
||||
var used_id = this.getAttribute('data-used-id');
|
||||
alert(used_id);});
|
||||
alert(used_id);
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -61,23 +61,23 @@
|
||||
<div class="col-md-9">
|
||||
<select name='type' class='layui-input'>
|
||||
|
||||
{if !isset($vo.type) or $vo.type eq 'text'}
|
||||
<!--{if !isset($vo.type) or $vo.type eq 'text'}-->
|
||||
<option value='text' selected>文字</option>
|
||||
{else}
|
||||
<!--{else}-->
|
||||
<option value='text'>文字</option>
|
||||
{/if}
|
||||
<!--{/if}-->
|
||||
|
||||
{if isset($vo.type) and $vo.type eq 'news'}
|
||||
<!--{if isset($vo.type) and $vo.type eq 'news'}-->
|
||||
<option value='news' selected>图文</option>
|
||||
{else}
|
||||
<!--{else}-->
|
||||
<option value='news'>图文</option>
|
||||
{/if}
|
||||
<!--{/if}-->
|
||||
|
||||
{if isset($vo.type) and $vo.type eq 'image'}
|
||||
<!--{if isset($vo.type) and $vo.type eq 'image'}-->
|
||||
<option value='image' selected>图片</option>
|
||||
{else}
|
||||
<!--{else}-->
|
||||
<option value='image'>图片</option>
|
||||
{/if}
|
||||
<!--{/if}-->
|
||||
|
||||
<!--{if isset($vo.type) and $vo.type eq 'voice'}-->
|
||||
<!--<option value='voice' selected>语音</option>-->
|
||||
@ -85,17 +85,17 @@
|
||||
<!--<option value='voice'>语音</option>-->
|
||||
<!--{/if}-->
|
||||
|
||||
{if isset($vo.type) and $vo.type eq 'music'}
|
||||
<!--{if isset($vo.type) and $vo.type eq 'music'}-->
|
||||
<option value='music' selected>音乐</option>
|
||||
{else}
|
||||
<!--{else}-->
|
||||
<option value='music'>音乐</option>
|
||||
{/if}
|
||||
<!--{/if}-->
|
||||
|
||||
{if isset($vo.type) and $vo.type eq 'video'}
|
||||
<!--{if isset($vo.type) and $vo.type eq 'video'}-->
|
||||
<option value='video' selected>视频</option>
|
||||
{else}
|
||||
<!--{else}-->
|
||||
<option value='video'>视频</option>
|
||||
{/if}
|
||||
<!--{/if}-->
|
||||
|
||||
</select>
|
||||
</div>
|
||||
@ -222,7 +222,9 @@
|
||||
/*! 取消编辑 */
|
||||
$('[data-cancel-edit]').on('click', function () {
|
||||
$.msg.confirm('确定取消编辑吗?', function () {
|
||||
history.back();});});
|
||||
history.back();
|
||||
});
|
||||
});
|
||||
|
||||
/*! 默认类型事件 */
|
||||
$('body').off('change', 'select[name=type]').on('change', 'select[name=type]', function () {
|
||||
@ -241,22 +243,28 @@
|
||||
case 'music':
|
||||
return $('[name="music_url"]').trigger('change');
|
||||
case 'voice':
|
||||
return $('[name="voice_url"]').trigger('change');}});
|
||||
return $('[name="voice_url"]').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
function showReview(params) {
|
||||
$('#phone-preview').attr('src', '{:url("@wechat/review")}?' + $.param(params || {}));}
|
||||
$('#phone-preview').attr('src', '{:url("@wechat/review")}?' + $.param(params || {}));
|
||||
}
|
||||
|
||||
// 图文显示预览
|
||||
$('body').off('change', '[name="news_id"]').on('change', '[name="news_id"]', function () {
|
||||
showReview({type: 'news', content: this.value});});
|
||||
showReview({type: 'news', content: this.value});
|
||||
});
|
||||
|
||||
// 文字显示预览
|
||||
$('body').off('change', '[name="content"]').on('change', '[name="content"]', function () {
|
||||
showReview({type: 'text', content: this.value});});
|
||||
showReview({type: 'text', content: this.value});
|
||||
});
|
||||
|
||||
// 图片显示预览
|
||||
$('body').off('change', '[name="image_url"]').on('change', '[name="image_url"]', function () {
|
||||
showReview({type: 'image', content: this.value});});
|
||||
showReview({type: 'image', content: this.value});
|
||||
});
|
||||
|
||||
// 音乐显示预览
|
||||
var musicSelector = '[name="music_url"],[name="music_title"],[name="music_desc"],[name="music_image"]';
|
||||
@ -266,7 +274,8 @@
|
||||
params.url = $parent.find('[name="music_url"]').val();
|
||||
params.image = $parent.find('[name="music_image"]').val();
|
||||
params.desc = $parent.find('[name="music_desc"]').val();
|
||||
showReview(params);});
|
||||
showReview(params);
|
||||
});
|
||||
|
||||
// 视频显示预览
|
||||
var videoSelector = '[name="video_title"],[name="video_url"],[name="video_desc"]';
|
||||
@ -275,10 +284,13 @@
|
||||
params.title = $parent.find('[name="video_title"]').val();
|
||||
params.url = $parent.find('[name="video_url"]').val();
|
||||
params.desc = $parent.find('[name="video_desc"]').val();
|
||||
showReview(params);});
|
||||
showReview(params);
|
||||
});
|
||||
|
||||
// 默认事件触发
|
||||
$('select[name=type]').map(function () {
|
||||
$(this).trigger('change');});});
|
||||
$(this).trigger('change');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -127,21 +127,27 @@
|
||||
case 'music':
|
||||
return $('[name="music_url"]').trigger('change');
|
||||
case 'voice':
|
||||
return $('[name="voice_url"]').trigger('change');}});
|
||||
return $('[name="voice_url"]').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
function showReview(params) {
|
||||
params = params || {};
|
||||
$('#phone-preview').attr('src', '{"@wechat/review"|app_url}&' + $.param(params));}
|
||||
$('#phone-preview').attr('src', '{"@wechat/review"|app_url}&' + $.param(params));
|
||||
}
|
||||
|
||||
// 图文显示预览
|
||||
$('body').off('change', '[name="news_id"]').on('change', '[name="news_id"]', function () {
|
||||
showReview({type: 'news', content: this.value});});
|
||||
showReview({type: 'news', content: this.value});
|
||||
});
|
||||
// 文字显示预览
|
||||
$('body').off('change', '[name="content"]').on('change', '[name="content"]', function () {
|
||||
showReview({type: 'text', content: this.value});});
|
||||
showReview({type: 'text', content: this.value});
|
||||
});
|
||||
// 图片显示预览
|
||||
$('body').off('change', '[name="image_url"]').on('change', '[name="image_url"]', function () {
|
||||
showReview({type: 'image', content: this.value});});
|
||||
showReview({type: 'image', content: this.value});
|
||||
});
|
||||
// 音乐显示预览
|
||||
var musicSelector = '[name="music_url"],[name="music_title"],[name="music_desc"],[name="music_image"]';
|
||||
$('body').off('change', musicSelector).on('change', musicSelector, function () {
|
||||
@ -150,7 +156,8 @@
|
||||
params.url = $parent.find('[name="music_url"]').val();
|
||||
params.image = $parent.find('[name="music_image"]').val();
|
||||
params.desc = $parent.find('[name="music_desc"]').val();
|
||||
showReview(params);});
|
||||
showReview(params);
|
||||
});
|
||||
// 视频显示预览
|
||||
var videoSelector = '[name="video_title"],[name="video_url"],[name="video_desc"]';
|
||||
$('body').off('change', videoSelector).on('change', videoSelector, function () {
|
||||
@ -158,11 +165,13 @@
|
||||
params.title = $parent.find('[name="video_title"]').val();
|
||||
params.url = $parent.find('[name="video_url"]').val();
|
||||
params.desc = $parent.find('[name="video_desc"]').val();
|
||||
showReview(params);});
|
||||
showReview(params);
|
||||
});
|
||||
|
||||
// 默认事件触发
|
||||
$('select[name=type]').map(function () {
|
||||
$(this).trigger('change');});
|
||||
$(this).trigger('change');
|
||||
});
|
||||
|
||||
/*! 删除关键字 */
|
||||
$('[data-delete]').on('click', function () {
|
||||
@ -171,6 +180,11 @@
|
||||
$.msg.confirm('确定要删除这条记录吗?', function () {
|
||||
$.form.load(url, {id: id}, 'POST', function (ret) {
|
||||
if (ret.code === "SUCCESS") {
|
||||
window.location.reload();}});})});});
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -16,25 +16,25 @@
|
||||
<div class='mobile-header'>公众号</div>
|
||||
<div class='mobile-body'></div>
|
||||
<ul class='mobile-footer'>
|
||||
{foreach $list as $menu}
|
||||
<!--{foreach $list as $menu}-->
|
||||
<li class="parent-menu">
|
||||
<a><i class="icon-sub hide"></i> <span data-type="{$menu.type}" data-content="{$menu.content}">{$menu.name}</span></a>
|
||||
<div class="sub-menu text-center hide">
|
||||
<ul>
|
||||
{if empty($menu['sub']) eq false}
|
||||
{foreach $menu.sub as $submenu}
|
||||
<!--{if empty($menu['sub']) eq false}-->
|
||||
<!--{foreach $menu.sub as $submenu}-->
|
||||
<li>
|
||||
<a class="bottom-border"><span data-type="{$submenu.type}" data-content="{$submenu.content}">{$submenu.name}</span></a>
|
||||
</li>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<!--{/foreach}-->
|
||||
<!--{/if}-->
|
||||
<li class="menu-add"><a><i class="icon-add"></i></a></li>
|
||||
</ul>
|
||||
<i class="arrow arrow_out"></i>
|
||||
<i class="arrow arrow_in"></i>
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
<!--{/foreach}-->
|
||||
<li class="parent-menu menu-add">
|
||||
<a><i class="icon-add"></i></a>
|
||||
</li>
|
||||
@ -121,7 +121,8 @@
|
||||
var menu = function () {
|
||||
this.version = '1.0';
|
||||
this.$btn;
|
||||
this.listen();};
|
||||
this.listen();
|
||||
};
|
||||
/**
|
||||
* 控件默认事件
|
||||
* @returns {undefined}
|
||||
@ -130,12 +131,17 @@
|
||||
var self = this;
|
||||
$('.mobile-footer').on('click', 'li a', function () {
|
||||
self.$btn = $(this);
|
||||
self.$btn.parent('li').hasClass('menu-add') ? self.add() : self.checkShow();}).find('li:first a:first').trigger('click');
|
||||
self.$btn.parent('li').hasClass('menu-add') ? self.add() : self.checkShow();
|
||||
}).find('li:first a:first').trigger('click');
|
||||
$('.menu-delete').on('click', function () {
|
||||
var index = $.msg.confirm('删除后菜单下设置的内容将被删除!', function () {
|
||||
self.del(), $.msg.close(index);});});
|
||||
self.del(), $.msg.close(index);
|
||||
});
|
||||
});
|
||||
$('.menu-submit').on('click', function () {
|
||||
self.submit();});};
|
||||
self.submit();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 添加一个菜单
|
||||
* @returns {undefined}
|
||||
@ -145,9 +151,12 @@
|
||||
if ($ul.hasClass('mobile-footer')) { /* 添加一级菜单 */
|
||||
var $li = $('<li class="parent-menu"><a class="active"><i class="icon-sub hide"></i> <span>一级菜单</span></a></li>').insertBefore($add);
|
||||
this.$btn = $li.find('a');
|
||||
$('<div class="sub-menu text-center hide"><ul><li class="menu-add"><a><i class="icon-add"></i></a></li></ul><i class="arrow arrow_out"></i><i class="arrow arrow_in"></i></div>').appendTo($li);} else { /* 添加二级菜单 */
|
||||
this.$btn = $('<li><a class="bottom-border"><span>二级菜单</span></a></li>').prependTo($ul).find('a');}
|
||||
this.checkShow();};
|
||||
$('<div class="sub-menu text-center hide"><ul><li class="menu-add"><a><i class="icon-add"></i></a></li></ul><i class="arrow arrow_out"></i><i class="arrow arrow_in"></i></div>').appendTo($li);
|
||||
} else { /* 添加二级菜单 */
|
||||
this.$btn = $('<li><a class="bottom-border"><span>二级菜单</span></a></li>').prependTo($ul).find('a');
|
||||
}
|
||||
this.checkShow();
|
||||
};
|
||||
/**
|
||||
* 数据校验显示
|
||||
* @returns {unresolved}
|
||||
@ -156,7 +165,8 @@
|
||||
var $li = this.$btn.parent('li'), $ul = $li.parent('ul');
|
||||
/* 选中一级菜单时显示二级菜单 */
|
||||
if ($li.hasClass('parent-menu')) {
|
||||
$('.parent-menu .sub-menu').not(this.$btn.parent('li').find('.sub-menu').removeClass('hide')).addClass('hide');}
|
||||
$('.parent-menu .sub-menu').not(this.$btn.parent('li').find('.sub-menu').removeClass('hide')).addClass('hide');
|
||||
}
|
||||
|
||||
/* 一级菜单添加按钮 */
|
||||
var $add = $('li.parent-menu:last');
|
||||
@ -164,16 +174,19 @@
|
||||
/* 二级菜单添加按钮 */
|
||||
$add.siblings('li').map(function () {
|
||||
var $add = $(this).find('ul li:last');
|
||||
$add.siblings('li').size() >= 5 ? $add.addClass('hide') : $add.removeClass('hide');});
|
||||
$add.siblings('li').size() >= 5 ? $add.addClass('hide') : $add.removeClass('hide');
|
||||
});
|
||||
/* 处理一级菜单 */
|
||||
var parentWidth = 100 / $('li.parent-menu:visible').size() + '%';
|
||||
$('li.parent-menu').map(function () {
|
||||
var $icon = $(this).find('.icon-sub');
|
||||
$(this).width(parentWidth).find('ul li').size() > 1 ? $icon.removeClass('hide') : $icon.addClass('hide');});
|
||||
$(this).width(parentWidth).find('ul li').size() > 1 ? $icon.removeClass('hide') : $icon.addClass('hide');
|
||||
});
|
||||
/* 更新选择中状态 */
|
||||
$('.mobile-footer a.active').not(this.$btn.addClass('active')).removeClass('active');
|
||||
this.renderEdit();
|
||||
return $ul;};
|
||||
return $ul;
|
||||
};
|
||||
/**
|
||||
* 删除当前菜单
|
||||
* @returns {undefined}
|
||||
@ -182,15 +195,20 @@
|
||||
var $li = this.$btn.parent('li'), $ul = $li.parent('ul');
|
||||
var $default = function () {
|
||||
if ($li.prev('li').size() > 0) {
|
||||
return $li.prev('li');}
|
||||
return $li.prev('li');
|
||||
}
|
||||
if ($li.next('li').size() > 0 && !$li.next('li').hasClass('menu-add')) {
|
||||
return $li.next('li');}
|
||||
return $li.next('li');
|
||||
}
|
||||
if ($ul.parents('li.parent-menu').size() > 0) {
|
||||
return $ul.parents('li.parent-menu');}
|
||||
return $('null');}.call(this);
|
||||
return $ul.parents('li.parent-menu');
|
||||
}
|
||||
return $('null');
|
||||
}.call(this);
|
||||
$li.remove();
|
||||
this.$btn = $default.find('a:first');
|
||||
this.checkShow();};
|
||||
this.checkShow();
|
||||
};
|
||||
/**
|
||||
* 显示当前菜单的属性值
|
||||
* @returns {undefined}
|
||||
@ -201,11 +219,14 @@
|
||||
if ($li.find('ul li').size() > 1) { /*父菜单*/
|
||||
$html = $($('.menu-editor-parent-tpl').html());
|
||||
$html.find('input[name="menu-name"]').val($span.text()).on('change keyup', function () {
|
||||
$span.text(this.value || ' ');});
|
||||
$('.menu-editor .menu-content').html($html);} else {
|
||||
$span.text(this.value || ' ');
|
||||
});
|
||||
$('.menu-editor .menu-content').html($html);
|
||||
} else {
|
||||
$html = $($('.menu-editor-content-tpl').html());
|
||||
$html.find('input[name="menu-name"]').val($span.text()).on('change keyup', function () {
|
||||
$span.text(this.value || ' ');});
|
||||
$span.text(this.value || ' ');
|
||||
});
|
||||
$('.menu-editor .menu-content').html($html);
|
||||
var type = $span.attr('data-type') || 'text';
|
||||
$html.find('input[name="menu-type"]').on('click', function () {
|
||||
@ -231,14 +252,22 @@
|
||||
var select = [], tpl = '<div><label class="font-noraml"><input class="cuci-radio" name="content" type="radio" {checked} value="{value}"> {title}</label></div>';
|
||||
if (!(options[content] || false)) {
|
||||
content = 'scancode_push';
|
||||
$span.data('content', content);}
|
||||
$span.data('content', content);
|
||||
}
|
||||
for (var i in options) {
|
||||
select.push(tpl.replace('{value}', i).replace('{title}', options[i]).replace('{checked}', (i === content) ? 'checked' : ''));}
|
||||
return select.join('');}}.call(this);
|
||||
select.push(tpl.replace('{value}', i).replace('{title}', options[i]).replace('{checked}', (i === content) ? 'checked' : ''));
|
||||
}
|
||||
return select.join('');
|
||||
}
|
||||
}.call(this);
|
||||
var $html = $(html), $input = $html.find('input,textarea');
|
||||
$input.on('change keyup click', function () {
|
||||
$span.data('content', $(this).val() || $(this).html());});
|
||||
$('.editor-content-input').html($html);}).filter('input[value="{type}"]'.replace('{type}', type)).trigger('click');}};
|
||||
$span.data('content', $(this).val() || $(this).html());
|
||||
});
|
||||
$('.editor-content-input').html($html);
|
||||
}).filter('input[value="{type}"]'.replace('{type}', type)).trigger('click');
|
||||
}
|
||||
};
|
||||
/**
|
||||
* 提交数据
|
||||
* @returns {undefined}
|
||||
@ -251,7 +280,8 @@
|
||||
menudata.name = $span.text();
|
||||
menudata.type = $span.attr('data-type');
|
||||
menudata.content = $span.data('content') || '';
|
||||
return menudata;}
|
||||
return menudata;
|
||||
}
|
||||
|
||||
$('li.parent-menu').map(function (index, item) {
|
||||
if (!$(item).hasClass('menu-add')) {
|
||||
@ -266,11 +296,16 @@
|
||||
submenudata.index = (index + 1) + '' + (ii + 1);
|
||||
submenudata.pindex = menudata.index;
|
||||
submenudata.sort = ii;
|
||||
data.push(submenudata);});}});
|
||||
$.form.load('{:url("$classuri/edit")}', {data: data}, 'POST');};
|
||||
data.push(submenudata);
|
||||
});
|
||||
}
|
||||
});
|
||||
$.form.load('{:url("$classuri/edit")}', {data: data}, 'POST');
|
||||
};
|
||||
/**
|
||||
* 实例菜单控件
|
||||
*/
|
||||
new menu();});
|
||||
new menu();
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -115,11 +115,13 @@
|
||||
var editDdata = {$vo.articles | default = [] | json_encode};
|
||||
|
||||
for (var i in editDdata) {
|
||||
$('.news-item').eq(i).data('item', editDdata[i]);}
|
||||
$('.news-item').eq(i).data('item', editDdata[i]);
|
||||
}
|
||||
|
||||
$('body').on('change', '.upload-image-box input', function () {
|
||||
$('.news-item.active').css('background-image', 'url(' + this.value + ')');
|
||||
$(this).parent('.upload-image-box').css('background-image', 'url(' + this.value + ')');});
|
||||
$(this).parent('.upload-image-box').css('background-image', 'url(' + this.value + ')');
|
||||
});
|
||||
|
||||
require(['ueditor'], function () {
|
||||
|
||||
@ -142,17 +144,22 @@
|
||||
$form.submit();
|
||||
if (!syncEditor($('.news-item.active'))) {
|
||||
editor.setContent('文章内容不能留空,请输入内容!');
|
||||
return false;}
|
||||
return false;
|
||||
}
|
||||
$('.news-item').map(function () {
|
||||
var item = $(this).data('item');
|
||||
item.content = item.content || '文章内容不能留空,请输入内容!';
|
||||
data.push(item);});
|
||||
$.form.load('__SELF__', {data: data}, "post");});
|
||||
data.push(item);
|
||||
});
|
||||
$.form.load('__SELF__', {data: data}, "post");
|
||||
});
|
||||
|
||||
/*! 输入标题显示 */
|
||||
$form.find('[name="title"]').on('keyup', function () {
|
||||
if ($item) {
|
||||
$item.find('.news-title').html(this.value).show();}});
|
||||
$item.find('.news-title').html(this.value).show();
|
||||
}
|
||||
});
|
||||
|
||||
/*! 同步编辑器 */
|
||||
function syncEditor($pItem) {
|
||||
@ -169,8 +176,11 @@
|
||||
if ($form.find('input.validate-error').size() > 0 || data.content.length < 1) {
|
||||
((data.content || '').length < 1) && editor.setContent('文章内容不能留空,请输入内容!');
|
||||
$pItem.addClass('active').siblings().removeClass('active');
|
||||
return false;}}
|
||||
return true;}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*! 显示编辑器 */
|
||||
function showEditor() {
|
||||
@ -183,46 +193,60 @@
|
||||
data.content = data.content || '';
|
||||
data.author = data.author || '';
|
||||
data.show_cover_pic = data.show_cover_pic || 0;
|
||||
return data;};
|
||||
return data;
|
||||
};
|
||||
// 重置表单
|
||||
$form.get(0).reset();
|
||||
// 获取当前数据
|
||||
var data = this.get();
|
||||
for (var i in data) {
|
||||
if (i !== 'content' && i !== 'show_cover_pic') {
|
||||
$form.find('[name="' + i + '"]').val(data[i]).trigger('change');}}
|
||||
$form.find('[name="' + i + '"]').val(data[i]).trigger('change');
|
||||
}
|
||||
}
|
||||
if (parseInt(data.show_cover_pic) === 1) {
|
||||
$form.find('[name="show_cover_pic"]').get(0).checked = true;}
|
||||
editor.setContent(data.content);}
|
||||
$form.find('[name="show_cover_pic"]').get(0).checked = true;
|
||||
}
|
||||
editor.setContent(data.content);
|
||||
}
|
||||
|
||||
/*! 添加新图文 */
|
||||
$body.off('click', '.news-box .article-add').on('click', '.news-box .article-add', function () {
|
||||
var $html = $('<div class="news-item transition" style="background-image:url(__PUBLIC__/static/plugs/uploader/theme/image.png)"><span class="news-title"></span></div><hr />');
|
||||
$html.insertBefore(this).trigger('click');
|
||||
$('.news-item').size() >= 7 && $(this).hide();});
|
||||
$('.news-item').size() >= 7 && $(this).hide();
|
||||
});
|
||||
|
||||
/*! 列表选择 */
|
||||
$body.off('click', '.news-item').on('click', '.news-item', function () {
|
||||
if (syncEditor($('.news-item.active'))) {
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
showEditor($item);}});
|
||||
showEditor($item);
|
||||
}
|
||||
});
|
||||
|
||||
/*! 隐藏删除按钮 */
|
||||
$body.off('mouseleave').on('mouseleave', '.news-item', function () {
|
||||
$(this).find('.upload-multiple-close').addClass('hide');});
|
||||
$(this).find('.upload-multiple-close').addClass('hide');
|
||||
});
|
||||
|
||||
/*! 显示删除按钮 */
|
||||
$body.off('mouseenter', '.news-item').on('mouseenter', '.news-item', function () {
|
||||
$('.upload-multiple-close').addClass('hide');
|
||||
$(this).find('.upload-multiple-close').removeClass('hide');});
|
||||
$(this).find('.upload-multiple-close').removeClass('hide');
|
||||
});
|
||||
|
||||
/*! 删除操作图文 */
|
||||
$body.off('click', '.upload-multiple-close').on('click', '.upload-multiple-close', function () {
|
||||
$(this).parents('.news-item').remove();
|
||||
$('.news-item').size() < 7 && $('.news-box .article-add').show();});
|
||||
$('.news-item').size() < 7 && $('.news-box .article-add').show();
|
||||
});
|
||||
|
||||
/*! 默认显示第一个 */
|
||||
$('.news-box .news-item:first').trigger('click');});});});
|
||||
$('.news-box .news-item:first').trigger('click');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
|
@ -42,8 +42,10 @@
|
||||
<script>
|
||||
|
||||
$('body').on('mouseenter', '.news_item', function () {
|
||||
$(this).find('.news_tools').removeClass('hide');}).on('mouseleave', '.news_item', function () {
|
||||
$(this).find('.news_tools').addClass('hide');});
|
||||
$(this).find('.news_tools').removeClass('hide');
|
||||
}).on('mouseleave', '.news_item', function () {
|
||||
$(this).find('.news_tools').addClass('hide');
|
||||
});
|
||||
|
||||
require(['jquery.masonry'], function (Masonry) {
|
||||
var container = document.querySelector('#news_box');
|
||||
@ -56,8 +58,13 @@
|
||||
if (ret.code) {
|
||||
$(self).parents('.news_item').remove();
|
||||
msnry.layout();
|
||||
return $.msg.success(ret.msg), false;}
|
||||
return $.msg.error(ret.msg), false;});});});});
|
||||
return $.msg.success(ret.msg), false;
|
||||
}
|
||||
return $.msg.error(ret.msg), false;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -46,30 +46,41 @@
|
||||
var check_status = check_checked();
|
||||
/*重置和全选数据变化处理*/
|
||||
$('input[name*=fans_tags]').map(function () {
|
||||
this.checked = !check_status;});
|
||||
this.checked = !check_status;
|
||||
});
|
||||
check_checked();
|
||||
postpush();});
|
||||
postpush();
|
||||
});
|
||||
/*重置和全选的效果处理*/
|
||||
function check_checked() {
|
||||
var allcheck = true;
|
||||
$('input[name*=fans_tags]').map(function () {
|
||||
(!this.checked) && (allcheck = false);});
|
||||
return ((allcheck) ? $allbtn.html('重置') : $allbtn.html('全选')), allcheck;}
|
||||
(!this.checked) && (allcheck = false);
|
||||
});
|
||||
return ((allcheck) ? $allbtn.html('重置') : $allbtn.html('全选')), allcheck;
|
||||
}
|
||||
|
||||
/*点击每一个选项都触发事件*/
|
||||
$('input[name*=fans_tags]').on('click', function () {
|
||||
check_checked();
|
||||
postpush();});
|
||||
postpush();
|
||||
});
|
||||
/*数据异步获取并显示出来*/
|
||||
function postpush() {
|
||||
var inp = $('input[name*=fans_tags]');
|
||||
var group = [];
|
||||
for (var i = 0; i < inp.length; i++) {
|
||||
if (inp[i].checked === true) {
|
||||
group.push(inp[i].value);}}
|
||||
group.push(inp[i].value);
|
||||
}
|
||||
}
|
||||
$.post("{:url('wechat/news/push')}?action=getuser", {group: group.join(',')}, function (ret) {
|
||||
var html = template('push', ret);
|
||||
document.getElementById('push-tags').innerHTML = html;});}});
|
||||
document.getElementById('push-tags').innerHTML = html;
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
</div>
|
||||
<div id='push-tags' class="list-item"></div>
|
||||
|
@ -170,7 +170,9 @@
|
||||
<script>
|
||||
$(function () {
|
||||
$('[data-href]').on('click', function () {
|
||||
window.location.href = this.getAttribute('data-href');});});
|
||||
window.location.href = this.getAttribute('data-href');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
</body>
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit100512daef0328603db43c7860e1b81c::getLoader();
|
||||
return ComposerAutoloaderInit5cb6a9364227ba2158c05a13f4655c4b::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit100512daef0328603db43c7860e1b81c
|
||||
class ComposerAutoloaderInit5cb6a9364227ba2158c05a13f4655c4b
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -19,15 +19,15 @@ class ComposerAutoloaderInit100512daef0328603db43c7860e1b81c
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit100512daef0328603db43c7860e1b81c', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit5cb6a9364227ba2158c05a13f4655c4b', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit100512daef0328603db43c7860e1b81c', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit5cb6a9364227ba2158c05a13f4655c4b', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit100512daef0328603db43c7860e1b81c::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit5cb6a9364227ba2158c05a13f4655c4b::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
@ -48,19 +48,19 @@ class ComposerAutoloaderInit100512daef0328603db43c7860e1b81c
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit100512daef0328603db43c7860e1b81c::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit5cb6a9364227ba2158c05a13f4655c4b::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire100512daef0328603db43c7860e1b81c($fileIdentifier, $file);
|
||||
composerRequire5cb6a9364227ba2158c05a13f4655c4b($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire100512daef0328603db43c7860e1b81c($fileIdentifier, $file)
|
||||
function composerRequire5cb6a9364227ba2158c05a13f4655c4b($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit100512daef0328603db43c7860e1b81c
|
||||
class ComposerStaticInit5cb6a9364227ba2158c05a13f4655c4b
|
||||
{
|
||||
public static $files = array (
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||
@ -314,9 +314,9 @@ class ComposerStaticInit100512daef0328603db43c7860e1b81c
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit100512daef0328603db43c7860e1b81c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit100512daef0328603db43c7860e1b81c::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit100512daef0328603db43c7860e1b81c::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit5cb6a9364227ba2158c05a13f4655c4b::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit5cb6a9364227ba2158c05a13f4655c4b::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit5cb6a9364227ba2158c05a13f4655c4b::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user