Compare commits

...

8 Commits

Author SHA1 Message Date
邹景立
e829aba4f6 Update index.html 2022-03-18 22:45:44 +08:00
邹景立
bc76f541f8 Update index.html 2022-03-18 22:43:43 +08:00
邹景立
03180d64ef Update UserTokenService.php 2022-03-18 22:36:13 +08:00
邹景立
801788a3f2 Update FansService.php 2022-03-18 22:34:32 +08:00
邹景立
8049a21c27 Update FansService.php 2022-03-18 22:31:06 +08:00
邹景立
25014ee662 优化后台样式 2022-03-18 22:22:25 +08:00
邹景立
82dad4b050 优化后台样式 2022-03-18 22:16:11 +08:00
邹景立
3788a88de7 优化 lay.table 数据加载闪烁 2022-03-18 22:11:35 +08:00
9 changed files with 18 additions and 23 deletions

View File

@ -68,9 +68,7 @@
$.form.load("{:url('state')}", data, 'post', function (ret) {
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#MenuTable').trigger('reload');
}); else if (obj.value.split(',').length > 2) {
$('#MenuTable').trigger('reload');
}
}); else $('#MenuTable').trigger('reload');
return false;
}, false);
});

View File

@ -73,7 +73,7 @@
$.form.load("{:url('state')}", data, 'post', function (ret) {
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
$('#UserTable').trigger('reload');
});
}); else $('#UserTable').trigger('reload')
return false;
}, false);
});

View File

@ -79,8 +79,7 @@ class UserTokenService extends Service
public static function token(int $uuid, string $type): array
{
// 清理无效认证数据
$time = time();
$map1 = [['token', '<>', 'token'], ['time', '<', $time]];
$map1 = [['token', '<>', 'token'], ['time', '<', $time = time()]];
$map2 = [['token', '<>', 'token'], ['type', '=', $type], ['uuid', '=', $uuid]];
DataUserToken::mk()->whereOr([$map1, $map2])->delete();
// 创建新的认证数据
@ -90,7 +89,7 @@ class UserTokenService extends Service
$data = array_merge($map, [
'uuid' => $uuid,
'time' => $time + static::$expire,
'tokenv' => static::buildVerify()
'tokenv' => static::buildVerify(),
]);
if (DataUserToken::mk()->insert($data) !== false) {
return [1, '刷新认证成功', $data];

View File

@ -32,9 +32,6 @@ class FansService extends Service
* @param array $user 粉丝信息
* @param string $appid 微信APPID
* @return boolean
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function set(array $user, string $appid = ''): bool
{
@ -46,8 +43,9 @@ class FansService extends Service
}
if ($appid !== '') $user['appid'] = $appid;
unset($user['privilege'], $user['groupid']);
foreach ($user as $k => $v) if ($v === '') unset($user[$k]);
$this->app->event->trigger('WechatFansUpdate', $user);
return !!data_save(WechatFans::class, $user, 'openid');
return !!WechatFans::mUpdate($user, 'openid');
}
/**

View File

@ -665,6 +665,8 @@ $(function () {
option.id = table.id, option.elem = table, option.url = params.url || table.dataset.url || location.href;
option.page = params.page !== false ? (params.page || true) : false, option.limit = params.limit || 20;
option.loading = params.loading === true, option.autoSort = params.autoSort === true, option.cols = params.cols || [[]];
// 初始化不显示头部
option.css = (option.css || '') + '.layui-table-box{opacity:0}.layui-table-page{opacity:0}';
// 默认动态设置页数, 动态设置最大高度
if (option.page === true) option.page = {curr: layui.sessionData('pages')[option.id] || 1};
if (option.height === 'full') if ($table.parents('.iframe-pagination').size()) {
@ -675,8 +677,8 @@ $(function () {
}
// 动态计算最大页数
option.done = function () {
$table.data('that', this);
layui.sessionData('pages', {key: table.id, value: this.page.curr || 1}), (option.loading = true);
$table.data('that', this).next().find('.layui-table-box,.layui-table-page').animate({opacity: 1})
$.form.reInit($table.next()).find('[data-load],[data-queue],[data-action],[data-iframe]').not('[data-table-id]').attr('data-table-id', table.id);
}, option.parseData = function (res) {
if (typeof params.filter === 'function') res.data = params.filter(res.data, res);
@ -685,9 +687,8 @@ $(function () {
if (curp > maxp && maxp > 1) $table.trigger('reload', {page: {curr: maxp}});
return res;
};
// 实例并绑定的对象
// 实例并绑定事件
$table.data('this', layui.table.render(bindData(option)));
// 绑定实例重载事件
$table.bind('reload render reloadData', function (evt, opts) {
data = $.extend({}, data, (opts = opts || {}).where || {});
opts = bindData($.extend({}, opts, {loading: true}));

View File

@ -60,7 +60,6 @@
@LoadBackColor: #EFEFEF;
// 窗口页面背景颜色
@BodyMainTop: 50px;
@BodyMainBackColor: #EFEFEF;
// 左侧菜单大小

View File

@ -88,7 +88,7 @@
}
.layui-nav-child {
top: @BodyMainTop;
top: @TopHeaderHeight;
border: 0;
padding: 0;
line-height: 48px;
@ -211,7 +211,7 @@
}
.layui-side-scroll {
top: @BodyMainTop;
top: @TopHeaderHeight;
bottom: 0;
width: 100% !important;
height: 100% !important;
@ -294,7 +294,7 @@
}
> .layui-body {
top: @BodyMainTop;
top: @TopHeaderHeight;
left: @LayoutDefaLeftSzie;
padding: 0;
z-index: 111;
@ -319,7 +319,7 @@
box-sizing: border-box;
> .layui-card-html {
padding: 15px;
padding: 15px 15px 10px 15px;
min-width: 100%;
position: absolute;
box-sizing: border-box;
@ -327,7 +327,7 @@
}
> .layui-card-table {
padding: 15px;
padding: 15px 15px 10px 15px;
box-sizing: border-box;
#bodyLayout();
}
@ -352,7 +352,7 @@
}
> .layui-card-header {
top: @BodyMainTop;
top: @TopHeaderHeight;
left: @LayoutDefaLeftSzie;
border-top: @BoxBottomLine;
border-bottom: 1px solid #fff !important;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long