156 lines
31 KiB
PHP
Executable File
156 lines
31 KiB
PHP
Executable File
<?php /*a:6:{s:64:"/www/wwwroot/app.cxhxy.dev.1nww.com/app/admin/view/addon/my.html";i:1700552721;s:69:"/www/wwwroot/app.cxhxy.dev.1nww.com/app/admin/view/layout/layout.html";i:1700552721;s:72:"/www/wwwroot/app.cxhxy.dev.1nww.com/app/admin/view/addon/tpl/config.html";i:1700552721;s:71:"/www/wwwroot/app.cxhxy.dev.1nww.com/app/admin/view/addon/tpl/login.html";i:1700552721;s:70:"/www/wwwroot/app.cxhxy.dev.1nww.com/app/admin/view/addon/tpl/user.html";i:1700552721;s:71:"/www/wwwroot/app.cxhxy.dev.1nww.com/app/admin/view/addon/tpl/local.html";i:1700552721;}*/ ?>
|
||
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||
<title>管理后台 - <?php echo htmlentities($web['name']); ?></title>
|
||
<meta name="author" content="<?php echo htmlentities($web['name']); ?>">
|
||
<meta name="keywords" content="<?php echo htmlentities($web['keywords']); ?>">
|
||
<meta name="description" content="<?php echo htmlentities($web['description']); ?>">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<meta name="referrer" content="no-referrer-when-downgrade">
|
||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||
<link rel="stylesheet" href="/assets/plugins/amazeui/amazeui.css?v=<?php echo htmlentities($version); ?>" />
|
||
<link rel="stylesheet" href="/assets/css/hema.app.css?v=<?php echo htmlentities($version); ?>" />
|
||
<link rel="stylesheet" href="/addons/upload/css/file.library.css?v=<?php echo htmlentities($version); ?>" />
|
||
<link rel="stylesheet" href="/assets/plugins/iconfont/iconfont.css?v=<?php echo htmlentities($version); ?>">
|
||
<script src="/assets/plugins/jquery/jquery.min.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/plugins/iconfont/iconfont.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script>
|
||
BASE_URL = '<?php echo isset($base_url) ? $base_url : ''; ?>';
|
||
STORE_URL = '<?php echo isset($store_url) ? $store_url : ''; ?>';
|
||
APPLET_ID = '<?php echo isset($applet_id) ? $applet_id : 0; ?>';
|
||
</script>
|
||
</head>
|
||
<body data-type="">
|
||
<div class="am-g tpl-g">
|
||
<!-- 头部 -->
|
||
<header class="tpl-header">
|
||
<!-- 右侧内容 -->
|
||
<div class="tpl-header-fluid">
|
||
<!-- 侧边切换 -->
|
||
<div class="am-fl tpl-header-button switch-button"> <i class="iconfont iconzhedie"></i> </div>
|
||
<!-- 刷新页面 -->
|
||
<div class="am-fl tpl-header-button refresh-button"> <i class="iconfont iconshuaxin"></i> </div>
|
||
<!-- 其它功能-->
|
||
<div class="am-fr tpl-header-navbar">
|
||
<ul>
|
||
<!-- 当前版本 -->
|
||
<li class="am-text-sm">
|
||
<a href="javascript:void(0);" class="hemaphp-upgrade">
|
||
<small style="color:#ccc;">版本:V<?php echo htmlentities($version); ?></small>
|
||
<?php if($is_new): ?>
|
||
<div class="news"></div>
|
||
<?php endif; ?>
|
||
</a>
|
||
</li>
|
||
<!-- 欢迎语 -->
|
||
<li class="am-text-sm">
|
||
<div class="am-dropdown" data-am-dropdown="{boundary: '.am-topbar'}">
|
||
<div class="am-topbar-btn am-dropdown-toggle" data-am-dropdown-toggle>
|
||
<img src="/assets/img/avatar.png" />
|
||
<?php echo htmlentities((isset($user['user']['user_name']) && ($user['user']['user_name'] !== '')?$user['user']['user_name']:'')); ?>
|
||
<span class="am-icon-caret-down"></span>
|
||
</div>
|
||
<ul class="am-dropdown-content">
|
||
<li><a href="<?php echo url('passport/renew'); ?>">修改密码</a></li>
|
||
<li><a href="<?php echo url('passport/logout'); ?>">安全退出</a></li>
|
||
</ul>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</header> <!-- 侧边导航栏 -->
|
||
<div class="left-sidebar dis-flex">
|
||
<?php $menus = $menus ?: []; $group = $group ?: 0; $second = isset($menus[$group]['submenu']) ? $menus[$group]['submenu'] : []?>
|
||
<!-- 一级菜单 -->
|
||
<ul class="sidebar-nav">
|
||
<li class="sidebar-nav-heading">管理后台</li> <?php foreach($menus as $key=>$item): ?> <li
|
||
class="sidebar-nav-link"> <a
|
||
href="<?php echo isset($item['index']) ? url($item['index']) : 'javascript:void(0);'; ?>"
|
||
class="<?php echo !empty($item['active']) ? 'active' : ''; ?>"> <?php if((isset($item['is_svg']) && ($item['is_svg'] == true))): ?>
|
||
<svg class="icon sidebar-nav-link-logo" aria-hidden="true">
|
||
<use xlink:href="#<?php echo htmlentities($item['icon']); ?>"></use>
|
||
</svg> <?php else: ?> <i class="iconfont sidebar-nav-link-logo <?php echo htmlentities($item['icon']); ?>"
|
||
style="{isset($item.color) ? 'color:'.$item.color.';' : '' }"></i> <?php endif; ?> <?php echo htmlentities($item['name']); ?>
|
||
</a> </li> <?php endforeach; ?>
|
||
</ul> <!-- 子级菜单--> <?php if((sizeof($second) > 0)): ?> <ul class="left-sidebar-second">
|
||
<li class="sidebar-second-title"><?php echo htmlentities($menus[$group]['name']); ?></li>
|
||
<li class="sidebar-second-item"> <?php foreach($second as $key=>$item): if((!isset($item['submenu']))): ?>
|
||
<!-- 二级菜单--> <a href="<?php echo url($item['index']); ?>" class="<?php echo !empty($item['active']) ? 'active' : ''; ?>">
|
||
<?php echo htmlentities($item['name']); ?> </a> <?php else: ?>
|
||
<!-- 三级菜单-->
|
||
<div class="sidebar-third-item"> <a href="javascript:void(0);"
|
||
class="sidebar-nav-sub-title <?php echo !empty($item['active']) ? 'active' : ''; ?>"> <i
|
||
class="iconfont icongengduo"></i> <?php echo htmlentities($item['name']); ?> </a>
|
||
<ul class="sidebar-third-nav-sub"> <?php foreach($item['submenu'] as $third): ?> <li> <a
|
||
class="<?php echo !empty($third['active']) ? 'active' : ''; ?>" href="<?php echo url($third['index']); ?>">
|
||
<?php echo htmlentities($third['name']); ?> </a> </li> <?php endforeach; ?> </ul>
|
||
</div> <?php endif; ?> <?php endforeach; ?>
|
||
</li>
|
||
</ul> <?php endif; ?>
|
||
</div> <!-- 内容区域 start -->
|
||
<div class="tpl-content-wrapper <?php echo sizeof($second) == 0 ? 'no-sidebar-second' : ''; ?>"> <div class="row-content am-cf">
|
||
|
||
<div class="row">
|
||
|
||
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
|
||
|
||
<div class="widget am-cf">
|
||
|
||
<div class="widget-head am-cf">
|
||
|
||
<div class="widget-title am-cf fl">我的插件 </div>
|
||
|
||
<div class="fr">
|
||
|
||
<a href="javascript:void(0);" class="hema-login am-btn am-btn-secondary am-radius am-btn-sm">
|
||
|
||
<i class="am-icon-user"></i> 用户信息
|
||
|
||
</a>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="widget-body am-fr">
|
||
<div class="page_toolbar am-margin-bottom am-cf">
|
||
<div class="am-u-sm-12 am-u-md-3">
|
||
<div class="am-form-group">
|
||
<div class="am-btn-group am-btn-group-xs">
|
||
<a class="item-local am-btn am-btn-default am-btn-success"
|
||
href="javascript:;">
|
||
<span class="am-icon-plus"></span> 离线安装
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="am-scrollable-horizontal am-u-sm-12">
|
||
|
||
<table width="100%" class="am-table am-table-hover tpl-table-black">
|
||
|
||
<thead>
|
||
|
||
<tr>
|
||
|
||
<th>图标</th>
|
||
|
||
<th>名称</th>
|
||
|
||
<th>标识</th>
|
||
|
||
<th>介绍</th>
|
||
|
||
<th>作者</th>
|
||
|
||
<th>版本</th>
|
||
|
||
<th>状态</th>
|
||
|
||
<th>操作</th>
|
||
|
||
</tr>
|
||
|
||
</thead>
|
||
|
||
<tbody>
|
||
|
||
<?php if(sizeof($list)): foreach($list as $item): ?>
|
||
|
||
<tr>
|
||
|
||
<td class="am-text-middle">
|
||
|
||
<a href="https://www.hemaphp.com/<?php echo isset($item['addon'])?'index/addon/detail?id=' . $item['addon']['addon_id']:''; ?>" target="_blank">
|
||
|
||
<img src="<?php echo htmlentities((isset($item['addon']['logo']['url']) && ($item['addon']['logo']['url'] !== '')?$item['addon']['logo']['url']:'/assets/img/no_pic.jpg')); ?>" width="75" height="50" />
|
||
|
||
</a>
|
||
|
||
</td>
|
||
|
||
<td class="am-text-middle"><?php echo htmlentities($item['title']); ?></td>
|
||
|
||
<td class="am-text-middle"><?php echo htmlentities($item['name']); ?></td>
|
||
|
||
<td class="am-text-middle">
|
||
|
||
<p class="item-title"><?php echo htmlentities($item['description']); ?></p>
|
||
|
||
</td>
|
||
|
||
<td class="am-text-middle"><?php echo htmlentities($item['author']); ?></td>
|
||
|
||
<td class="am-text-middle">V<?php echo htmlentities($item['version']); ?></td>
|
||
|
||
<td class="am-text-middle">
|
||
|
||
<?php if(isset($item['status'])): ?>
|
||
|
||
<span class="item-status am-badge x-cur-p <?php echo !empty($item['status']) ? ' am-badge-success' : ' am-badge-warning'; ?>"
|
||
|
||
data-status="<?php echo htmlentities($item['status']); ?>"
|
||
|
||
data-name="<?php echo htmlentities($item['name']); ?>">
|
||
|
||
<?php echo $item['status']==1 ? '启用' : '禁用'; ?>
|
||
|
||
</span>
|
||
|
||
<?php endif; ?>
|
||
|
||
</td>
|
||
|
||
<td class="am-text-middle">
|
||
|
||
<div class="tpl-table-black-operation">
|
||
|
||
<?php if(isset($item['config']) AND $item['config'] == 1): ?>
|
||
|
||
<a class="item-config tpl-table-black-operation-default"
|
||
|
||
href="javascript:void(0);"
|
||
|
||
data-name="<?php echo htmlentities($item['name']); ?>"
|
||
|
||
data-title="<?php echo htmlentities($item['title']); ?>">
|
||
|
||
<i class="am-icon-pencil"></i> 配置
|
||
|
||
</a>
|
||
|
||
<?php endif; ?>
|
||
|
||
<a class="item-uninstall tpl-table-black-operation-del"
|
||
|
||
href="javascript:void(0);"
|
||
|
||
data-name="<?php echo htmlentities($item['name']); ?>">
|
||
|
||
<i class="am-icon-trash"></i> 卸载
|
||
|
||
</a>
|
||
|
||
<?php if(isset($item['addon']) AND $item['addon']['version'][0]['version'] != $item['version']): ?>
|
||
|
||
<a class="item-upgrade tpl-table-black-operation-primary"
|
||
|
||
href="javascript:void(0);"
|
||
|
||
data-name="<?php echo htmlentities($item['name']); ?>">
|
||
|
||
<i class="am-icon-cloud-upload"></i> 升级
|
||
|
||
</a>
|
||
|
||
<?php endif; ?>
|
||
|
||
</div>
|
||
|
||
</td>
|
||
|
||
</tr>
|
||
|
||
<?php endforeach; else: ?>
|
||
|
||
<tr>
|
||
|
||
<td colspan="8" class="am-text-center">暂无记录</td>
|
||
|
||
</tr>
|
||
|
||
<?php endif; ?>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- 模板:插件配置 -->
|
||
<script id="tpl-config" type="text/template">
|
||
<div class="am-padding-xs am-padding-top-sm">
|
||
{{ each config }}
|
||
{{ if($value.type == 'text') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<input class="tpl-form-input" name="data[{{ $value.name }}]" type="{{ $value.type }}" placeholder="{{ $value.attribute.placeholder }}" value="{{ $value.value }}" maxlength="{{ $value.attribute.maxlength }}" {{ $value.attribute.required ? 'required' : '' }} {{ $value.attribute.disabled ? 'disabled' : '' }}>
|
||
{{ if($value.msg.length > 0) }}
|
||
<small>{{ $value.msg }}</small>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ if($value.type == 'number') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<input class="tpl-form-input" name="data[{{ $value.name }}]" type="{{ $value.type }}" placeholder="{{ $value.attribute.placeholder }}" value="{{ $value.value }}" max="{{ $value.attribute.max }}" min="{{ $value.attribute.min }}" maxlength="{{ $value.attribute.maxlength }}" {{ $value.attribute.required ? 'required' : '' }} {{ $value.attribute.disabled ? 'disabled' : '' }}>
|
||
{{ if($value.msg.length > 0) }}
|
||
<small>{{ $value.msg }}</small>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ if($value.type == 'password') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<input class="tpl-form-input" name="data[{{ $value.name }}]" type="{{ $value.type }}" placeholder="{{ $value.attribute.placeholder }}" value="{{ $value.value }}" maxlength="{{ $value.attribute.maxlength }}" {{ $value.attribute.required ? 'required' : '' }} {{ $value.attribute.disabled ? 'disabled' : '' }}>
|
||
{{ if($value.msg.length > 0) }}
|
||
<small>{{ $value.msg }}</small>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ if($value.type == 'radio') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
{{ each $value.options vo key }}
|
||
<label class="am-radio-inline">
|
||
<input type="radio" name="data[{{ $value.name }}]"
|
||
value="{{ key }}" {{ $value.attribute.required ? 'required' : '' }}
|
||
{{ $value.value == key ? 'checked' : '' }}
|
||
{{ $value.attribute.disabled ? 'disabled' : '' }} data-am-ucheck> {{ vo }}
|
||
</label>
|
||
{{ /each }}
|
||
{{ if($value.msg.length > 0) }}
|
||
<div class="help-block am-margin-top-sm">
|
||
<small>{{ $value.msg }}</small>
|
||
</div>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ if($value.type == 'checkbox') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
{{ each $value.options vo key }}
|
||
<label class="am-checkbox-inline">
|
||
<input type="checkbox" name="data[{{ $value.name }}][]"
|
||
value="{{ key }}" {{ $value.attribute.required ? 'required' : '' }}
|
||
{{ $value.value.indexOf(key) > -1 ? 'checked' : '' }}
|
||
{{ $value.attribute.disabled ? 'disabled' : '' }} data-am-ucheck> {{ vo }}
|
||
</label>
|
||
{{ /each }}
|
||
{{ if($value.msg.length > 0) }}
|
||
<div class="help-block am-margin-top-sm">
|
||
<small>{{ $value.msg }}</small>
|
||
</div>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ if($value.type == 'select') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<select name="data[{{ $value.name }}]" {{ $value.attribute.required ? 'required' : '' }}
|
||
{{ $value.attribute.disabled ? 'disabled' : '' }}
|
||
data-am-selected="{searchBox: 1, btnSize: 'sm'}">
|
||
<option value="">请选择</option>
|
||
{{ each $value.options vo key }}
|
||
<option value="{{ key }}" {{ $value.value == key ? 'selected' : '' }}>{{ vo }}</option>
|
||
{{ /each }}
|
||
</select>
|
||
{{ if($value.msg.length > 0) }}
|
||
<small>{{ $value.msg }}</small>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ if($value.type == 'textarea') }}
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label {{ $value.attribute.required ? 'form-require' : '' }}">{{ $value.title }}</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<textarea type="text/plain" name="data[{{ $value.name }}]" placeholder="{{ $value.attribute.placeholder }}"
|
||
maxlength="{{ $value.attribute.maxlength }}" cols="{{ $value.attribute.cols }}" rows="{{ $value.attribute.rows }}"
|
||
{{ $value.attribute.required ? 'required' : '' }} {{ $value.attribute.disabled ? 'disabled' : '' }}
|
||
{{ $value.attribute.editor ? 'id="container"' : '' }}>{{ $value.value }}</textarea>
|
||
{{ if($value.msg.length > 0) }}
|
||
<small>{{ $value.msg }}</small>
|
||
{{ /if }}
|
||
</div>
|
||
</div>
|
||
{{ /if }}
|
||
{{ /each }}
|
||
</div>
|
||
</script>
|
||
|
||
<!-- 模板:登录 -->
|
||
<script id="tpl-login" type="text/template">
|
||
<div class="am-padding-xs am-padding-top-sm">
|
||
<div class="am-alert am-alert-warning" data-am-alert>
|
||
<button type="button" class="am-close">×</button>
|
||
<p><b>温馨提示</b></p>
|
||
<p>此处登录账号为<a href="https://www.hemaphp.com" target="_blank">hemaPHP官网账号</a></p>
|
||
</div>
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label form-require">账号:</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<input class="tpl-form-input" name="data[user_name]" type="text" placeholder="请输入账号" required>
|
||
<small>我还没有? <a href="https://www.hemaphp.com" target="_blank">去注册</a></small>
|
||
</div>
|
||
</div>
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-form-label form-require">密码:</label>
|
||
<div class="am-u-sm-8 am-u-end">
|
||
<input class="tpl-form-input" name="data[password]" type="password" placeholder="请输入密码" required>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</script>
|
||
<!-- 模板:登录 -->
|
||
<script id="tpl-user" type="text/template">
|
||
<div class="am-padding-xs am-padding-top-sm">
|
||
<div class="am-alert am-alert-success" data-am-alert>
|
||
<button type="button" class="am-close">×</button>
|
||
<p><b>温馨提示</b></p>
|
||
<p>你好!{{user.user_name}}</P>
|
||
<p>当前你已经登录,将同步保存你的购买记录</P>
|
||
</div>
|
||
</div>
|
||
<div style="padding:20px;">
|
||
<div class="am-padding-xs am-padding-top-sm">
|
||
<div class="am-alert am-alert-secondary">
|
||
<p style="color:#fa3534;">
|
||
<i class="am-icon-archive"></i>
|
||
<a style="color:#fa3534;" href="https://www.hemaphp.com/api/user/tokenLogin?token={{user.token}}" target="_blank">我购买的插件</a>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</script>
|
||
<script id="tpl-local" type="text/template">
|
||
<div class="am-padding-xs am-padding-top-sm">
|
||
<div class="am-form-group">
|
||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">安装包</label>
|
||
<div class="am-u-sm-9 am-u-end">
|
||
<input type="file" class="tpl-form-text" name="local_package" required>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</script>
|
||
<script>
|
||
|
||
$(function () {
|
||
|
||
var user = <?= json_encode($addonuser)?>;
|
||
//离线安装
|
||
$('.item-local').on('click', function () {
|
||
$.showAction({
|
||
title: '离线安装插件',
|
||
area: '450px',
|
||
content: template('tpl-local', {}),
|
||
uCheck: true,
|
||
success: function ($content) {
|
||
$('#my-form').formPost({
|
||
url: "<?php echo url('addon/local'); ?>"
|
||
});
|
||
},
|
||
btn2: function ($content) {
|
||
return true;
|
||
}
|
||
});
|
||
});
|
||
//插件配置
|
||
|
||
$('.item-config').on('click', function () {
|
||
|
||
var data = $(this).data();
|
||
|
||
$.get("<?php echo url('addon/config'); ?>?name=" + data.name, function (result) {
|
||
|
||
if(result.code == 0){
|
||
|
||
$.show_error(result.msg);
|
||
|
||
return false;
|
||
|
||
}
|
||
|
||
$.showAction({
|
||
|
||
title: '插件配置 《' + data.title + '》',
|
||
|
||
area: '750px',
|
||
|
||
content: template('tpl-config', {config:result.data}),
|
||
|
||
uCheck: true,
|
||
|
||
success: function ($content) {
|
||
|
||
$('#my-form').formPost({
|
||
|
||
url: "<?php echo url('addon/config'); ?>?name=" + data.name
|
||
|
||
});
|
||
|
||
},
|
||
|
||
btn2: function ($content) {
|
||
|
||
return true;
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
});
|
||
|
||
|
||
|
||
// 安装操作
|
||
|
||
$('.item-install').click(function () {
|
||
|
||
var data = $(this).data();
|
||
|
||
layer.confirm('您确定要安装该插件?', {
|
||
|
||
title: '友情提示',
|
||
|
||
icon: 0,
|
||
|
||
btn:['取消','确定'],
|
||
|
||
skin: 'layui-layer-hema',
|
||
|
||
cancel : function(){
|
||
|
||
// 你点击右上角 X 回调
|
||
|
||
},
|
||
|
||
btn1:function(index,layero){
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
btn2:function(index){
|
||
$("#addons-loading").html('<div class="am-modal-dialog"><div class="am-modal-hd">插件安装中,请等待...</div><div class="am-modal-bd"><span class="am-icon-spinner am-icon-spin"></span></div></div>');
|
||
$("#addons-loading").modal('open');
|
||
$.post("<?php echo url('addon/install'); ?>", data, function (result) {
|
||
$("#addons-loading").modal('close');
|
||
if(typeof(result) == 'string'){
|
||
result = JSON.parse(result);
|
||
}
|
||
if(result.code == 1){
|
||
$.show_success(result.msg, result.url);
|
||
|
||
}
|
||
|
||
if(result.code == 0){
|
||
|
||
$.show_error(result.msg);
|
||
|
||
}
|
||
|
||
if(result.code == -1){
|
||
|
||
userLogin();
|
||
|
||
}
|
||
|
||
if(result.code == -10){
|
||
|
||
layer.open({
|
||
|
||
type: 2,
|
||
|
||
title: '立即支付',
|
||
|
||
shadeClose: true,
|
||
|
||
shade: false,
|
||
|
||
maxmin: true, //开启最大化最小化按钮
|
||
|
||
area: ['450px', '620px'],
|
||
|
||
content: "<?php echo url('addon/pay'); ?>?addon_id=" + result.data.addon_id
|
||
|
||
});
|
||
|
||
}
|
||
|
||
});
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
end:function() {
|
||
|
||
//所有操作都会执行
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
|
||
|
||
//升级操作
|
||
|
||
$('.item-upgrade').click(function () {
|
||
|
||
var data = $(this).data();
|
||
|
||
layer.confirm('您确定要进行升级操作?', {
|
||
|
||
title: '友情提示',
|
||
|
||
icon: 0,
|
||
|
||
btn:['取消','确定'],
|
||
|
||
skin: 'layui-layer-hema',
|
||
|
||
cancel : function(){
|
||
|
||
// 你点击右上角 X 回调
|
||
|
||
},
|
||
|
||
btn1:function(index,layero){
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
btn2:function(index){
|
||
$("#addons-loading").html('<div class="am-modal-dialog"><div class="am-modal-hd">插件升级中,请等待...</div><div class="am-modal-bd"><span class="am-icon-spinner am-icon-spin"></span></div></div>');
|
||
$("#addons-loading").modal('open');
|
||
$.post("<?php echo url('addon/upgrade'); ?>", data, function (result) {
|
||
$("#addons-loading").modal('close');
|
||
if(typeof(result) == 'string'){
|
||
result = JSON.parse(result);
|
||
}
|
||
result.code === 1 ? $.show_success(result.msg, result.url) : $.show_error(result.msg);
|
||
|
||
});
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
end:function() {
|
||
|
||
//所有操作都会执行
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
|
||
|
||
// 卸载操作
|
||
|
||
$('.item-uninstall').click(function () {
|
||
|
||
var data = $(this).data();
|
||
|
||
layer.confirm('您确定要卸载该插件?卸载后将清楚与该插件相关的所有数据!', {
|
||
|
||
title: '友情提示',
|
||
|
||
icon: 0,
|
||
|
||
btn:['取消','确定'],
|
||
|
||
skin: 'layui-layer-hema',
|
||
|
||
cancel : function(){
|
||
|
||
// 你点击右上角 X 回调
|
||
|
||
},
|
||
|
||
btn1:function(index,layero){
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
btn2:function(index){
|
||
$("#addons-loading").html('<div class="am-modal-dialog"><div class="am-modal-hd">插件卸载中,请等待...</div><div class="am-modal-bd"><span class="am-icon-spinner am-icon-spin"></span></div></div>');
|
||
$("#addons-loading").modal('open');
|
||
$.post("<?php echo url('addon/uninstall'); ?>", data, function (result) {
|
||
$("#addons-loading").modal('close');
|
||
if(typeof(result) == 'string'){
|
||
result = JSON.parse(result);
|
||
}
|
||
result.code === 1 ? $.show_success(result.msg, result.url) : $.show_error(result.msg);
|
||
|
||
});
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
end:function() {
|
||
|
||
//所有操作都会执行
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
|
||
|
||
// 状态操作
|
||
|
||
$('.item-status').click(function () {
|
||
|
||
var data = $(this).data();
|
||
|
||
var msg = '禁用';
|
||
|
||
if(parseInt(data.status) === 0){
|
||
|
||
msg = '启用';
|
||
|
||
}
|
||
|
||
layer.confirm('您确定要' + msg + '该插件?', {
|
||
|
||
title: '友情提示',
|
||
|
||
icon: 0,
|
||
|
||
btn:['取消','确定'],
|
||
|
||
skin: 'layui-layer-hema',
|
||
|
||
cancel : function(){
|
||
|
||
// 你点击右上角 X 回调
|
||
|
||
},
|
||
|
||
btn1:function(index,layero){
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
btn2:function(index){
|
||
|
||
$.post("<?php echo url('addon/status'); ?>", data, function (result) {
|
||
if(typeof(result) == 'string'){
|
||
result = JSON.parse(result);
|
||
}
|
||
result.code === 1 ? $.show_success(result.msg, result.url) : $.show_error(result.msg);
|
||
|
||
});
|
||
|
||
layer.close(index);
|
||
|
||
},
|
||
|
||
end:function() {
|
||
|
||
//所有操作都会执行
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
// 检测是否登录
|
||
|
||
$('.hema-login').click(function () {
|
||
|
||
$.post("<?php echo url('addon/checkLogin'); ?>", {}, function (result) {
|
||
|
||
if(result.code === 1){
|
||
|
||
userDetail();
|
||
|
||
}else{
|
||
|
||
userLogin();
|
||
|
||
}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
function userDetail(){
|
||
|
||
$.showAction({
|
||
|
||
title: '会员信息',
|
||
|
||
area: '460px',
|
||
|
||
content: template('tpl-user', {user: user}),
|
||
|
||
btn: ['关闭', '退出'],
|
||
|
||
uCheck: true,
|
||
|
||
success: function ($content) {
|
||
|
||
$('#my-form').formPost({
|
||
|
||
url: "<?php echo url('addon/logout'); ?>"
|
||
|
||
});
|
||
|
||
},
|
||
|
||
btn2: function ($content) {
|
||
|
||
return true;
|
||
|
||
}
|
||
|
||
});
|
||
|
||
}
|
||
|
||
function userLogin(){
|
||
|
||
$.showAction({
|
||
|
||
title: '用户登录',
|
||
|
||
area: '460px',
|
||
|
||
content: template('tpl-login', {}),
|
||
|
||
btn: ['关闭', '登录'],
|
||
|
||
uCheck: true,
|
||
|
||
success: function ($content) {
|
||
|
||
$('#my-form').formPost({
|
||
|
||
url: "<?php echo url('addon/login'); ?>"
|
||
|
||
});
|
||
|
||
},
|
||
|
||
btn2: function ($content) {
|
||
|
||
return true;
|
||
|
||
}
|
||
|
||
});
|
||
|
||
}
|
||
|
||
});
|
||
|
||
</script>
|
||
|
||
|
||
|
||
</div>
|
||
<!-- 内容区域 end -->
|
||
<div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="addons-loading"></div>
|
||
</div>
|
||
<script src="/assets/plugins/vue/vue.min.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/plugins/layer/layer.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/plugins/jquery/jquery.form.min.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/plugins/amazeui/amazeui.min.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/js/hema.app.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/js/webuploader.html5only.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/assets/js/art-template.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script src="/addons/upload/js/file.library.js?v=<?php echo htmlentities($version); ?>"></script>
|
||
<script>
|
||
$(function() {
|
||
// 状态操作
|
||
$('.hemaphp-upgrade').click(function () {
|
||
var is_new = '<?php echo htmlentities($is_new); ?>';
|
||
if(is_new){
|
||
layer.confirm('您确定要进行升级?', {
|
||
title: '友情提示',
|
||
icon: 0,
|
||
btn:['取消','确定'],
|
||
skin: 'layui-layer-hema',
|
||
cancel : function(){
|
||
// 你点击右上角 X 回调
|
||
},
|
||
btn1:function(index,layero){
|
||
layer.close(index);
|
||
},
|
||
btn2:function(index){
|
||
$("#addons-loading").html('<div class="am-modal-dialog"><div class="am-modal-hd">系统升级中,请等待...</div><div class="am-modal-bd"><span class="am-icon-spinner am-icon-spin"></span></div></div>');
|
||
$("#addons-loading").modal('open');
|
||
$.post('/admin/addon/hemaphpUpgrade', {}, function (result) {
|
||
$("#addons-loading").modal('close');
|
||
if(typeof(result) == 'string'){
|
||
result = JSON.parse(result);
|
||
}
|
||
result.code === 1 ? $.show_success(result.msg, result.url) : $.show_error(result.msg);
|
||
});
|
||
layer.close(index);
|
||
},
|
||
end:function() {
|
||
//所有操作都会执行
|
||
}
|
||
});
|
||
return true;
|
||
}
|
||
$.show_error('已是最新版本');
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|