初始化
This commit is contained in:
parent
2e8f8e8fd1
commit
8bb655f72b
1
.env
Normal file
1
.env
Normal file
@ -0,0 +1 @@
|
||||
APP_DEBUG = true
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai
[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = 数据库名
USERNAME = 数据库账号
PASSWORD = 数据库密码
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true
[LANG]
default_lang = zh-cn
|
||||
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# phpstorm project files
|
||||
.idea
|
||||
|
||||
# netbeans project files
|
||||
nbproject
|
||||
|
||||
# zend studio for eclipse project files
|
||||
.buildpath
|
||||
.project
|
||||
.settings
|
||||
|
||||
# windows thumbnail cache
|
||||
Thumbs.db
|
||||
|
||||
# composer vendor dir
|
||||
/vendor
|
||||
|
||||
# composer itself is not needed
|
||||
composer.phar
|
||||
|
||||
# Mac DS_Store Files
|
||||
.DS_Store
|
||||
|
||||
# phpunit itself is not needed
|
||||
phpunit.phar
|
||||
# local phpunit config
|
||||
/phpunit.xml
|
||||
|
||||
tests/_output/*
|
||||
tests/_support/_generated
|
||||
|
||||
#vagrant folder
|
||||
/.vagrant
|
||||
42
.travis.yml
Normal file
42
.travis.yml
Normal file
@ -0,0 +1,42 @@
|
||||
sudo: false
|
||||
|
||||
language: php
|
||||
|
||||
branches:
|
||||
only:
|
||||
- stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
before_install:
|
||||
- composer self-update
|
||||
|
||||
install:
|
||||
- composer install --no-dev --no-interaction --ignore-platform-reqs
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
|
||||
- composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
|
||||
- composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
|
||||
- zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
|
||||
|
||||
script:
|
||||
- php think unit
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
|
||||
file:
|
||||
- ThinkPHP_Core.zip
|
||||
- ThinkPHP_Full.zip
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
226
.txt
Normal file
226
.txt
Normal file
@ -0,0 +1,226 @@
|
||||
升级前请先备份项目目录及数据库!!!
|
||||
升级前请先备份项目目录及数据库!!!
|
||||
升级前请先备份项目目录及数据库!!!
|
||||
--------------------------------
|
||||
### hemaPHP框架V1.1.8 更新日志 ###
|
||||
升级:thinkPHP6.1.2最新版本
|
||||
升级:所有扩展依赖
|
||||
新增:支付宝版本管理接口集合
|
||||
新增:模板推送支持多平台
|
||||
新增:商家用户中心展示多平台开通状态
|
||||
新增:支付宝服务商代商家设置AES密钥
|
||||
新增:支付宝小程序授权绑定
|
||||
新增:支付宝小程序取消授权回调消息处理
|
||||
新增:支付宝第三方应用对接配置
|
||||
新增:H5端微信支付
|
||||
新增:门店H5二维码生成
|
||||
优化:微信订阅消息接口
|
||||
优化:插件服务扩展
|
||||
修复:本地无法搭建演示
|
||||
修复:超管入口非空报错
|
||||
修复:未开启扫码登录时,短信登录不可用
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### hemaPHP框架V1.1.7 更新日志 ###
|
||||
新增:插件配置项开关自动刷新
|
||||
新增:插件来源验证
|
||||
新增:插件加密包的解压
|
||||
优化:插件包的下载,安装,升级
|
||||
修复:特约商户进件企业营业执照时提示未加密参数
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### hemaPHP框架V1.1.6 更新日志 ###
|
||||
新增:特约商户号手动配置
|
||||
优化:关注公众号登录
|
||||
优化:自动安装部署模块
|
||||
优化:管理员登录验证
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### hemaPHP框架V1.1.5 更新日志 ###
|
||||
|
||||
新增:上传引擎对上传文件类型与大小的配置
|
||||
新增:升级提醒弹窗
|
||||
优化:小程序基础信息配置
|
||||
优化:公众号管理模块
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### hemaPHP框架V1.1.4 更新日志 ###
|
||||
|
||||
新增:智能获取可添加设备列表
|
||||
优化:交易记录
|
||||
优化:数组排序公共函数
|
||||
优化:获取用户隐私数据接口申请
|
||||
优化:PHP8.1兼容问题
|
||||
修复:修改小程序头像无法提交
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### hemaPHP框架V1.1.3 更新日志 ###
|
||||
|
||||
新增:自定义小程序模板可配置小程序头像
|
||||
优化:插件离线安装机制
|
||||
优化:微信支付特约商户与普通商户的兼容
|
||||
优化:代理中心
|
||||
优化:小程序头像设置
|
||||
修复:微信接口请求偶尔出现token过期情况
|
||||
修复:获取小程序关联分佣账户时报错
|
||||
修复:小程序提申被拒绝未返回截图报错
|
||||
修复:小程序注册上传图片报错
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.1.2 更新日志 ###
|
||||
|
||||
新增:自定义模板关联
|
||||
新增:小程序统一登录管理端未关联模板限制
|
||||
新增:自定义模板小程序配置
|
||||
优化:TP框架更新到TP6.1.0(最新版)
|
||||
优化:全面兼容PHP8.1
|
||||
修复:微信支付平台证书读取到期时间报错
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.1.1 更新日志 ###
|
||||
|
||||
新增:扫码关注公众号后登录与注册
|
||||
新增:手机验证码登录与注册
|
||||
新增:创建定制型小程序管理端
|
||||
新增:扫码充值回调到成功页面
|
||||
新增:百度统计
|
||||
新增:离线安装插件
|
||||
新增:插件状态获取函数get_addons_status()
|
||||
优化:腾讯云短信发送
|
||||
优化:站点联系方式管理
|
||||
优化:验证码显示样式简化为数字
|
||||
修复:非服务商小程序接口生成二维码报错
|
||||
修复:超级端公众号群发报错
|
||||
修复:升级弹窗遮罩不关闭
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.1.0 更新日志 ###
|
||||
|
||||
升级后:超级管理账号密码初始为 admin
|
||||
新增:插件安装、升级时页面等待提醒
|
||||
新增:非服务商版微信小程序接口类
|
||||
新增:独立全局验证
|
||||
优化:数据库结构
|
||||
优化:插件安装、升级流程
|
||||
优化:公共函数库
|
||||
优化:冗余模型文件
|
||||
修复:微信付款码支付
|
||||
修复:已知BUG
|
||||
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.0.9 更新日志 ###
|
||||
|
||||
新增:系统升级回调处理方法
|
||||
新增:非服务商版微信接口类
|
||||
新增:生成指定长度的验证码函数
|
||||
新增:手机短信发送扩展类模块
|
||||
新增:腾讯云短信发送插件
|
||||
新增:阿里云短信发送插件
|
||||
新增:七牛云短信发送插件
|
||||
优化:数据库结构
|
||||
修复:已知BUG
|
||||
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.0.8 更新日志 ###
|
||||
|
||||
新增:用户提审的小程序代码是否自动上线开关
|
||||
新增:小程序申请是否需要平台审核开关
|
||||
新增:支付申请是否需要平台审核开关
|
||||
新增:微信支付V3版本接口
|
||||
新增:微信支付特约商户进件接口
|
||||
新增:微信支付平台证书自动获取与更新
|
||||
新增:小程序未授权操作验证
|
||||
新增:公众号未授权操作验证
|
||||
优化:超级管理端用户一键登录
|
||||
优化:代理分佣账号设置
|
||||
优化:平台分佣参数配置
|
||||
优化:token获取条件
|
||||
优化:小程序授权,限制重复授权
|
||||
优化:微信小程序代码发布管理
|
||||
修复:已知BUG
|
||||
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.0.7 更新日志 ###
|
||||
|
||||
新增:小程序审核加急接口
|
||||
新增:小程序版本信息查询接口
|
||||
新增:小程序服务状态查询接口
|
||||
新增:设置小程序服务状态接口
|
||||
新增:小程序版本回退接口
|
||||
新增:小程序地理位置接口管理
|
||||
新增:小程序普通二维码规则管理
|
||||
新增:普通二维码类库
|
||||
优化:微信小程序发布流程
|
||||
优化:公共函数
|
||||
优化:插件升级机制
|
||||
优化:基础数据库结构
|
||||
优化:小程序码生成函数
|
||||
修复:模板消息无法正常发送
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.0.6 更新日志 ###
|
||||
|
||||
新增:闪送底层依赖类
|
||||
优化:弹窗框架
|
||||
优化:二维码生成规则
|
||||
优化:距离计算默认为骑行模式
|
||||
优化:静态JS资源代码
|
||||
修复:小程序独立入口无法登录
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.0.5 更新日志 ###
|
||||
|
||||
优化:发布微信小程序参数打包
|
||||
修复:微信付款码支付报错
|
||||
修复:部分文件为引用框架js文件
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 河马SaaS框架V1.0.4 更新日志 ###
|
||||
|
||||
新增:模板市场上下架操作
|
||||
修复:微信支付审核结果提交失败
|
||||
修复:文本编辑器内无法上传图片
|
||||
修复:优化部分错误提醒不显示
|
||||
修复:升级后无法加载最新静态资源
|
||||
修复:小程序发布与升级操作界面乱码
|
||||
修复:商品详情中无法上传图片
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
|
||||
### V1.0.3 更新日志 ###
|
||||
|
||||
新增:公众号草稿管理
|
||||
新增:取消授权清除过期数据
|
||||
新增:代理模块弹窗模式
|
||||
新增:公众号草稿素材管理接口
|
||||
修复:插件升级后仍显示待升级状态
|
||||
优化:代理模块界面UI
|
||||
优化:模板市场管理
|
||||
优化:公众号消息群发
|
||||
优化:公众号关键字回复
|
||||
|
||||
--------------------------------
|
||||
|
||||
### V1.0.2 更新日志 ###
|
||||
|
||||
新增:下载数据包类型识别
|
||||
新增:获取配送公司列表及配置参数
|
||||
修复:一处获取config配置报错
|
||||
优化:配送基类
|
||||
优化:后台UI样式
|
||||
优化:代理申请
|
||||
|
||||
--------------------------------
|
||||
|
||||
### V1.0.1 更新日志 ###
|
||||
|
||||
新增:模板是否支持多门店
|
||||
新增:用户内部员工属性
|
||||
新增:添加数据弹窗
|
||||
新增:编辑数据弹窗
|
||||
优化:操作后台界面
|
||||
修复:商户扫码充值无法生成二维码
|
||||
修复:删除代码推送记录报错
|
||||
|
||||
--------------------------------
|
||||
|
||||
1
addons/upload/.addonrc
Normal file
1
addons/upload/.addonrc
Normal file
@ -0,0 +1 @@
|
||||
{"files":["public\/addons\/upload\/js\/file.library.js","public\/addons\/upload\/css\/file.library.css"]}
|
||||
45
addons/upload/.database
Normal file
45
addons/upload/.database
Normal file
@ -0,0 +1,45 @@
|
||||
-- ----------------------------
|
||||
-- 图库表
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS `__PREFIX__upload_file` (
|
||||
`file_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '文件id',
|
||||
`storage` varchar(20) NOT NULL DEFAULT '' COMMENT '存储方式',
|
||||
`group_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '文件分组id',
|
||||
`domain` varchar(255) NOT NULL DEFAULT '' COMMENT '存储域名',
|
||||
`file_path` varchar(255) NOT NULL DEFAULT '' COMMENT '文件路径',
|
||||
`file_size` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '文件大小(字节)',
|
||||
`file_type` varchar(20) NOT NULL DEFAULT '' COMMENT '文件类型',
|
||||
`file_ext` varchar(20) NOT NULL DEFAULT '' COMMENT '文件扩展名',
|
||||
`is_delete` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '软删除',
|
||||
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
|
||||
`shop_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
|
||||
`applet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
|
||||
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`file_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='图库表';
|
||||
|
||||
-- ----------------------------
|
||||
-- 图库分组表
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS `__PREFIX__upload_group` (
|
||||
`group_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类id',
|
||||
`group_type` varchar(10) NOT NULL DEFAULT '' COMMENT '文件类型',
|
||||
`group_name` varchar(30) NOT NULL DEFAULT '' COMMENT '分类名称',
|
||||
`sort` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类排序(数字越小越靠前)',
|
||||
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
|
||||
`shop_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
|
||||
`applet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
|
||||
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`group_id`),
|
||||
KEY `type_index` (`group_type`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='图库分组表';
|
||||
|
||||
--
|
||||
-- 1.0.6升级
|
||||
--
|
||||
ALTER TABLE `__PREFIX__upload_file` ADD COLUMN `shop_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店id' AFTER `is_delete`;
|
||||
ALTER TABLE `__PREFIX__upload_file` ADD COLUMN `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id' AFTER `is_delete`;
|
||||
ALTER TABLE `__PREFIX__upload_group` ADD COLUMN `shop_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店id' AFTER `sort`;
|
||||
ALTER TABLE `__PREFIX__upload_group` ADD COLUMN `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id' AFTER `sort`;
|
||||
|
||||
67
addons/upload/Plugin.php
Normal file
67
addons/upload/Plugin.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
namespace addons\upload;
|
||||
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* 文件库插件
|
||||
*/
|
||||
class Plugin extends Addons
|
||||
{
|
||||
// 该插件的基础信息
|
||||
public $info = [
|
||||
'name' => 'upload', // 插件标识
|
||||
'title' => '图库管理', // 插件名称
|
||||
'description' => '图片文件上传与管理', // 插件简介
|
||||
'status' => 1, // 状态
|
||||
'author' => 'hemaPHP',
|
||||
'version' => '1.0.8'
|
||||
];
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
$this->error = '底层功能插件,不允许删除';
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件升级方法
|
||||
* @return bool
|
||||
*/
|
||||
public function upgrade()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件启用方法
|
||||
* @return bool
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件禁用方法
|
||||
* @return bool
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
1
addons/upload/config.php
Normal file
1
addons/upload/config.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
return [
[
'name' => 'storage',
'title' => '默认存储:',
'type' => 'radio',
'attribute' => [
'required' => true,
'disabled' => false,
],
'options' => [
'local' => '本地',
'qcloud' => '腾讯云',
'aliyun' => '阿里云',
'qiniu' => '七牛云'
],
'msg' => '',
'value' => 'local'
],
[
'name' => 'file_ext',//参数名称
'title' => '文件类型:', //显示标题
'type' => 'text', //表单元素类型 - 文本框
//属性
'attribute' => [
'placeholder' => '请输入允许上传图片的类型',
'maxlength' => '',//可输入最大长度
'required' => false,//是否必填
'disabled' => false,//是否禁用
],
'msg' => '本地存储有效。建议填写:jpg,jpeg,png,bmp,gif,多个以英文状态逗号隔开',//提示内容
'value' => 'jpg,jpeg,png,bmp,gif',//初始值
],
[
'name' => 'file_size',//参数名称
'title' => '上传大小:', //显示标题
'type' => 'text', //表单元素类型 - 文本框
//属性
'attribute' => [
'placeholder' => '',
'maxlength' => '',//可输入最大长度
'required' => false,//是否必填
'disabled' => false,//是否禁用
],
'msg' => '本地存储有效。建议填写:2,允许上传最大文件,单位M',//提示内容
'value' => '2',//初始值
]
];
|
||||
1
addons/upload/controller/Library.php
Normal file
1
addons/upload/controller/Library.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace addons\upload\controller;
use think\addons\Controller;
use addons\upload\model\UploadFile as UploadFileModel;
use addons\upload\model\UploadGroup as UploadGroupModel;
class Library extends Controller
{
/**
* 文件库列表
*/
public function fileList()
{
$applet_id = $this->request->param('applet_id',0);
$shop_id = $this->request->param('shop_id',0);
$user_id = $this->request->param('user_id',0);
$type = $this->request->param('type','image');
$group_id = $this->request->param('group_id',0);
// 分组列表
$group_list = (new UploadGroupModel)->getList($applet_id,$shop_id,$user_id,$type);
// 文件列表
$file_list = (new UploadFileModel)->getlist($applet_id,$shop_id,$user_id,intval($group_id), $type);
return $this->renderSuccess('success', '', compact('group_list', 'file_list'));
}
/**
* 新增分组
*/
public function addGroup()
{
$applet_id = $this->request->param('applet_id',0);
$shop_id = $this->request->param('shop_id',0);
$user_id = $this->request->param('user_id',0);
$group_type = $this->request->param('group_type','image');
$group_name = $this->request->param('group_name','');
$model = new UploadGroupModel;
if ($model->add(compact('applet_id','shop_id','user_id', 'group_name', 'group_type'))) {
$group_id = $model->group_id;
return $this->renderSuccess('添加成功', '', compact('group_id', 'group_name'));
}
$error = $model->getError() ?: '添加失败';
return $this->renderError($error);
}
/**
* 编辑分组
*/
public function editGroup()
{
$group_id = $this->request->param('group_id',0);
$group_name = $this->request->param('group_name','');
$model = UploadGroupModel::get($group_id);
if ($model->edit(compact('group_name'))) {
return $this->renderSuccess('修改成功');
}
$error = $model->getError() ?: '修改失败';
return $this->renderError($error);
}
/**
* 删除分组
*/
public function deleteGroup()
{
$applet_id = $this->request->param('applet_id',0);
$shop_id = $this->request->param('shop_id',0);
$user_id = $this->request->param('user_id',0);
$group_id = $this->request->param('group_id',0);
$model = UploadGroupModel::get($group_id);
if ($model->remove($applet_id,$shop_id,$user_id)) {
return $this->renderSuccess('删除成功');
}
$error = $model->getError() ?: '删除失败';
return $this->renderError($error);
}
/**
* 批量删除文件
*/
public function deleteFiles()
{
$fileIds = $this->request->param('fileIds',[]);
$model = new UploadFileModel;
if ($model->softDelete($fileIds)) {
return $this->renderSuccess('删除成功');
}
$error = $model->getError() ?: '删除失败';
return $this->renderError($error);
}
/**
* 批量移动文件分组
*/
public function moveFiles()
{
$group_id = $this->request->param('group_id',0);
$fileIds = $this->request->param('fileIds',[]);
$model = new UploadFileModel;
if ($model->moveGroup($group_id, $fileIds) !== false) {
return $this->renderSuccess('移动成功');
}
$error = $model->getError() ?: '移动失败';
return $this->renderError($error);
}
}
|
||||
1
addons/upload/controller/Upload.php
Normal file
1
addons/upload/controller/Upload.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace addons\upload\controller;
use think\addons\Controller;
use addons\upload\model\UploadFile as UploadFileModel;
use hema\storage\Driver as StorageDriver;
/**
* 文件库管理
*/
class Upload extends Controller
{
/**
* 图片上传接口
*/
public function image()
{
$applet_id = $this->request->param('applet_id',0);
$shop_id = $this->request->param('shop_id',0);
$user_id = $this->request->param('user_id',0);
$groupId = $this->request->param('groupId',0);
$config = get_addons_config('upload');
// 实例化存储驱动
$storage = new StorageDriver($config['storage']);
// 设置上传文件的信息
$storage->setUploadFile('iFile')->setValidationScene('image');
// 执行文件上传
if (!$fileInfo = $storage->upload()) {
return $this->renderError('图片上传失败:' . $storage->getError());
}
// 文件信息
//$fileInfo = $storage->getSaveFileInfo();
$fileInfo['group_id'] = $groupId;
$fileInfo['file_type'] = 'image';
$fileInfo['applet_id'] = $applet_id;
$fileInfo['shop_id'] = $shop_id;
$fileInfo['user_id'] = $user_id;
// 添加文件库记录
$model = new UploadFileModel;
if($model->add($fileInfo)){
$uploadFile = UploadFileModel::get($model->file_id);
// 图片上传成功
die(json_encode(['code' => 1, 'msg' => '上传成功', 'data' => $uploadFile]));
}
die(json_encode(['code' => 0, 'msg' => '上传失败', 'data' => []]));
}
}
|
||||
1
addons/upload/local.ini
Normal file
1
addons/upload/local.ini
Normal file
@ -0,0 +1 @@
|
||||
name='upload'
|
||||
112
addons/upload/model/UploadFile.php
Normal file
112
addons/upload/model/UploadFile.php
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
namespace addons\upload\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 文件库模型
|
||||
*/
|
||||
class UploadFile extends Model
|
||||
{
|
||||
// 定义表名
|
||||
protected $name = 'upload_file';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 定义主键
|
||||
protected $pk = 'file_id';
|
||||
|
||||
// 追加的字段
|
||||
protected $append = ['url'];
|
||||
|
||||
/**
|
||||
* 获取图片完整路径
|
||||
*/
|
||||
public function getUrlAttr($value, $data)
|
||||
{
|
||||
// 存储方式本地:拼接当前域名
|
||||
if ($data['storage'] === 'local') {
|
||||
$data['domain'] = uploads_url();
|
||||
}
|
||||
return "{$data['domain']}/{$data['file_path']}";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件名查询文件id
|
||||
*/
|
||||
public static function getFildIdByName(string $file_path)
|
||||
{
|
||||
return (new static)->where(['file_path' => $file_path])->value('file_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件id
|
||||
*/
|
||||
public static function getFileName($fileId)
|
||||
{
|
||||
return (new static)->where(['file_id' => $fileId])->value('file_path');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表记录
|
||||
*/
|
||||
public function getList($applet_id=0,$shop_id = 0,$user_id = 0,$group_id = 0, string $file_type = 'image')
|
||||
{
|
||||
$filter = [
|
||||
'file_type' => $file_type,
|
||||
'is_delete' => 0,
|
||||
'applet_id' => $applet_id,
|
||||
'user_id' => $user_id,
|
||||
'shop_id' => $shop_id
|
||||
];
|
||||
$group_id > 0 && $filter['group_id'] = $group_id;//已分组条件
|
||||
$group_id < 0 && $filter['group_id'] = 0; //未分组条件
|
||||
return $this->where($filter)->order(['file_id' => 'desc'])->paginate(32);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文件详情
|
||||
*/
|
||||
public static function get($fileId)
|
||||
{
|
||||
return self::where('file_id',$fileId)->find();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加新记录
|
||||
*/
|
||||
public function add(array $data)
|
||||
{
|
||||
return $this->save($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量软删除
|
||||
*/
|
||||
public function softDelete(array $fileIds)
|
||||
{
|
||||
return $this->where('file_id','in',$fileIds)->update(['is_delete' => 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量移动文件分组
|
||||
*/
|
||||
public function moveGroup($group_id, array $fileIds)
|
||||
{
|
||||
return $this->where('file_id','in',$fileIds)->update(compact('group_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function remove($imageId)
|
||||
{
|
||||
$list = $this->where('file_id','in',$imageId)->select();
|
||||
foreach ($list as $vo){
|
||||
@unlink('./uploads/' . $vo['file_path']);
|
||||
}
|
||||
return $this->where('file_id','in',$imageId)->delete();
|
||||
}
|
||||
|
||||
}
|
||||
73
addons/upload/model/UploadGroup.php
Normal file
73
addons/upload/model/UploadGroup.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace addons\upload\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 文件库分组模型
|
||||
*/
|
||||
class UploadGroup extends Model
|
||||
{
|
||||
// 定义表名
|
||||
protected $name = 'upload_group';
|
||||
|
||||
// 定义主键
|
||||
protected $pk = 'group_id';
|
||||
|
||||
/**
|
||||
* 分组详情
|
||||
*/
|
||||
public static function get($group_id)
|
||||
{
|
||||
return self::where('group_id',$group_id)->find();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表记录
|
||||
*/
|
||||
public function getList($applet_id = 0,$shop_id = 0,$user_id = 0, string $group_type = 'image')
|
||||
{
|
||||
$filter = [
|
||||
'group_type' => $group_type,
|
||||
'applet_id' => $applet_id,
|
||||
'user_id' => $user_id,
|
||||
'shop_id' => $shop_id
|
||||
];
|
||||
return $this->where($filter)->order(['sort' => 'asc'])->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加新记录
|
||||
*/
|
||||
public function add(array $data)
|
||||
{
|
||||
$data['sort'] = 100;
|
||||
return $this->save($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新记录
|
||||
*/
|
||||
public function edit(array $data)
|
||||
{
|
||||
return $this->save($data) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*/
|
||||
public function remove($applet_id = 0,$shop_id = 0,$user_id = 0)
|
||||
{
|
||||
$filter = [
|
||||
'applet_id' => $applet_id,
|
||||
'user_id' => $user_id,
|
||||
'shop_id' => $shop_id,
|
||||
'group_id' => $this->group_id
|
||||
];
|
||||
// 更新该分组下的所有文件
|
||||
$model = new UploadFile;
|
||||
$model->where($filter)->update(['group_id' => 0]);
|
||||
return $this->delete();
|
||||
}
|
||||
|
||||
}
|
||||
123
addons/upload/view/template/file_library.html
Normal file
123
addons/upload/view/template/file_library.html
Normal file
@ -0,0 +1,123 @@
|
||||
<!-- 文件库模板 -->
|
||||
<script id="tpl-file-library" type="text/template">
|
||||
<div class="row">
|
||||
<div class="file-group">
|
||||
<ul class="nav-new">
|
||||
<li class="ng-scope {{ is_default ? 'active' : '' }}" data-group-id="0">
|
||||
<a class="group-name am-text-truncate" href="javascript:void(0);" title="全部">全部</a>
|
||||
</li>
|
||||
<li class="ng-scope" data-group-id="-1">
|
||||
<a class="group-name am-text-truncate" href="javascript:void(0);" title="未分组">未分组</a>
|
||||
</li>
|
||||
{{ each group_list }}
|
||||
<li class="ng-scope"
|
||||
data-group-id="{{ $value.group_id }}" title="{{ $value.group_name }}">
|
||||
<a class="group-edit" href="javascript:void(0);" title="编辑分组">
|
||||
<i class="iconfont iconbianji"></i>
|
||||
</a>
|
||||
<a class="group-name am-text-truncate" href="javascript:void(0);">
|
||||
{{ $value.group_name }}
|
||||
</a>
|
||||
<a class="group-delete" href="javascript:void(0);" title="删除分组">
|
||||
<i class="iconfont iconshanchu"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ /each }}
|
||||
</ul>
|
||||
<a class="group-add" href="javascript:void(0);">新增分组</a>
|
||||
</div>
|
||||
<div class="file-list">
|
||||
<div class="v-box-header am-cf">
|
||||
<div class="h-left am-fl am-cf">
|
||||
<div class="am-fl">
|
||||
<div class="group-select am-dropdown">
|
||||
<button type="button" class="am-btn am-btn-sm am-btn-secondary am-dropdown-toggle">
|
||||
移动至 <span class="am-icon-caret-down"></span>
|
||||
</button>
|
||||
<ul class="group-list am-dropdown-content">
|
||||
<li class="am-dropdown-header">请选择分组</li>
|
||||
{{ each group_list }}
|
||||
<li>
|
||||
<a class="move-file-group" data-group-id="{{ $value.group_id }}"
|
||||
href="javascript:void(0);">{{ $value.group_name }}</a>
|
||||
</li>
|
||||
{{ /each }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-fl file-library-operation">
|
||||
<a href="javascript:void(0);" class="file-delete tpl-table-black-operation-del"
|
||||
data-group-id="2">
|
||||
<i class="am-icon-trash"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-rigth am-fr">
|
||||
<div class="j-upload upload-image">
|
||||
<i class="iconfont icontianjia"></i>
|
||||
上传图片
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="file-list-body" class="v-box-body">
|
||||
{{ include 'tpl-file-list' file_list }}
|
||||
</div>
|
||||
<div class="v-box-footer am-cf"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
||||
<!-- 文件列表模板 -->
|
||||
<script id="tpl-file-list" type="text/template">
|
||||
<ul class="file-list-item">
|
||||
{{ include 'tpl-file-list-item' data }}
|
||||
</ul>
|
||||
{{ if last_page > 1 }}
|
||||
<div class="file-page-box am-fr">
|
||||
<ul class="pagination">
|
||||
{{ if current_page > 1 }}
|
||||
<li>
|
||||
<a class="switch-page" href="javascript:void(0);" title="上一页" data-page="{{ current_page - 1 }}">«</a>
|
||||
</li>
|
||||
{{ /if }}
|
||||
{{ if current_page < last_page }}
|
||||
<li>
|
||||
<a class="switch-page" href="javascript:void(0);" title="下一页" data-page="{{ current_page + 1 }}">»</a>
|
||||
</li>
|
||||
{{ /if }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ /if }}
|
||||
</script>
|
||||
|
||||
<!-- 文件列表模板 -->
|
||||
<script id="tpl-file-list-item" type="text/template">
|
||||
{{ each $data }}
|
||||
<li class="ng-scope" title="{{ $value.file_name }}" data-file-id="{{ $value.file_id }}"
|
||||
data-url="{{ $value.url }}" data-file-path="{{ $value.file_path }}">
|
||||
<div class="img-cover"
|
||||
style="background-image: url('{{ $value.url }}')">
|
||||
</div>
|
||||
<p class="file-name am-text-center am-text-truncate">{{ $value.file_name }}</p>
|
||||
<div class="select-mask">
|
||||
<img src="/assets/img/chose.png">
|
||||
</div>
|
||||
</li>
|
||||
{{ /each }}
|
||||
</script>
|
||||
|
||||
<!-- 分组元素-->
|
||||
<script id="tpl-group-item" type="text/template">
|
||||
<li class="ng-scope" data-group-id="{{ group_id }}" title="{{ group_name }}">
|
||||
<a class="group-edit" href="javascript:void(0);" title="编辑分组">
|
||||
<i class="iconfont iconbianji"></i>
|
||||
</a>
|
||||
<a class="group-name am-text-truncate" href="javascript:void(0);">
|
||||
{{ group_name }}
|
||||
</a>
|
||||
<a class="group-delete" href="javascript:void(0);" title="删除分组">
|
||||
<i class="iconfont iconshanchu"></i>
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
12
addons/upload/view/template/tpl_file_item_id.html
Normal file
12
addons/upload/view/template/tpl_file_item_id.html
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
<script id="tpl-file-item" type="text/template">
|
||||
{{ each list }}
|
||||
<div class="file-item">
|
||||
<img src="{{ $value.url }}">
|
||||
<input type="hidden" name="{{ name }}" value="{{ $value.file_id }}">
|
||||
<i class="iconfont iconshanchu file-item-delete"></i>
|
||||
</div>
|
||||
{{ /each }}
|
||||
</script>
|
||||
|
||||
|
||||
11
addons/upload/view/template/tpl_file_item_path.html
Normal file
11
addons/upload/view/template/tpl_file_item_path.html
Normal file
@ -0,0 +1,11 @@
|
||||
<script id="tpl-file-item" type="text/template">
|
||||
{{ each list }}
|
||||
<div class="file-item">
|
||||
<a href="{{ $value.url }}" title="点击查看大图" target="_blank">
|
||||
<img src="{{ $value.url }}">
|
||||
</a>
|
||||
<input type="hidden" name="{{ name }}" value="{{ $value.file_path }}">
|
||||
<i class="iconfont iconshanchu file-item-delete"></i>
|
||||
</div>
|
||||
{{ /each }}
|
||||
</script>
|
||||
11
addons/upload/view/template/tpl_file_item_url.html
Normal file
11
addons/upload/view/template/tpl_file_item_url.html
Normal file
@ -0,0 +1,11 @@
|
||||
<script id="tpl-file-item" type="text/template">
|
||||
{{ each list }}
|
||||
<div class="file-item">
|
||||
<a href="{{ $value.url }}" title="点击查看大图" target="_blank">
|
||||
<img src="{{ $value.url }}">
|
||||
</a>
|
||||
<input type="hidden" name="{{ name }}" value="{{ $value.url }}">
|
||||
<i class="iconfont iconshanchu file-item-delete"></i>
|
||||
</div>
|
||||
{{ /each }}
|
||||
</script>
|
||||
39
addons/upload/更新日志.txt
Normal file
39
addons/upload/更新日志.txt
Normal file
@ -0,0 +1,39 @@
|
||||
### 图库管理 - 图片文件上传与管理 ###
|
||||
--------------------------------
|
||||
### 图库管理v1.0.8 更新日志 ###
|
||||
|
||||
新增:上传文件类型的配置
|
||||
新增:上传文件大小的配置
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 图库管理v1.0.7 更新日志 ###
|
||||
|
||||
修复:TP6.1对Filesystem不支持
|
||||
修复:已知BUG
|
||||
--------------------------------
|
||||
### 图库管理v1.0.6 更新日志 ###
|
||||
|
||||
优化:优化数据结构
|
||||
--------------------------------
|
||||
### 图库管理v1.0.5 更新日志 ###
|
||||
|
||||
修复:新建分组无法返回分组ID
|
||||
优化:弹窗操作样式
|
||||
--------------------------------
|
||||
### v1.0.4 更新日志 ###
|
||||
|
||||
修复:部分操作无效
|
||||
优化:弹窗界面样式
|
||||
--------------------------------
|
||||
### v1.0.3 更新日志 ###
|
||||
|
||||
优化:弹窗功能选项
|
||||
--------------------------------
|
||||
### v1.0.2 更新日志 ###
|
||||
|
||||
优化:插件文件结构
|
||||
--------------------------------
|
||||
### v1.0.1 更新日志 ###
|
||||
|
||||
新增:存储方式设置
|
||||
--------------------------------
|
||||
31
app/AppService.php
Normal file
31
app/AppService.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app;
|
||||
|
||||
use think\Service;
|
||||
use think\facade\Log;
|
||||
use think\facade\Request;
|
||||
|
||||
/**
|
||||
* 应用服务类
|
||||
*/
|
||||
class AppService extends Service
|
||||
{
|
||||
// 服务注册
|
||||
public function register()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 服务启动
|
||||
public function boot()
|
||||
{
|
||||
// // 记录访问日志
|
||||
// if (!is_debug()) {
|
||||
// Log::record('[ URL ] ' . print_r(Request::baseUrl(), true), 'begin');
|
||||
// Log::record('[ HEADER ] ' . print_r(Request::header(), true), 'begin');
|
||||
// Log::record('[ PARAM ] ' . print_r(Request::param(), true), 'begin');
|
||||
// }
|
||||
}
|
||||
}
|
||||
92
app/BaseController.php
Normal file
92
app/BaseController.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
use think\App;
|
||||
use think\exception\ValidateException;
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 控制器基础类
|
||||
*/
|
||||
abstract class BaseController
|
||||
{
|
||||
/**
|
||||
* Request实例
|
||||
* @var \think\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* 应用实例
|
||||
* @var \think\App
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* 是否批量验证
|
||||
* @var bool
|
||||
*/
|
||||
protected $batchValidate = false;
|
||||
|
||||
/**
|
||||
* 控制器中间件
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [];
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @access public
|
||||
* @param App $app 应用对象
|
||||
*/
|
||||
public function __construct(App $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->request = $this->app->request;
|
||||
|
||||
// 控制器初始化
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
protected function initialize()
|
||||
{}
|
||||
|
||||
/**
|
||||
* 验证数据
|
||||
* @access protected
|
||||
* @param array $data 数据
|
||||
* @param string|array $validate 验证器名或者验证规则数组
|
||||
* @param array $message 提示信息
|
||||
* @param bool $batch 是否批量验证
|
||||
* @return array|string|true
|
||||
* @throws ValidateException
|
||||
*/
|
||||
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
|
||||
{
|
||||
if (is_array($validate)) {
|
||||
$v = new Validate();
|
||||
$v->rule($validate);
|
||||
} else {
|
||||
if (strpos($validate, '.')) {
|
||||
// 支持场景
|
||||
[$validate, $scene] = explode('.', $validate);
|
||||
}
|
||||
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
|
||||
$v = new $class();
|
||||
if (!empty($scene)) {
|
||||
$v->scene($scene);
|
||||
}
|
||||
}
|
||||
|
||||
$v->message($message);
|
||||
|
||||
// 是否批量验证
|
||||
if ($batch || $this->batchValidate) {
|
||||
$v->batch(true);
|
||||
}
|
||||
|
||||
return $v->failException(true)->check($data);
|
||||
}
|
||||
|
||||
}
|
||||
58
app/ExceptionHandle.php
Normal file
58
app/ExceptionHandle.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\exception\Handle;
|
||||
use think\exception\HttpException;
|
||||
use think\exception\HttpResponseException;
|
||||
use think\exception\ValidateException;
|
||||
use think\Response;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 应用异常处理类
|
||||
*/
|
||||
class ExceptionHandle extends Handle
|
||||
{
|
||||
/**
|
||||
* 不需要记录信息(日志)的异常类列表
|
||||
* @var array
|
||||
*/
|
||||
protected $ignoreReport = [
|
||||
HttpException::class,
|
||||
HttpResponseException::class,
|
||||
ModelNotFoundException::class,
|
||||
DataNotFoundException::class,
|
||||
ValidateException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* 记录异常信息(包括日志或者其它方式记录)
|
||||
*
|
||||
* @access public
|
||||
* @param Throwable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Throwable $exception): void
|
||||
{
|
||||
// 使用内置的方式记录异常日志
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @access public
|
||||
* @param \think\Request $request
|
||||
* @param Throwable $e
|
||||
* @return Response
|
||||
*/
|
||||
public function render($request, Throwable $e): Response
|
||||
{
|
||||
// 添加自定义异常处理机制
|
||||
|
||||
// 其他错误交给系统处理
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
9
app/Request.php
Normal file
9
app/Request.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
// 应用请求对象类
|
||||
class Request extends \think\Request
|
||||
{
|
||||
// 全局过滤规则
|
||||
//protected $filter = ['my_trim', 'my_htmlspecialchars', 'filter_emoji'];
|
||||
}
|
||||
337
app/admin/config/menus.php
Normal file
337
app/admin/config/menus.php
Normal file
@ -0,0 +1,337 @@
|
||||
<?php
|
||||
return [
|
||||
'index' => [
|
||||
'name' => '首页',
|
||||
'icon' => 'iconshouye',
|
||||
'index' => 'index/index',
|
||||
],
|
||||
'addon' => [
|
||||
'name' => '插件管理',
|
||||
'icon' => 'iconyingyongzhongxin',
|
||||
'index' => 'addon/my',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '我的插件',
|
||||
'index' => 'addon/my'
|
||||
],
|
||||
[
|
||||
'name' => '插件市场',
|
||||
'active' => true,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '全部插件',
|
||||
'index' => 'addon/all'
|
||||
],
|
||||
[
|
||||
'name' => '行业模板',
|
||||
'index' => 'addon/template'
|
||||
],
|
||||
[
|
||||
'name' => '功能模块',
|
||||
'index' => 'addon/block'
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
'apply' => [
|
||||
'name' => '用户申请',
|
||||
'icon' => 'iconrenzheng',
|
||||
'index' => 'apply/applet',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '小程序申请',
|
||||
'index' => 'apply/applet'
|
||||
],
|
||||
[
|
||||
'name' => '支付申请',
|
||||
'index' => 'apply/pay'
|
||||
],
|
||||
[
|
||||
'name' => '平台入驻',
|
||||
'index' => 'apply/out'
|
||||
],
|
||||
[
|
||||
'name' => '代理认证',
|
||||
'index' => 'apply/agent'
|
||||
],
|
||||
[
|
||||
'name' => '实名认证',
|
||||
'index' => 'apply/auth'
|
||||
],
|
||||
]
|
||||
],
|
||||
'applet' => [
|
||||
'name' => '小程序',
|
||||
'icon' => 'iconweixinxiaochengxu',
|
||||
'color' => '#36b313',
|
||||
'index' => 'applet/all',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '小程序管理',
|
||||
'active' => false,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '全部',
|
||||
'index' => 'applet/all'
|
||||
],
|
||||
[
|
||||
'name' => '已授权',
|
||||
'index' => 'applet/normal'
|
||||
],
|
||||
[
|
||||
'name' => '已到期',
|
||||
'index' => 'applet/ends'
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '微信模板',
|
||||
'active' => false,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '草稿库',
|
||||
'index' => 'applet.wxtpl/index'
|
||||
],
|
||||
[
|
||||
'name' => '模板库',
|
||||
'index' => 'applet.wxtpl/lists'
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '推送模板',
|
||||
'index' => 'applet.code/index'
|
||||
],
|
||||
[
|
||||
'name' => '模板市场',
|
||||
'index' => 'applet.template/index'
|
||||
],
|
||||
],
|
||||
],
|
||||
'wechat' => [
|
||||
'name' => '公众号',
|
||||
'icon' => 'iconweixingongzhonghao',
|
||||
'color' => '#36b313',
|
||||
'index' => 'wechat/index',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '基础信息',
|
||||
'index' => 'wechat/index'
|
||||
],
|
||||
[
|
||||
'name' => '菜单设置',
|
||||
'index' => 'wechat/menus'
|
||||
],
|
||||
[
|
||||
'name' => '群发消息',
|
||||
'index' => 'wechat.send/index',
|
||||
'uris' => [
|
||||
'wechat.send/index',
|
||||
'wechat.send/add',
|
||||
'wechat.send/edit',
|
||||
'wechat.send/delete'
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => '素材管理',
|
||||
'active' => true,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '图文素材',
|
||||
'index' => 'wechat.material.text/index',
|
||||
'urls' => [
|
||||
'wechat.material.text/index',
|
||||
'wechat.material.text/add',
|
||||
'wechat.material.text/edit',
|
||||
'wechat.material.text/delete'
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '图片素材',
|
||||
'index' => 'wechat.material.image/index',
|
||||
'urls' => [
|
||||
'wechat.material.image/index',
|
||||
'wechat.material.image/add',
|
||||
'wechat.material.image/edit',
|
||||
'wechat.material.image/delete'
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '语音素材',
|
||||
'index' => 'wechat.material.voice/index',
|
||||
'urls' => [
|
||||
'wechat.material.voice/index',
|
||||
'wechat.material.voice/add',
|
||||
'wechat.material.voice/edit',
|
||||
'wechat.material.voice/delete'
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '视频素材',
|
||||
'index' => 'wechat.material.video/index',
|
||||
'urls' => [
|
||||
'wechat.material.video/index',
|
||||
'wechat.material.video/add',
|
||||
'wechat.material.video/edit',
|
||||
'wechat.material.video/delete'
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '智能回复',
|
||||
'active' => false,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '被关注回复',
|
||||
'index' => 'wechat/subscribe'
|
||||
],
|
||||
[
|
||||
'name' => '关键字回复',
|
||||
'index' => 'wechat.keyword/index',
|
||||
'uris' => [
|
||||
'wechat.keyword/index',
|
||||
'wechat.keyword/add',
|
||||
'wechat.keyword/edit',
|
||||
'wechat.keyword/delete',
|
||||
],
|
||||
],
|
||||
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
'pay' => [
|
||||
'name' => '支付设置',
|
||||
'icon' => 'iconcaiwuguanli',
|
||||
'color' => '#36b313',
|
||||
'index' => 'pay/webpay',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '站点支付',
|
||||
'active' => false,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '微信支付',
|
||||
'index' => 'pay/webpay'
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '支付服务商',
|
||||
'active' => false,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '微信支付',
|
||||
'index' => 'pay/wxpayisp'
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
'user' => [
|
||||
'name' => '用户管理',
|
||||
'icon' => 'iconyonghuguanli',
|
||||
'index' => 'user/store',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '商家用户',
|
||||
'index' => 'user/store'
|
||||
],
|
||||
[
|
||||
'name' => '代理用户',
|
||||
'index' => 'user/agent'
|
||||
],
|
||||
[
|
||||
'name' => '商家会员',
|
||||
'index' => 'user/user'
|
||||
],
|
||||
[
|
||||
'name' => '交易记录',
|
||||
'index' => 'user/pay'
|
||||
],
|
||||
]
|
||||
],
|
||||
'open' => [
|
||||
'name' => '开放平台',
|
||||
'icon' => 'iconkaifangpingtai',
|
||||
'index' => 'open/wxopen',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '微信平台',
|
||||
'active' => true,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '第三方应用',
|
||||
'index' => 'open/wxopen'
|
||||
],
|
||||
[
|
||||
'name' => '扫码登录',
|
||||
'index' => 'open/wxweb'
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '支付宝平台',
|
||||
'active' => true,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '第三方应用',
|
||||
'index' => 'open/alipayopen'
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
'setting' => [
|
||||
'name' => '设置',
|
||||
'icon' => 'iconshezhi',
|
||||
'index' => 'setting/web',
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '站点设置',
|
||||
'index' => 'setting/web'
|
||||
],
|
||||
|
||||
[
|
||||
'name' => '登录注册',
|
||||
'index' => 'setting/passport'
|
||||
],
|
||||
[
|
||||
'name' => '功能设置',
|
||||
'index' => 'setting/ability'
|
||||
],
|
||||
[
|
||||
'name' => '分佣设置',
|
||||
'index' => 'setting/divide'
|
||||
],
|
||||
[
|
||||
'name' => '消息提醒',
|
||||
'active' => false,
|
||||
'submenu' => [
|
||||
[
|
||||
'name' => '短信提醒',
|
||||
'index' => 'setting.message/sms'
|
||||
],
|
||||
[
|
||||
'name' => '公众号提醒',
|
||||
'index' => 'setting.message/webtplmsg',
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => '友情链接',
|
||||
'index' => 'setting.link/index'
|
||||
],
|
||||
[
|
||||
'name' => '清理缓存',
|
||||
'index' => 'setting.cache/clear'
|
||||
],
|
||||
[
|
||||
'name' => '环境监测',
|
||||
'index' => 'setting.science/index'
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
9
app/admin/config/view.php
Normal file
9
app/admin/config/view.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
'layout_on' => true, //布局模板开关
|
||||
'layout_name' => 'layout/layout', //布局模板入口文件''
|
||||
];
|
||||
1
app/admin/controller/Addon.php
Normal file
1
app/admin/controller/Addon.php
Normal file
File diff suppressed because one or more lines are too long
74
app/admin/controller/Applet.php
Normal file
74
app/admin/controller/Applet.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Applet as AppletModel;
|
||||
use think\facade\Cache;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 小程序管理控制器
|
||||
*/
|
||||
class Applet extends Controller
|
||||
{
|
||||
/**
|
||||
* 全部小程序列表
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return $this->lists(0,'全部');
|
||||
}
|
||||
|
||||
/**
|
||||
* 已授权列表
|
||||
*/
|
||||
public function normal()
|
||||
{
|
||||
return $this->lists(10,'已授权');
|
||||
}
|
||||
|
||||
/**
|
||||
* 已到期列表
|
||||
*/
|
||||
public function ends()
|
||||
{
|
||||
return $this->lists(20,'已到期');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
private function lists($type, string $title)
|
||||
{
|
||||
$model = new AppletModel;
|
||||
$list = $model->getList($type);
|
||||
return View::fetch('index', compact('list','title'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更到期时间
|
||||
*/
|
||||
public function renewal($id)
|
||||
{
|
||||
$model = AppletModel::getApplet(['applet_id' => $id]);
|
||||
if ($model->renewal($this->postData('data'))) {
|
||||
return $this->renderSuccess('操作成功');
|
||||
}
|
||||
$error = $model->getError() ?: '操作失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布小程序新模板
|
||||
*/
|
||||
public function upgrade($id)
|
||||
{
|
||||
//详情
|
||||
$model = AppletModel::getApplet(['applet_id' => $id]);
|
||||
if($model->publish()){
|
||||
return $this->renderSuccess('发布成功');
|
||||
}
|
||||
$error = $model->getError() ?: '发布失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
}
|
||||
100
app/admin/controller/Apply.php
Normal file
100
app/admin/controller/Apply.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Apply as ApplyModel;
|
||||
use app\admin\model\UserDetail as UserDetailModel;
|
||||
use think\facade\View;
|
||||
/**
|
||||
* 用户认证申请控制器
|
||||
*/
|
||||
class Apply extends Controller
|
||||
{
|
||||
/**
|
||||
* 小程序申请
|
||||
*/
|
||||
public function applet()
|
||||
{
|
||||
return $this->lists(10,'小程序申请');
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台入驻
|
||||
*/
|
||||
public function out()
|
||||
{
|
||||
return $this->lists(20,'平台入驻');
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付申请
|
||||
*/
|
||||
public function pay()
|
||||
{
|
||||
return $this->lists(30,'支付申请');
|
||||
}
|
||||
/**
|
||||
* 代理认证
|
||||
*/
|
||||
public function agent()
|
||||
{
|
||||
return $this->lists(40,'代理认证');
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
public function auth()
|
||||
{
|
||||
return $this->lists(50,'实名认证');
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户资料
|
||||
*/
|
||||
private function lists($apply_mode, string $title)
|
||||
{
|
||||
$model = new ApplyModel;
|
||||
$list = $model->getList($apply_mode);
|
||||
return View::fetch('index', compact('list','title'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
$model = ApplyModel::detail($id);
|
||||
if ($this->request->isGet()) {
|
||||
if($model){
|
||||
return $this->renderSuccess('', '', compact('model'));
|
||||
}
|
||||
return $this->renderError('获取失败');
|
||||
}
|
||||
$data = $this->postData('data');
|
||||
if($data['apply_status']==40 AND empty($data['reject'])){
|
||||
return $this->renderError('请输入驳回原因');
|
||||
}
|
||||
$url = [10 => 'applet',20 => 'out',30 => 'pay',40 => 'agent',50 => 'auth'];
|
||||
// 更新记录
|
||||
if ($model->action($data)) {
|
||||
return $this->renderSuccess('更新成功', (string)url('apply/'.$url[$model['apply_mode']['value']]));
|
||||
}
|
||||
$error = $model->getError() ?: '更新失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$model = ApplyModel::get($id);
|
||||
if ($model->remove()) {
|
||||
return $this->renderSuccess('删除成功');
|
||||
}
|
||||
$error = $model->getError() ?: '删除失败';
|
||||
return $this->renderError($error);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
194
app/admin/controller/Controller.php
Normal file
194
app/admin/controller/Controller.php
Normal file
@ -0,0 +1,194 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\facade\View;
|
||||
use think\facade\Session;
|
||||
use app\admin\model\Setting;
|
||||
use think\facade\Config;
|
||||
use hema\Addon;
|
||||
|
||||
/**
|
||||
* 管理后台控制器基类
|
||||
*/
|
||||
class Controller extends \app\BaseController
|
||||
{
|
||||
protected $user; // 用户登录信息
|
||||
protected $controller = ''; // 当前控制器名称
|
||||
protected $action = ''; // 当前方法名称
|
||||
protected $routeUri = ''; // 当前路由uri
|
||||
protected $group = ''; // 当前路由:分组名称
|
||||
|
||||
// 登录验证白名单
|
||||
protected $allowAllAction = [
|
||||
'passport/login',
|
||||
'passport/captcha'
|
||||
];
|
||||
|
||||
/**
|
||||
* 后台初始化
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
$this->getUserInfo();// 获取登录信息
|
||||
$this->getRouteInfo();// 当前路由信息
|
||||
$this->checkLogin();// 验证登录状态
|
||||
$this->layout();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录信息
|
||||
*/
|
||||
private function getUserInfo()
|
||||
{
|
||||
$this->user = Session::get('hema_admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析当前路由参数 (分组名称、控制器名称、方法名)
|
||||
*/
|
||||
protected function getRouteInfo()
|
||||
{
|
||||
// 控制器名称
|
||||
$this->controller = uncamelize($this->request->controller());
|
||||
// 方法名称
|
||||
$this->action = $this->request->action();
|
||||
// 控制器分组 (用于定义所属模块)
|
||||
$group = strstr($this->controller, '.', true);
|
||||
$this->group = $group !== false ? $group : $this->controller;
|
||||
// 当前uri
|
||||
$this->routeUri = "{$this->controller}/$this->action";
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证登录状态
|
||||
*/
|
||||
private function checkLogin()
|
||||
{
|
||||
// 验证当前请求是否在白名单
|
||||
if (in_array($this->routeUri, $this->allowAllAction)) {
|
||||
return true;
|
||||
}
|
||||
// 验证登录状态
|
||||
if (empty($this->user) || (int)$this->user['is_login'] !== 1) {
|
||||
return redirect((string)url('passport/login'))->send();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全局layout模板输出
|
||||
*/
|
||||
private function layout()
|
||||
{
|
||||
$addon = new Addon;
|
||||
$is_new = $addon->news();
|
||||
// 输出到view
|
||||
View::assign([
|
||||
'base_url' => base_url(), // 当前站点域名
|
||||
'web' => Setting::getItem('web',0), //站点设置
|
||||
'store_url' => '/admin/', // 后台模块url
|
||||
'group' => $this->group,
|
||||
'menus' => $this->menus(), // 后台菜单
|
||||
'user' => $this->user, // 登录信息
|
||||
'applet_id' => 0, // 小程序ID
|
||||
'version' => Config::get('app.hemaphp.version'),
|
||||
'is_new' => $is_new,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台菜单配置
|
||||
*/
|
||||
private function menus()
|
||||
{
|
||||
foreach ($data = Config('menus') as $group => $first) {
|
||||
$data[$group]['active'] = $group === $this->group;
|
||||
//$data[0]['active']
|
||||
// 遍历:二级菜单
|
||||
if (isset($first['submenu'])) {
|
||||
foreach ($first['submenu'] as $secondKey => $second) {
|
||||
// 二级菜单所有uri
|
||||
$secondUris = [];
|
||||
if (isset($second['submenu'])) {
|
||||
// 遍历:三级菜单
|
||||
foreach ($second['submenu'] as $thirdKey => $third) {
|
||||
$thirdUris = [];
|
||||
if (isset($third['uris'])) {
|
||||
$secondUris = array_merge($secondUris, $third['uris']);
|
||||
$thirdUris = array_merge($thirdUris, $third['uris']);
|
||||
} else {
|
||||
$secondUris[] = $third['index'];
|
||||
$thirdUris[] = $third['index'];
|
||||
}
|
||||
$data[$group]['submenu'][$secondKey]['submenu'][$thirdKey]['active'] = in_array($this->routeUri, $thirdUris);
|
||||
$data[$group]['submenu'][$secondKey]['active'] = in_array($this->routeUri, $secondUris);
|
||||
}
|
||||
} else {
|
||||
if (isset($second['uris']))
|
||||
$secondUris = array_merge($secondUris, $second['uris']);
|
||||
else
|
||||
$secondUris[] = $second['index'];
|
||||
}
|
||||
// 二级菜单:active
|
||||
!isset($data[$group]['submenu'][$secondKey]['active'])
|
||||
&& $data[$group]['submenu'][$secondKey]['active'] = in_array($this->routeUri, $secondUris);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回封装后的 API 数据到客户端
|
||||
*/
|
||||
protected function renderJson($code = 1, string $msg = '', string $url = '', array $data = [])
|
||||
{
|
||||
return json(compact('code', 'msg', 'url', 'data'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回操作成功json
|
||||
*/
|
||||
protected function renderSuccess(string $msg = 'success', string $url = '', array $data = [], $code = 1)
|
||||
{
|
||||
return $this->renderJson($code, $msg, $url, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回操作失败json
|
||||
*/
|
||||
protected function renderError(string $msg = 'error', string $url = '', array $data = [], $code = 0)
|
||||
{
|
||||
return $this->renderJson($code, $msg, $url, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取post数据 (数组)
|
||||
* @param $key
|
||||
* @return mixed
|
||||
*/
|
||||
protected function postData($key = null)
|
||||
{
|
||||
return $this->request->post(empty($key) ? '' : "{$key}/a");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取post数据 (数组)
|
||||
* @param $key
|
||||
* @return mixed
|
||||
*/
|
||||
protected function postForm($key = 'form')
|
||||
{
|
||||
return $this->postData($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取post数据 (数组)
|
||||
* @param $key
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getData($key = null)
|
||||
{
|
||||
return $this->request->get(is_null($key) ? '' : $key);
|
||||
}
|
||||
}
|
||||
1
app/admin/controller/Hemaphp.php
Normal file
1
app/admin/controller/Hemaphp.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace app\admin\controller;
use app\admin\model\Setting as SettingModel;
use think\facade\Cache;
/**
* 插件控制器
*/
class Hemaphp extends Controller
{
/**
* 安装方法
* @return bool
*/
public static function install()
{
return true;
}
/**
* 卸载方法
* @return bool
*/
public static function uninstall()
{
return true;
}
/**
* 升级方法
* @return bool
*/
public static function upgrade()
{
SettingModel::where('key','subscribe')->delete();
Cache::clear(); //清空缓存
return true;
}
}
|
||||
61
app/admin/controller/Index.php
Normal file
61
app/admin/controller/Index.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Applet as AppletModel;
|
||||
use app\admin\model\User as UserModel;
|
||||
use app\admin\model\Record as RecordModel;
|
||||
use app\admin\model\Wechat as WechatModel;
|
||||
use think\facade\View;
|
||||
use hema\wechat\Driver;
|
||||
use think\facade\Cache;
|
||||
|
||||
/**
|
||||
* 商户后台首页
|
||||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$count = array();
|
||||
$count['applet'] = AppletModel::getCount();
|
||||
$count['user'] = UserModel::getCount();
|
||||
$count['record'] = RecordModel::getCount();
|
||||
$count['wechat'] = WechatModel::count();
|
||||
return View::fetch('index', compact('count'));
|
||||
}
|
||||
|
||||
public function fans()
|
||||
{
|
||||
$wx = new Driver;
|
||||
if(!$data = Cache::get('fans_user')){
|
||||
$res = $wx->getFans(0);
|
||||
$data = $res['data']['openid'];
|
||||
Cache::set('fans_user',$data);
|
||||
}
|
||||
if(!$n = Cache::get('user_n')){
|
||||
$n = 0;
|
||||
}
|
||||
//查询是否存在
|
||||
if(!UserModel::getUser(['open_id' => $data[$n]])){
|
||||
//添加纪录
|
||||
$user = $wx->getWechatUserInfo($data[$n],0);
|
||||
$user['user_name'] = time();
|
||||
$user['password'] = hema_hash('123456');
|
||||
$user['is_subscribe'] = 1;
|
||||
$model = new UserModel;
|
||||
if($model->save($user)){
|
||||
$n = $n+1;
|
||||
Cache::set('user_n',$n);
|
||||
echo "----------- OK --------------".$n;
|
||||
}else{
|
||||
echo "********************";
|
||||
}
|
||||
}else{
|
||||
$n = $n+1;
|
||||
Cache::set('user_n',$n);
|
||||
echo "用户已存在".$n;
|
||||
}
|
||||
//return redirect(url('index/fans'));
|
||||
}
|
||||
}
|
||||
59
app/admin/controller/Open.php
Normal file
59
app/admin/controller/Open.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Setting as SettingModel;
|
||||
use think\facade\View;
|
||||
use think\facade\Cache;
|
||||
/**
|
||||
* 开放平台对接
|
||||
*/
|
||||
class Open extends Controller
|
||||
{
|
||||
/**
|
||||
* 微信开放平台第三方平台设置
|
||||
*/
|
||||
public function wxopen()
|
||||
{
|
||||
return $this->updateEvent('wxopen');
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信开放平台网站应用设置
|
||||
*/
|
||||
public function wxweb()
|
||||
{
|
||||
return $this->updateEvent('wxweb');
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付宝第三方平台设置
|
||||
*/
|
||||
public function alipayopen()
|
||||
{
|
||||
return $this->updateEvent('alipayopen');
|
||||
}
|
||||
/**
|
||||
* 更新设置事件
|
||||
*/
|
||||
private function updateEvent(string $key)
|
||||
{
|
||||
if (!$this->request->isAjax()) {
|
||||
$model = SettingModel::getItem($key);
|
||||
if($key == 'wxopen'){
|
||||
$status = ['失败','正常'];
|
||||
if(Cache::get('component_access_token')){
|
||||
$value = 1;
|
||||
}else{
|
||||
$value = 0;
|
||||
}
|
||||
$model['status'] = ['text' => $status[$value], 'value' => $value];
|
||||
}
|
||||
return View::fetch($key, compact('model'));
|
||||
}
|
||||
$model = new SettingModel;
|
||||
if ($model->edit($key,$this->postData('data'))) {
|
||||
return $this->renderSuccess('更新成功');
|
||||
}
|
||||
return $this->renderError('更新失败');
|
||||
}
|
||||
}
|
||||
71
app/admin/controller/Passport.php
Normal file
71
app/admin/controller/Passport.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\User as UserModel;
|
||||
use think\facade\View;
|
||||
use think\facade\Session;
|
||||
use think\captcha\facade\Captcha;
|
||||
|
||||
/**
|
||||
* 商家后台认证
|
||||
*/
|
||||
class Passport extends Controller
|
||||
{
|
||||
/**
|
||||
* 生成验证码
|
||||
**/
|
||||
public function captcha()
|
||||
{
|
||||
return Captcha::create();
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家用户登录
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
if (!$this->request->isAjax()) {
|
||||
// 验证登录状态
|
||||
if (isset($this->user) AND (int)$this->user['is_login'] === 1) {
|
||||
return redirect(url('index/index'));
|
||||
}
|
||||
View::layout(false);
|
||||
return View::fetch();
|
||||
}
|
||||
$model = new UserModel;
|
||||
if ($model->login($this->postData('data'))) {
|
||||
return $this->renderSuccess('登录成功', url('index/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '登录失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新密码
|
||||
*/
|
||||
public function renew()
|
||||
{
|
||||
$model = (new UserModel)->where([
|
||||
'status' => 10,
|
||||
'user_name' => $this->user['user']['user_name']])
|
||||
->find();
|
||||
if (!$this->request->isAjax()) {
|
||||
return View::fetch('renew', compact('model'));
|
||||
}
|
||||
if ($model->renew($this->postData('data'))) {
|
||||
return $this->renderSuccess('更新成功');
|
||||
}
|
||||
return $this->renderError($model->getError() ?: '更新失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
// 清空登录状态
|
||||
Session::delete('hema_admin');
|
||||
return redirect(url('passport/login'));
|
||||
}
|
||||
|
||||
}
|
||||
44
app/admin/controller/Pay.php
Normal file
44
app/admin/controller/Pay.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Setting as SettingModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 微信支付配置
|
||||
*/
|
||||
class Pay extends Controller
|
||||
{
|
||||
/**
|
||||
* 支付设置
|
||||
*/
|
||||
public function webpay()
|
||||
{
|
||||
return $this->updateEvent('webpay');
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信支付服务商设置
|
||||
*/
|
||||
public function wxpayisp()
|
||||
{
|
||||
return $this->updateEvent('wxpayisp');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设置事件
|
||||
*/
|
||||
private function updateEvent($key)
|
||||
{
|
||||
if (!$this->request->isAjax()) {
|
||||
$model = SettingModel::getItem($key,0);
|
||||
return View::fetch($key, compact('model'));
|
||||
}
|
||||
$model = new SettingModel;
|
||||
if($model->edit($key, $this->postData('data'))) {
|
||||
return $this->renderSuccess('设置成功');
|
||||
}
|
||||
return $this->renderError('设置失败');
|
||||
}
|
||||
|
||||
}
|
||||
56
app/admin/controller/Setting.php
Normal file
56
app/admin/controller/Setting.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Setting as SettingModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 站点配置
|
||||
*/
|
||||
class Setting extends Controller
|
||||
{
|
||||
/**
|
||||
* 站点设置
|
||||
*/
|
||||
public function web()
|
||||
{
|
||||
return $this->updateEvent('web');
|
||||
}
|
||||
/**
|
||||
* 登录注册
|
||||
*/
|
||||
public function passport()
|
||||
{
|
||||
return $this->updateEvent('passport');
|
||||
}
|
||||
/**
|
||||
* 功能设置
|
||||
*/
|
||||
public function ability()
|
||||
{
|
||||
return $this->updateEvent('ability');
|
||||
}
|
||||
/**
|
||||
* 分佣设置
|
||||
*/
|
||||
public function divide()
|
||||
{
|
||||
return $this->updateEvent('divide');
|
||||
}
|
||||
/**
|
||||
* 更新设置事件
|
||||
*/
|
||||
private function updateEvent(string $key)
|
||||
{
|
||||
if (!$this->request->isAjax()) {
|
||||
$model = SettingModel::getItem($key,0);
|
||||
return View::fetch($key, compact('model'));
|
||||
}
|
||||
$model = new SettingModel;
|
||||
if ($model->edit($key,$this->postData('data'))) {
|
||||
return $this->renderSuccess('更新成功');
|
||||
}
|
||||
return $this->renderError('更新失败');
|
||||
}
|
||||
|
||||
}
|
||||
97
app/admin/controller/User.php
Normal file
97
app/admin/controller/User.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\User as UserModel;
|
||||
use app\admin\model\UserDetail as UserDetailModel;
|
||||
use app\admin\model\Record as RecordModel;
|
||||
use think\facade\View;
|
||||
use think\facade\Session;
|
||||
|
||||
/**
|
||||
* 商户管理控制器
|
||||
*/
|
||||
class User extends Controller
|
||||
{
|
||||
/**
|
||||
* 支付记录
|
||||
*/
|
||||
public function pay()
|
||||
{
|
||||
$model = new RecordModel;
|
||||
$list = $model->getList(20);
|
||||
return View::fetch('pay', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员列表
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->lists(10,'商家会员');
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户列表
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
return $this->lists(20,'商家用户');
|
||||
}
|
||||
|
||||
/**
|
||||
* 代理列表
|
||||
*/
|
||||
public function agent()
|
||||
{
|
||||
return $this->lists(30,'代理用户');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设置事件
|
||||
*/
|
||||
private function lists($status, string $title)
|
||||
{
|
||||
$model = new UserModel;
|
||||
$list = $model->getList($status);
|
||||
return View::fetch('index', compact('list','title','status'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户资料
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$model = new UserDetailModel;
|
||||
$list = $model->getList();
|
||||
return View::fetch('detail', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键登录
|
||||
*/
|
||||
public function oneKey($id,$status='')
|
||||
{
|
||||
$model = UserModel::get($id);
|
||||
if($url = $model->oneKey($status)){
|
||||
return redirect($url);
|
||||
}
|
||||
$error = $model->getError() ?: '登录失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置为代理
|
||||
*/
|
||||
public function status($id)
|
||||
{
|
||||
$model = UserModel::get($id);
|
||||
if($model['status']['value'] == 10){
|
||||
return $this->renderError('商家的会员不可设置为代理');
|
||||
}
|
||||
if($model->agentAction()){
|
||||
return $this->renderSuccess('操作成功');
|
||||
}
|
||||
$error = $model->getError() ?: '操作失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
}
|
||||
74
app/admin/controller/Wechat.php
Normal file
74
app/admin/controller/Wechat.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\model\Wechat as WechatModel;
|
||||
use app\admin\model\Setting as SettingModel;
|
||||
use think\facade\View;
|
||||
use hema\wechat\Driver;
|
||||
|
||||
/**
|
||||
* 公众号管理
|
||||
*/
|
||||
class Wechat extends Controller
|
||||
{
|
||||
private $wechat;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
$this->wechat = WechatModel::detail();
|
||||
View::assign('wechat', $this->wechat);
|
||||
}
|
||||
/**
|
||||
* 公众号信息
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$wechat = $this->wechat;
|
||||
$url = '';
|
||||
if(!$wechat or $wechat['status']['value'] == 0){
|
||||
$wx = new Driver;
|
||||
$url = $wx->authUrl(0,1);
|
||||
}
|
||||
return View::fetch('index', compact('url'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 被关注回复设置
|
||||
*/
|
||||
public function subscribe()
|
||||
{
|
||||
return $this->updateEvent('subscribe');
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号菜单设置
|
||||
*/
|
||||
public function menus()
|
||||
{
|
||||
return $this->updateEvent('menus');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设置事件
|
||||
*/
|
||||
private function updateEvent($key)
|
||||
{
|
||||
if (!$this->request->isAjax()) {
|
||||
$model = SettingModel::getItem($key,0);
|
||||
if($key == 'menus'){
|
||||
$model = json_encode($model);
|
||||
}
|
||||
return View::fetch($key, compact('model'));
|
||||
}
|
||||
$model = new SettingModel;
|
||||
if ($model->edit($key,$this->postData('data'))){
|
||||
return $this->renderSuccess('更新成功');
|
||||
}
|
||||
$error = $model->getError() ?: '更新失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
}
|
||||
72
app/admin/controller/applet/Code.php
Normal file
72
app/admin/controller/applet/Code.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace app\admin\controller\applet;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use app\admin\model\Template as TemplateModel;
|
||||
use app\admin\model\TemplateCode as TemplateCodeModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 推送模板管理
|
||||
*/
|
||||
class Code extends Controller
|
||||
{
|
||||
/**
|
||||
* 模板列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$model = new TemplateCodeModel;
|
||||
$list = $model->getList();
|
||||
return View::fetch('index', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$model = TemplateCodeModel::get($id);
|
||||
if (!$model->remove()) {
|
||||
return $this->renderError('删除失败');
|
||||
}
|
||||
return $this->renderSuccess('删除成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isGet()) {
|
||||
$tpl = new TemplateModel;
|
||||
$list = $tpl->getList();
|
||||
return $this->renderSuccess('', '', compact('list'));
|
||||
}
|
||||
$model = new TemplateCodeModel;
|
||||
// 新增记录
|
||||
if ($model->add($this->postData('data'))) {
|
||||
return $this->renderSuccess('添加成功', url('applet.code/index'));
|
||||
}
|
||||
return $this->renderError('添加失败');
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//详情
|
||||
$model = TemplateCodeModel::get($id);
|
||||
if ($this->request->isGet()) {
|
||||
$tpl = new TemplateModel;
|
||||
$list = $tpl->getList();
|
||||
return $this->renderSuccess('', '', compact('model','list'));
|
||||
}
|
||||
// 更新记录
|
||||
if ($model->edit($this->postData('data'))) {
|
||||
return $this->renderSuccess('操作成功', url('applet.code/index'));
|
||||
}
|
||||
return $this->renderError('操作失败');
|
||||
}
|
||||
}
|
||||
86
app/admin/controller/applet/Template.php
Normal file
86
app/admin/controller/applet/Template.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace app\admin\controller\applet;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use app\admin\model\Template as TemplateModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 模板市场控制器
|
||||
*/
|
||||
class Template extends Controller
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$model = new TemplateModel;
|
||||
$list = $model->getListAll();
|
||||
return View::fetch('index', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分类
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$model = TemplateModel::get($id);
|
||||
if (!$model->remove()) {
|
||||
$error = $model->getError() ?: '删除失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return $this->renderSuccess('删除成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$model = new TemplateModel;
|
||||
// 新增记录
|
||||
if ($model->add($this->postData('data'))) {
|
||||
return $this->renderSuccess('添加成功', url('applet.template/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '添加失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return redirect(url('applet.template/index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$model = TemplateModel::get($id);
|
||||
if ($this->request->isGet()) {
|
||||
if($model){
|
||||
return $this->renderSuccess('', '', compact('model'));
|
||||
}
|
||||
return $this->renderError('获取失败');
|
||||
}
|
||||
// 更新记录
|
||||
if ($model->edit($this->postData('data'))) {
|
||||
return $this->renderSuccess('操作成功', url('applet.template/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '操作失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上架/下架
|
||||
*/
|
||||
public function status($id)
|
||||
{
|
||||
$model = TemplateModel::get($id);
|
||||
if($model->status()){
|
||||
return $this->renderSuccess('操作成功');
|
||||
}
|
||||
$error = $model->getError() ?: '操作失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
}
|
||||
58
app/admin/controller/applet/Wxtpl.php
Normal file
58
app/admin/controller/applet/Wxtpl.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace app\admin\controller\applet;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use think\facade\View;
|
||||
use hema\wechat\Driver;
|
||||
|
||||
/**
|
||||
* 线上模板库管理
|
||||
*/
|
||||
class Wxtpl extends Controller
|
||||
{
|
||||
/**
|
||||
* 草稿模板列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$wx = new Driver;
|
||||
$list = $wx->getTemplatedRaftList();
|
||||
return View::fetch('index', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加到模板库
|
||||
*/
|
||||
public function add($id)
|
||||
{
|
||||
//把草稿添加到模板库
|
||||
$wx = new Driver;
|
||||
if($wx->addToTemplate($id)){
|
||||
return $this->renderSuccess('添加成功',url('applet.wxtpl/lists'));
|
||||
}
|
||||
return $this->renderError($wx->getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板库列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$wx = new Driver;
|
||||
$list = $wx->getTemplateList();
|
||||
return View::fetch('lists', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$wx = new Driver;
|
||||
if($wx->deleteTemplate($id)){
|
||||
return $this->renderSuccess('删除成功',url('applet.wxtpl/lists'));
|
||||
}
|
||||
return $this->renderError($wx->getError());
|
||||
}
|
||||
|
||||
}
|
||||
61
app/admin/controller/setting/Cache.php
Normal file
61
app/admin/controller/setting/Cache.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use think\facade\Cache as Driver;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 清理缓存
|
||||
*/
|
||||
class Cache extends Controller
|
||||
{
|
||||
/**
|
||||
* 清理缓存
|
||||
*/
|
||||
public function clear($isForce = false)
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$data = $this->postData('cache');
|
||||
$this->rmCache($data['keys'], isset($data['isForce']) ? !!$data['isForce'] : false);
|
||||
return $this->renderSuccess('操作成功');
|
||||
}
|
||||
return View::fetch('clear', [
|
||||
'cacheList' => $this->getCacheKeys(),
|
||||
'isForce' => !!$isForce ?: config('app_debug'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存
|
||||
*/
|
||||
private function rmCache($keys, $isForce = false)
|
||||
{
|
||||
if ($isForce === true) {
|
||||
Driver::clear();
|
||||
} else {
|
||||
$cacheList = $this->getCacheKeys();
|
||||
foreach (array_intersect(array_keys($cacheList), $keys) as $key) {
|
||||
Driver::has($cacheList[$key]['key']) && Driver::delete($cacheList[$key]['key']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存索引数据
|
||||
*/
|
||||
private function getCacheKeys()
|
||||
{
|
||||
return [
|
||||
'setting' => [
|
||||
'key' => 'setting_0',
|
||||
'name' => '站点设置'
|
||||
],
|
||||
'link' => [
|
||||
'key' => 'hema_link',
|
||||
'name' => '友情链接'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
73
app/admin/controller/setting/Link.php
Normal file
73
app/admin/controller/setting/Link.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use app\admin\model\Link as LinkModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 友情链接
|
||||
*/
|
||||
class Link extends Controller
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$model = new LinkModel;
|
||||
$list = $model->getList();
|
||||
return View::fetch('index', compact('list'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$model = LinkModel::get($id);
|
||||
if (!$model->remove()) {
|
||||
$error = $model->getError() ?: '删除失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return $this->renderSuccess('删除成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$model = new LinkModel;
|
||||
// 新增记录
|
||||
if ($model->add($this->postData('data'))) {
|
||||
return $this->renderSuccess('添加成功', url('setting.link/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '添加失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return redirect(url('setting.link/index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$model = LinkModel::get($id);
|
||||
if ($this->request->isGet()) {
|
||||
if($model){
|
||||
return $this->renderSuccess('', '', compact('model'));
|
||||
}
|
||||
return $this->renderError('获取失败');
|
||||
}
|
||||
// 更新记录
|
||||
if ($model->edit($this->postData('data'))) {
|
||||
return $this->renderSuccess('操作成功', url('setting.link/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '操作失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
}
|
||||
55
app/admin/controller/setting/Message.php
Normal file
55
app/admin/controller/setting/Message.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use app\admin\model\Setting as SettingModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 站点消息提醒
|
||||
*/
|
||||
class Message extends Controller
|
||||
{
|
||||
/**
|
||||
* 短信提醒
|
||||
*/
|
||||
public function sms()
|
||||
{
|
||||
$list = [];
|
||||
if($addon = get_addons_info('smsaliyun')){
|
||||
$addon['status'] && array_push($list,['text' => '阿里云', 'value' => 'aliyun']);
|
||||
}
|
||||
if($addon = get_addons_info('smsqcloud')){
|
||||
$addon['status'] && array_push($list,['text' => '腾讯云', 'value' => 'qcloud']);
|
||||
}
|
||||
if($addon = get_addons_info('smsqiniu')){
|
||||
$addon['status'] && array_push($list,['text' => '七牛云', 'value' => 'qiniu']);
|
||||
}
|
||||
View::assign('list',$list);
|
||||
return $this->updateEvent('sms');
|
||||
}
|
||||
/**
|
||||
* 公众号提醒
|
||||
*/
|
||||
public function webtplmsg()
|
||||
{
|
||||
return $this->updateEvent('webtplmsg');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设置事件
|
||||
*/
|
||||
private function updateEvent(string $key)
|
||||
{
|
||||
if (!$this->request->isAjax()) {
|
||||
$model = SettingModel::getItem($key,0);
|
||||
return View::fetch($key, compact('model'));
|
||||
}
|
||||
$model = new SettingModel;
|
||||
if ($model->edit($key,$this->postData('data'))) {
|
||||
return $this->renderSuccess('更新成功');
|
||||
}
|
||||
return $this->renderError('更新失败');
|
||||
}
|
||||
|
||||
}
|
||||
182
app/admin/controller/setting/Science.php
Normal file
182
app/admin/controller/setting/Science.php
Normal file
@ -0,0 +1,182 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 环境监测
|
||||
*/
|
||||
class Science extends Controller
|
||||
{
|
||||
/**
|
||||
* 状态class
|
||||
*/
|
||||
private $statusClass = [
|
||||
'normal' => '',
|
||||
'warning' => 'am-active',
|
||||
'danger' => 'am-danger'
|
||||
];
|
||||
|
||||
/**
|
||||
* 环境检测
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return View::fetch('index', [
|
||||
'statusClass' => $this->statusClass,
|
||||
'phpinfo' => $this->phpinfo(), // 服务器信息
|
||||
'server' => $this->server(), // PHP环境要求
|
||||
'writeable' => $this->writeable(), // 目录权限监测
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务器信息
|
||||
*/
|
||||
private function server()
|
||||
{
|
||||
return [
|
||||
'system' => [
|
||||
'name' => '服务器操作系统',
|
||||
'value' => PHP_OS,
|
||||
'status' => PHP_SHLIB_SUFFIX === 'dll' ? 'warning' : 'normal',
|
||||
'remark' => '建议使用 Linux 系统以提升程序性能'
|
||||
],
|
||||
'webserver' => [
|
||||
'name' => 'Web服务器环境',
|
||||
'value' => $this->request->server('SERVER_SOFTWARE'),
|
||||
'status' => PHP_SAPI === 'isapi' ? 'warning' : 'normal',
|
||||
'remark' => '建议使用 Apache 或 Nginx 以提升程序性能'
|
||||
],
|
||||
'php' => [
|
||||
'name' => 'PHP版本',
|
||||
'value' => PHP_VERSION,
|
||||
'status' => version_compare(PHP_VERSION, '5.4.0') === -1 ? 'danger' : 'normal',
|
||||
'remark' => 'PHP版本必须为 5.4.0 以上'
|
||||
],
|
||||
'upload_max' => [
|
||||
'name' => '文件上传限制',
|
||||
'value' => @ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'unknow',
|
||||
'status' => 'normal',
|
||||
'remark' => ''
|
||||
],
|
||||
'web_path' => [
|
||||
'name' => '程序运行目录',
|
||||
'value' => realpath(web_path()),
|
||||
'status' => 'normal',
|
||||
'remark' => ''
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP环境要求
|
||||
*/
|
||||
private function phpinfo()
|
||||
{
|
||||
return [
|
||||
'php_version' => [
|
||||
'name' => 'PHP版本',
|
||||
'value' => '5.4.0及以上',
|
||||
'status' => version_compare(PHP_VERSION, '5.4.0') === -1 ? 'danger' : 'normal',
|
||||
'remark' => 'PHP版本必须为 5.4.0及以上'
|
||||
],
|
||||
'curl' => [
|
||||
'name' => 'CURL',
|
||||
'value' => '支持',
|
||||
'status' => extension_loaded('curl') && function_exists('curl_init') ? 'normal' : 'danger',
|
||||
'remark' => '您的PHP环境不支持CURL, 系统无法正常运行'
|
||||
],
|
||||
'openssl' => [
|
||||
'name' => 'OpenSSL',
|
||||
'value' => '支持',
|
||||
'status' => extension_loaded('openssl') ? 'normal' : 'danger',
|
||||
'remark' => '没有启用OpenSSL, 将无法访问微信平台的接口'
|
||||
],
|
||||
'pdo' => [
|
||||
'name' => 'PDO',
|
||||
'value' => '支持',
|
||||
'status' => extension_loaded('PDO') && extension_loaded('pdo_mysql') ? 'normal' : 'danger',
|
||||
'remark' => '您的PHP环境不支持PDO, 系统无法正常运行'
|
||||
],
|
||||
'bcmath' => [
|
||||
'name' => 'BCMath',
|
||||
'value' => '支持',
|
||||
'status' => extension_loaded('bcmath') ? 'normal' : 'danger',
|
||||
'remark' => '您的PHP环境不支持BCMath, 系统无法正常运行'
|
||||
],
|
||||
'zip' => [
|
||||
'name' => 'ZIP扩展',
|
||||
'value' => '支持',
|
||||
'status' => extension_loaded('zip') ? 'normal' : 'danger',
|
||||
'remark' => '您的PHP环境不支持ZIP扩展, 无法正常导出Excel表格'
|
||||
],
|
||||
'gd2' => [
|
||||
'name' => 'GD扩展',
|
||||
'value' => '支持',
|
||||
'status' => extension_loaded('gd') ? 'normal' : 'danger',
|
||||
'remark' => '您的PHP环境不支持GD扩展, 无法正常生成二维码推广海报'
|
||||
],
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 目录权限监测
|
||||
*/
|
||||
private function writeable()
|
||||
{
|
||||
$paths = [
|
||||
'addons' => realpath(str_replace('public','addons',web_path())),
|
||||
'assets' => realpath(web_path()) . '/addons',
|
||||
'uploads' => realpath(web_path()) . '/uploads',
|
||||
'temp' => realpath(web_path()) . '/temp',
|
||||
];
|
||||
return [
|
||||
'addons' => [
|
||||
'name' => '插件部署目录',
|
||||
'value' => $paths['addons'],
|
||||
'status' => $this->checkWriteable($paths['addons']) ? 'normal' : 'danger',
|
||||
'remark' => '目录不可写,系统将无法正常部署插件'
|
||||
],
|
||||
'assets' => [
|
||||
'name' => '插件资源目录',
|
||||
'value' => $paths['assets'],
|
||||
'status' => $this->checkWriteable($paths['assets']) ? 'normal' : 'danger',
|
||||
'remark' => '目录不可写,系统将无法正常部署插件静态资源文件'
|
||||
],
|
||||
'uploads' => [
|
||||
'name' => '文件上传目录',
|
||||
'value' => $paths['uploads'],
|
||||
'status' => $this->checkWriteable($paths['uploads']) ? 'normal' : 'danger',
|
||||
'remark' => '目录不可写,系统将无法正常上传文件'
|
||||
],
|
||||
'temp' => [
|
||||
'name' => '临时文件目录',
|
||||
'value' => $paths['temp'],
|
||||
'status' => $this->checkWriteable($paths['temp']) ? 'normal' : 'danger',
|
||||
'remark' => '目录不可写,系统将无法正常生成门店、餐桌等二维码'
|
||||
],
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查目录是否可写
|
||||
*/
|
||||
private function checkWriteable($path)
|
||||
{
|
||||
try {
|
||||
!is_dir($path) && mkdir($path, 0755);
|
||||
if (!is_dir($path))
|
||||
return false;
|
||||
$fileName = $path . '/_test_write.txt';
|
||||
if ($fp = fopen($fileName, 'w')) {
|
||||
return fclose($fp) && unlink($fileName);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
1
app/admin/controller/wechat/Keyword.php
Normal file
1
app/admin/controller/wechat/Keyword.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace app\admin\controller\wechat;
use app\admin\controller\Controller;
use app\admin\model\Keyword as KeywordModel;
use app\admin\model\Wechat as WechatModel;
use think\facade\View;
/**
* 关键字回复控制器
*/
class Keyword extends Controller
{
/**
* 首页
*/
public function index()
{
$model = new KeywordModel;
$list = $model->getList();
$wechat = WechatModel::detail();
return View::fetch('index', compact('list','wechat'));
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
$model = new KeywordModel;
// 新增记录
if ($model->add($this->postData('data'))) {
return $this->renderSuccess('添加成功', url('wechat.keyword/index'));
}
$error = $model->getError() ?: '添加失败';
return $this->renderError($error);
}
return redirect(url('wechat.keyword/index'));
}
/**
* 删除
*/
public function delete($id)
{
$model = KeywordModel::get($id);
if (!$model->remove()) {
return $this->renderError('删除失败');
}
return $this->renderSuccess('删除成功');
}
/**
* 编辑
*/
public function edit($id)
{
$model = KeywordModel::get($id);
if ($this->request->isGet()) {
if($model){
return $this->renderSuccess('', '', compact('model'));
}
return $this->renderError('获取失败');
}
// 更新记录
if ($model->edit($this->postData('data'))) {
return $this->renderSuccess('更新成功', url('wechat.keyword/index'));
}
$error = $model->getError() ?: '更新失败';
return $this->renderError($error);
}
/**
* 状态编辑
*/
public function status($id)
{
$model = KeywordModel::get($id);
// 更新记录
if ($model->status()) {
return $this->renderSuccess('更新成功', url('wechat.keyword/index'));
}
$error = $model->getError() ?: '更新失败';
return $this->renderError($error);
}
}
|
||||
1
app/admin/controller/wechat/Send.php
Normal file
1
app/admin/controller/wechat/Send.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace app\admin\controller\wechat;
use app\admin\controller\Controller;
use app\admin\model\WechatBatchSend as WechatBatchSendModel;
use app\admin\model\Wechat as WechatModel;
use think\facade\View;
/**
* 微信群发消息控制器
*/
class Send extends Controller
{
/**
* 首页
*/
public function index()
{
$model = new WechatBatchSendModel;
$list = $model->getList();
$wechat = WechatModel::detail();
return View::fetch('index', compact('list','wechat'));
}
/**
* 删除
*/
public function delete($id)
{
$model = WechatBatchSendModel::get($id);
if ($model->remove()) {
return $this->renderSuccess('删除成功');
}
$error = $model->getError() ?: '删除失败';
return $this->renderError($error);
}
/**
* 群发
*/
public function status($id)
{
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
$model = WechatBatchSendModel::get($id);
if ($model->send()){
return $this->renderSuccess('群发成功');
}
$error = $model->getError() ?: '群发失败';
return $this->renderError($error);
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
$model = new WechatBatchSendModel;
// 新增记录
if ($model->add($this->postData('data'))) {
return $this->renderSuccess('添加成功,预览消息已发送到管理员微信', url('wechat.send/index'));
}
$error = $model->getError() ?: '添加失败';
return $this->renderError($error);
}
return redirect(url('wechat.send/index'));
}
/**
* 编辑
*/
public function edit($id)
{
$model = WechatBatchSendModel::get($id);
if ($this->request->isGet()) {
if($model){
return $this->renderSuccess('', '', compact('model'));
}
return $this->renderError('获取失败');
}
// 更新记录
if ($model->edit($this->postData('data'))) {
return $this->renderSuccess('更新成功', url('wechat.send/index'));
}
$error = $model->getError() ?: '更新失败';
return $this->renderError($error);
}
}
|
||||
88
app/admin/controller/wechat/material/Image.php
Normal file
88
app/admin/controller/wechat/material/Image.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat\material;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use app\admin\model\Material as MaterialModel;
|
||||
use app\admin\model\Wechat as WechatModel;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 图片素材
|
||||
*/
|
||||
class Image extends Controller
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$model = new MaterialModel;
|
||||
$list = $model->getList(10);
|
||||
$wechat = WechatModel::detail();
|
||||
return View::fetch('index', compact('list','wechat'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$model = MaterialModel::get($id);
|
||||
if (!$model->remove()) {
|
||||
$error = $model->getError() ?: '删除失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return $this->renderSuccess('删除成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
if(!$wechat = WechatModel::detail()){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
if($wechat['status']['value'] == 0){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
$model = new MaterialModel;
|
||||
// 新增记录
|
||||
if ($model->add($this->postData('data'))) {
|
||||
return $this->renderSuccess('添加成功', url('wechat.material.image/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '添加失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return redirect(url('wechat.material.image/index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$model = MaterialModel::get($id);
|
||||
if ($this->request->isGet()) {
|
||||
if($model){
|
||||
return $this->renderSuccess('', '', compact('model'));
|
||||
}
|
||||
return $this->renderError('获取失败');
|
||||
}
|
||||
// 更新记录
|
||||
if(!$wechat = WechatModel::detail()){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
if($wechat['status']['value'] == 0){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
// 更新记录
|
||||
if ($model->edit($this->postData('data'))) {
|
||||
return $this->renderSuccess('更新成功', url('wechat.material.image/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '更新失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
}
|
||||
86
app/admin/controller/wechat/material/Text.php
Normal file
86
app/admin/controller/wechat/material/Text.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat\material;
|
||||
|
||||
use app\admin\controller\Controller;
|
||||
use app\admin\model\Material as MaterialModel;
|
||||
use app\admin\model\MaterialText as MaterialTextModel;
|
||||
use app\admin\model\Wechat as WechatModel;
|
||||
use think\facade\View;
|
||||
/**
|
||||
* 图文素材
|
||||
*/
|
||||
class Text extends Controller
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$model = new MaterialModel;
|
||||
$list = $model->getList(40);
|
||||
$wechat = WechatModel::detail();
|
||||
return View::fetch('index', compact('list','wechat'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$model = new MaterialModel;
|
||||
if (!$this->request->isAjax()) {
|
||||
$material = $model->getDefault();
|
||||
return View::fetch('add', compact('material'));
|
||||
}
|
||||
if(!$wechat = WechatModel::detail()){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
if($wechat['status']['value'] == 0){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
// 新增记录
|
||||
if($model->addText($this->postData('data'))){
|
||||
return $this->renderSuccess('添加成功', url('wechat.material.text/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '添加失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($id, string $text_no)
|
||||
{
|
||||
$model = MaterialModel::get($id);
|
||||
$text = new MaterialTextModel;
|
||||
$material = $text->getList($text_no,$model['name']);
|
||||
if (!$this->request->isAjax()) {
|
||||
return View::fetch('edit', compact('material'));
|
||||
}
|
||||
if(!$wechat = WechatModel::detail()){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
if($wechat['status']['value'] == 0){
|
||||
return $this->renderError('还未绑定公众号');
|
||||
}
|
||||
// 更新记录
|
||||
if ($model->editText($this->postData('data'),$text)) {
|
||||
return $this->renderSuccess('更新成功', url('wechat.material.text/index'));
|
||||
}
|
||||
$error = $model->getError() ?: '更新失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$model = MaterialModel::get($id);
|
||||
if (!$model->remove()) {
|
||||
$error = $model->getError() ?: '删除失败';
|
||||
return $this->renderError($error);
|
||||
}
|
||||
return $this->renderSuccess('删除成功');
|
||||
}
|
||||
}
|
||||
1
app/admin/controller/wechat/material/Video.php
Normal file
1
app/admin/controller/wechat/material/Video.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace app\admin\controller\wechat\material;
use app\admin\controller\Controller;
use app\admin\model\Material as MaterialModel;
use app\admin\model\Wechat as WechatModel;
use think\facade\View;
/**
* 视频素材
*/
class Video extends Controller
{
/**
* 列表
*/
public function index()
{
$model = new MaterialModel;
$list = $model->getList(30);
$wechat = WechatModel::detail();
return View::fetch('index', compact('list','wechat'));
}
/**
* 删除
*/
public function delete($id)
{
$model = MaterialModel::get($id);
if (!$model->remove()) {
$error = $model->getError() ?: '删除失败';
return $this->renderError($error);
}
return $this->renderSuccess('删除成功');
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
$model = new MaterialModel;
// 新增记录
$file = request()->file('file');
// 文件扩展名
$fileExt = strtolower($file->extension());
if($fileExt != 'mp4'){
return $this->renderError('上传文件类型只能为mp4');
}
// 文件大小(字节)不能大于10M(1024*1024*10)
$fileSize = $file->getSize();
if($fileSize > 10485760){
return $this->renderError('上传文件大于10M');
}
$fileInfo = pathinfo($file);
$folder = date('Ymd');//日期文件夹
$savePath = web_path() . 'uploads/admin/'.$folder;
$info = $file->move($savePath);
$file_name = $file->hashName(function () {
return md5(uniqid((string)mt_rand(), true));
});
rename($savePath . DIRECTORY_SEPARATOR . $fileInfo['basename'],$savePath . DIRECTORY_SEPARATOR . $file_name);
$file_path = 'admin/'.$folder.'/'.$file_name;
// 新增记录
if($model->add($this->postData('data'),$file_path)){
return $this->renderSuccess('添加成功', url('wechat.material.video/index'));
}
$error = $model->getError() ?: '添加失败';
return $this->renderError($error);
}
return redirect(url('wechat.material.video/index'));
}
/**
* 编辑
*/
public function edit($id)
{
$model = MaterialModel::get($id);
if ($this->request->isGet()) {
if($model){
return $this->renderSuccess('', '', compact('model'));
}
return $this->renderError('获取失败');
}
// 更新记录
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
// 更新记录
if ($model->edit($this->postData('data'))) {
return $this->renderSuccess('更新成功', url('wechat.material.video/index'));
}
$error = $model->getError() ?: '更新失败';
return $this->renderError($error);
}
}
|
||||
1
app/admin/controller/wechat/material/Voice.php
Normal file
1
app/admin/controller/wechat/material/Voice.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
namespace app\admin\controller\wechat\material;
use app\admin\controller\Controller;
use app\admin\model\Material as MaterialModel;
use app\admin\model\Wechat as WechatModel;
use think\facade\View;
/**
* 音频素材
*/
class Voice extends Controller
{
/**
* 列表
*/
public function index()
{
$model = new MaterialModel;
$list = $model->getList(20);
$wechat = WechatModel::detail();
return View::fetch('index', compact('list','wechat'));
}
/**
* 删除
*/
public function delete($id)
{
$model = MaterialModel::get($id);
if (!$model->remove()) {
$error = $model->getError() ?: '删除失败';
return $this->renderError($error);
}
return $this->renderSuccess('删除成功');
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
$model = new MaterialModel;
// 新增记录
$file = request()->file('file');
// 文件扩展名
$fileExt = strtolower($file->extension());
if(!in_array($fileExt, ['mp3','wma','wav','amr'])){
return $this->renderError('上传文件类型只能为:mp3、wma、wav、amr');
}
// 文件大小(字节)不能大于2M(1024*1024*2 = 2097152)
$fileSize = $file->getSize();
if($fileSize > 2097152){
return $this->renderError('上传文件大于2M');
}
$fileInfo = pathinfo($file);
$folder = date('Ymd');//日期文件夹
$savePath = web_path() . 'uploads/admin/'.$folder;
$info = $file->move($savePath);
$file_name = $file->hashName(function () {
return md5(uniqid((string)mt_rand(), true));
});
rename($savePath . DIRECTORY_SEPARATOR . $fileInfo['basename'],$savePath . DIRECTORY_SEPARATOR . $file_name);
$file_path = 'admin/'.$folder.'/'.$file_name;
// 新增记录
if($model->add($this->postData('data'),$file_path)){
return $this->renderSuccess('添加成功', url('wechat.material.voice/index'));
}
$error = $model->getError() ?: '添加失败';
return $this->renderError($error);
}
return redirect(url('wechat.material.voice/index'));
}
/**
* 编辑
*/
public function edit($id)
{
$model = MaterialModel::get($id);
if ($this->request->isGet()) {
if($model){
return $this->renderSuccess('', '', compact('model'));
}
return $this->renderError('获取失败');
}
// 更新记录
if(!$wechat = WechatModel::detail()){
return $this->renderError('还未绑定公众号');
}
if($wechat['status']['value'] == 0){
return $this->renderError('还未绑定公众号');
}
// 更新记录
if ($model->edit($this->postData('data'))) {
return $this->renderSuccess('更新成功', url('wechat.material.voice/index'));
}
$error = $model->getError() ?: '更新失败';
return $this->renderError($error);
}
}
|
||||
62
app/admin/model/Applet.php
Normal file
62
app/admin/model/Applet.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Applet as AppletModel;
|
||||
|
||||
/**
|
||||
* 小程序模型
|
||||
*/
|
||||
class Applet extends AppletModel
|
||||
{
|
||||
/**
|
||||
* 设置小程序模板标识
|
||||
*/
|
||||
public function setAppType($name)
|
||||
{
|
||||
$data = ['app_type' => $name];
|
||||
if(!empty($this->app_type) and $this->app_type != $name){
|
||||
$this->error = 'applet_id对应的小程序管理端已关联其它模板插件';
|
||||
return false;
|
||||
}
|
||||
if($applet = AppletModel::getApplet($data)){
|
||||
$this->error = '该模板插件,已被applet_id='.$applet['applet_id'].'关联,请勿重复';
|
||||
return false;
|
||||
}
|
||||
return $this->save($data) != false;
|
||||
}
|
||||
/**
|
||||
* 变更到期时间操作
|
||||
*/
|
||||
public function renewal(array $data)
|
||||
{
|
||||
if($data['term']<1){
|
||||
$this->error = '变更数值要大于0';
|
||||
return false;
|
||||
}
|
||||
//计算变更时间
|
||||
if($data['term_unit']==10){
|
||||
$expire_time = 86400*$data["term"];//计算天
|
||||
}
|
||||
if($data['term_unit']==20){
|
||||
$expire_time = 86400*30*$data["term"];//计算月
|
||||
}
|
||||
if($data['term_unit']==30){
|
||||
$expire_time = 86400*365*$data["term"];//计算年
|
||||
}
|
||||
//增加
|
||||
if($data['mode']=='inc'){
|
||||
$expire_time = $this['expire_time']['value']+$expire_time;
|
||||
}
|
||||
//扣减
|
||||
if($data['mode']=='dec'){
|
||||
$expire_time = $this['expire_time']['value']-$expire_time;
|
||||
}
|
||||
//重置
|
||||
if($data['mode']=='final'){
|
||||
$expire_time = time()+$expire_time;
|
||||
}
|
||||
return $this->save(['expire_time' => $expire_time]) !== false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
13
app/admin/model/Apply.php
Normal file
13
app/admin/model/Apply.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Apply as ApplyModel;
|
||||
|
||||
|
||||
/**
|
||||
* 用户认证申请模型
|
||||
*/
|
||||
class Apply extends ApplyModel
|
||||
{
|
||||
|
||||
}
|
||||
12
app/admin/model/DivideAccount.php
Normal file
12
app/admin/model/DivideAccount.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\DivideAccount as DivideAccountModel;
|
||||
|
||||
/**
|
||||
* 分账账户关系模型
|
||||
*/
|
||||
class DivideAccount extends DivideAccountModel
|
||||
{
|
||||
|
||||
}
|
||||
13
app/admin/model/Keyword.php
Normal file
13
app/admin/model/Keyword.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Keyword as KeywordModel;
|
||||
|
||||
/**
|
||||
* 公众号关键字回复模型
|
||||
*/
|
||||
class Keyword extends KeywordModel
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
12
app/admin/model/Link.php
Normal file
12
app/admin/model/Link.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Link as LinkModel;
|
||||
|
||||
/**
|
||||
* 友情链接模型
|
||||
*/
|
||||
class Link extends LinkModel
|
||||
{
|
||||
|
||||
}
|
||||
13
app/admin/model/Material.php
Normal file
13
app/admin/model/Material.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Material as MaterialModel;
|
||||
|
||||
/**
|
||||
* 公众号素材库模型
|
||||
*/
|
||||
class Material extends MaterialModel
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
12
app/admin/model/MaterialText.php
Normal file
12
app/admin/model/MaterialText.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\MaterialText as MaterialTextModel;
|
||||
|
||||
/**
|
||||
* 微信公众号图文详情模型
|
||||
*/
|
||||
class MaterialText extends MaterialTextModel
|
||||
{
|
||||
|
||||
}
|
||||
12
app/admin/model/Record.php
Normal file
12
app/admin/model/Record.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Record as RecordModel;
|
||||
|
||||
/**
|
||||
* 交易记录模型
|
||||
*/
|
||||
class Record extends RecordModel
|
||||
{
|
||||
|
||||
}
|
||||
12
app/admin/model/Setting.php
Normal file
12
app/admin/model/Setting.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Setting as SettingModel;
|
||||
|
||||
/**
|
||||
* 系统设置模型
|
||||
*/
|
||||
class Setting extends SettingModel
|
||||
{
|
||||
|
||||
}
|
||||
12
app/admin/model/Template.php
Normal file
12
app/admin/model/Template.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\Template as TemplateModel;
|
||||
|
||||
/**
|
||||
* 模板市场模型
|
||||
*/
|
||||
class Template extends TemplateModel
|
||||
{
|
||||
|
||||
}
|
||||
36
app/admin/model/TemplateCode.php
Normal file
36
app/admin/model/TemplateCode.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\TemplateCode as TemplateCodeModel;
|
||||
|
||||
/**
|
||||
* 模板模型
|
||||
*/
|
||||
class TemplateCode extends TemplateCodeModel
|
||||
{
|
||||
/**
|
||||
* 添加新记录
|
||||
*/
|
||||
public function add(array $data)
|
||||
{
|
||||
return $this->save($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑记录
|
||||
*/
|
||||
public function edit(array $data)
|
||||
{
|
||||
return $this->save($data) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function remove()
|
||||
{
|
||||
return $this->delete();
|
||||
}
|
||||
|
||||
}
|
||||
82
app/admin/model/User.php
Normal file
82
app/admin/model/User.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\User as UserModel;
|
||||
use think\facade\Session;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 用户模型
|
||||
*/
|
||||
class User extends UserModel
|
||||
{
|
||||
/**
|
||||
* 管理员用户登录
|
||||
*/
|
||||
public function login(array $data)
|
||||
{
|
||||
if(!captcha_check($data['captcha'])){
|
||||
$this->error = '验证码错误';
|
||||
return false;
|
||||
}
|
||||
$filter = [
|
||||
'user_name' => $data['user_name'],
|
||||
'status' => 10
|
||||
];
|
||||
// 验证用户名密码是否正确
|
||||
if (!$user = $this->where($filter)->find()){
|
||||
$this->error = '账号错误';
|
||||
return false;
|
||||
}
|
||||
if($user['password'] != hema_hash($data['password'])){
|
||||
$this->error = '密码错误';
|
||||
return false;
|
||||
}
|
||||
// 保存登录状态
|
||||
Session::set('hema_admin', [
|
||||
'user' => $user,
|
||||
'is_login' => true,
|
||||
]);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新当前管理员信息
|
||||
*/
|
||||
public function renew(array $data)
|
||||
{
|
||||
if ($data['password'] != $data['password_confirm']) {
|
||||
$this->error = '确认密码不正确';
|
||||
return false;
|
||||
}
|
||||
$data['password'] = hema_hash($data['password']);
|
||||
// 更新管理员信息
|
||||
return $this->save($data) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代理操作
|
||||
*/
|
||||
public function agentAction()
|
||||
{
|
||||
if($this->status['value'] == 20){
|
||||
return $this->save(['status' => 30]) !== false;//设置为代理
|
||||
}
|
||||
Db::startTrans();// 开启事务
|
||||
try {
|
||||
$this->save(['status' => 20]);//取消代理
|
||||
Applet::where('agent_id',$this->user_id)->update(['agent_id' => 0]);
|
||||
User::where('agent_id',$this->user_id)->update(['agent_id' => 0]);
|
||||
DivideAccount::where('agent_id',$this->user_id)->delete();
|
||||
Template::where('agent_id',$this->user_id)->delete();
|
||||
Apply::where('agent_id',$this->user_id)->delete();
|
||||
Record::where('user_id',$this->user_id)->delete();
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
12
app/admin/model/UserDetail.php
Normal file
12
app/admin/model/UserDetail.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\UserDetail as UserDetailModel;
|
||||
|
||||
/**
|
||||
* 用户详情模型
|
||||
*/
|
||||
class UserDetail extends UserDetailModel
|
||||
{
|
||||
|
||||
}
|
||||
11
app/admin/model/Wechat.php
Normal file
11
app/admin/model/Wechat.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
use app\common\model\Wechat as WechatModel;
|
||||
|
||||
/**
|
||||
* 公众号模型
|
||||
*/
|
||||
class Wechat extends WechatModel
|
||||
{
|
||||
|
||||
}
|
||||
13
app/admin/model/WechatBatchSend.php
Normal file
13
app/admin/model/WechatBatchSend.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\model\WechatBatchSend as WechatBatchSendModel;
|
||||
use hema\wechat\Driver;
|
||||
|
||||
/**
|
||||
* 微信群发消息模型
|
||||
*/
|
||||
class WechatBatchSend extends WechatBatchSendModel
|
||||
{
|
||||
|
||||
}
|
||||
1
app/admin/view/addon/index.html
Normal file
1
app/admin/view/addon/index.html
Normal file
File diff suppressed because one or more lines are too long
1
app/admin/view/addon/my.html
Normal file
1
app/admin/view/addon/my.html
Normal file
File diff suppressed because one or more lines are too long
112
app/admin/view/addon/tpl/config.html
Normal file
112
app/admin/view/addon/tpl/config.html
Normal file
@ -0,0 +1,112 @@
|
||||
<!-- 模板:插件配置 -->
|
||||
<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>
|
||||
1
app/admin/view/addon/tpl/local.html
Normal file
1
app/admin/view/addon/tpl/local.html
Normal file
@ -0,0 +1 @@
|
||||
<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>
|
||||
23
app/admin/view/addon/tpl/login.html
Normal file
23
app/admin/view/addon/tpl/login.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!-- 模板:登录 -->
|
||||
<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>
|
||||
21
app/admin/view/addon/tpl/user.html
Normal file
21
app/admin/view/addon/tpl/user.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!-- 模板:登录 -->
|
||||
<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>
|
||||
50
app/admin/view/applet/code/add.html
Normal file
50
app/admin/view/applet/code/add.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!-- 添加 -->
|
||||
<script id="tpl-add" type="text/template">
|
||||
<div class="am-padding-xs am-padding-top-sm">
|
||||
<div class="tips am-margin-bottom-sm am-u-sm-12">
|
||||
<div class="pre-info">
|
||||
<p> 注:微信平台推送,请到“模板库”中选择最新的模板记录进行填写</p>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<select name="data[app_type]" data-am-selected="{searchBox: 1, btnSize: 'sm'}" required>
|
||||
<option value="">请选择类型</option>
|
||||
{{ each list }}
|
||||
<option value="{{ $value.app_type }}">{{ $value.name }}</option>
|
||||
{{ /each }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mp]" value="10" checked data-am-ucheck> 微信
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mp]" value="20" data-am-ucheck> 支付宝
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">模板ID </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="number" class="tpl-form-input" name="data[id]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[user_version]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[user_desc]" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
45
app/admin/view/applet/code/edit.html
Normal file
45
app/admin/view/applet/code/edit.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!-- 编辑 -->
|
||||
<script id="tpl-edit" 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">
|
||||
<select name="data[app_type]" data-am-selected="{searchBox: 1, btnSize: 'sm'}" required>
|
||||
<option value="">请选择类型</option>
|
||||
{{ each list }}
|
||||
<option value="{{ $value.app_type }}" {{ $value.app_type == model.app_type ? 'selected' : '' }}>{{ $value.name }}</option>
|
||||
{{ /each }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mp]" value="10" {{ model.mp.value==10?'checked':'' }} data-am-ucheck> 微信
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mp]" value="20" {{ model.mp.value==20?'checked':'' }} data-am-ucheck> 支付宝
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">模板ID </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="number" class="tpl-form-input" name="data[id]" value="{{ model.id }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[user_version]" value="{{ model.user_version }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[user_desc]" value="{{ model.user_desc }}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
143
app/admin/view/applet/code/index.html
Normal file
143
app/admin/view/applet/code/index.html
Normal file
@ -0,0 +1,143 @@
|
||||
<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">已推送模板列表</div>
|
||||
</div>
|
||||
<div class="tips am-margin-bottom-sm am-u-sm-12">
|
||||
<div class="pre-info">
|
||||
<p> 注:给用户推送新版本(不推送用户无法获取最新版本),过期版本不建议删除。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body am-fr">
|
||||
<div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
|
||||
<div class="am-form-group">
|
||||
<div class="am-btn-toolbar">
|
||||
<div class="am-btn-group am-btn-group-sm">
|
||||
<a href="javascript:void(0);" class="hema-add am-btn am-btn-primary am-radius">
|
||||
<span class="am-icon-plus"></span> 添加
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-u-sm-12">
|
||||
<table width="100%" class="am-table am-table-hover tpl-table-black">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>模板ID</th>
|
||||
<th>模板类型</th>
|
||||
<th>平台</th>
|
||||
<th>版本号</th>
|
||||
<th>描述</th>
|
||||
<th>时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if !$list->isEmpty()}
|
||||
{foreach $list as $item}
|
||||
<tr>
|
||||
<td class="am-text-middle"><p>{$item['id']}</p></td>
|
||||
<td class="am-text-middle">{$item['template']['name']}</td>
|
||||
<td class="am-text-middle" style="font-size:25px;">
|
||||
{if $item['mp']['value'] == 10}
|
||||
<i class="iconfont iconweixinxiaochengxu" style="color:#19be6b;"></i>
|
||||
{/if}
|
||||
{if $item['mp']['value'] == 20}
|
||||
<i class="iconfont iconzhifubao" style="color:#2979ff;"></i>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="am-text-middle">{$item['user_version']}</td>
|
||||
<td class="am-text-middle">{$item['user_desc']}</td>
|
||||
<td class="am-text-middle">{$item['create_time']}</td>
|
||||
<td class="am-text-middle">
|
||||
<div class="tpl-table-black-operation">
|
||||
<a href="javascript:;" class="hema-edit" data-id="{$item['template_code_id']}">
|
||||
<i class="am-icon-pencil"></i> 编辑
|
||||
</a>
|
||||
<a href="javascript:;" class="hema-del tpl-table-black-operation-del"
|
||||
data-id="{$item['template_code_id']}">
|
||||
<i class="am-icon-trash"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else /}
|
||||
<tr>
|
||||
<td colspan="6" class="am-text-center">暂无记录</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="am-u-lg-12 am-cf">
|
||||
<div class="am-fr">{:$list->render()} </div>
|
||||
<div class="am-fr pagination-total am-margin-right">
|
||||
<div class="am-vertical-align-middle">总记录:{:$list->total()}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="applet/code/add" /}
|
||||
{include file="applet/code/edit" /}
|
||||
<script>
|
||||
$(function () {
|
||||
//添加
|
||||
$('.hema-add').on('click', function () {
|
||||
$.get("{:url('applet.code/add')}", function (result) {
|
||||
if(result.code == 0){
|
||||
$.show_error(result.msg);
|
||||
return false;
|
||||
}
|
||||
$.showAction({
|
||||
title: '添加',
|
||||
area: '750px',
|
||||
content: template('tpl-add', result.data),
|
||||
uCheck: true,
|
||||
success: function ($content) {
|
||||
$('#my-form').formPost({
|
||||
url: "{:url('applet.code/add')}"
|
||||
});
|
||||
},
|
||||
btn2: function ($content) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
//编辑
|
||||
$('.hema-edit').on('click', function () {
|
||||
var data = $(this).data();
|
||||
$.get("{:url('applet.code/edit')}?id=" + data.id, function (result) {
|
||||
if(result.code == 0){
|
||||
$.show_error(result.msg);
|
||||
return false;
|
||||
}
|
||||
$.showAction({
|
||||
title: '编辑',
|
||||
area: '750px',
|
||||
content: template('tpl-edit', result.data),
|
||||
uCheck: true,
|
||||
success: function ($content) {
|
||||
$('#my-form').formPost({
|
||||
url: "{:url('applet.code/edit')}?id=" + data.id
|
||||
});
|
||||
},
|
||||
btn2: function ($content) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
// 删除元素
|
||||
var url = "{:url('applet.code/delete')}";
|
||||
$('.hema-del').del('id', url);
|
||||
});
|
||||
</script>
|
||||
|
||||
1
app/admin/view/applet/index.html
Normal file
1
app/admin/view/applet/index.html
Normal file
File diff suppressed because one or more lines are too long
187
app/admin/view/applet/template/add.html
Normal file
187
app/admin/view/applet/template/add.html
Normal file
@ -0,0 +1,187 @@
|
||||
<!-- 添加 -->
|
||||
<script id="tpl-add" 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="text" class="tpl-form-input" name="data[name]" value="" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[app_type]" value="" required>
|
||||
<small>保持唯一,为模板插件名称,比如(test),添加后不允许修改</small>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[is_many]" value="0" checked data-am-ucheck> 不支持
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[is_many]" value="1" data-am-ucheck> 支持
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group single many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="data[buy_single][]" value="0">
|
||||
<input type="number" name="data[buy_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group single many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group single many">
|
||||
<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="number" class="tpl-form-input" min="0" name="data[single_price]" value="" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="data[buy_many][]" value="0">
|
||||
<input type="number" name="data[buy_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="0" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group many">
|
||||
<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="number" class="tpl-form-input" name="data[many_price]" min="0" value="" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="number" min="0" class="tpl-form-input" name="data[trial_day]" value="30" required>
|
||||
<small>设置0不启用</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label">备注说明 </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[detail]" value="">
|
||||
</div>
|
||||
</div>
|
||||
<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="number" class="tpl-form-input" name="data[sort]" value="100" required>
|
||||
<small>数字越小越靠前</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
187
app/admin/view/applet/template/edit.html
Normal file
187
app/admin/view/applet/template/edit.html
Normal file
@ -0,0 +1,187 @@
|
||||
<!-- 编辑 -->
|
||||
<script id="tpl-edit" 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="text" class="tpl-form-input" name="data[name]" value="{{ model.name }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.app_type }}" disabled>
|
||||
<small>保持唯一,为模板插件名称,比如(test),添加后不允许修改</small>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" value="1" {{ model.is_many == 1 ? 'checked' : '' }} data-am-ucheck disabled> 支持
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" value="0" {{ model.is_many == 0 ? 'checked' : '' }} data-am-ucheck disabled> 不支持
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group single many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="data[buy_single][]" value="0">
|
||||
<input type="number" name="data[buy_single][]" min="0" value="{{ model.buy_single[1] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="{{ model.buy_single[2] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="{{ model.buy_single[3] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="{{ model.buy_single[4] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_single][]" min="0" value="{{ model.buy_single[5] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group single many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="{{ model.renew_single[0] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="{{ model.renew_single[1] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="{{ model.renew_single[2] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="{{ model.renew_single[3] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_single][]" min="0" value="{{ model.renew_single[4] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group single many">
|
||||
<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="number" class="tpl-form-input" min="0" name="data[single_price]" value="{{ model.single_price }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="data[buy_many][]" value="0">
|
||||
<input type="number" name="data[buy_many][]" min="0" value="{{ model.buy_many[1] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="{{ model.buy_many[2] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="{{ model.buy_many[3] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="{{ model.buy_many[4] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[buy_many][]" min="0" value="{{ model.buy_many[5] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group many">
|
||||
<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">
|
||||
<table class="am-table am-table-bordered">
|
||||
<tr>
|
||||
<th>一年</th>
|
||||
<th>二年</th>
|
||||
<th>三年</th>
|
||||
<th>四年</th>
|
||||
<th>五年</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="{{ model.renew_many[0] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="{{ model.renew_many[1] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="{{ model.renew_many[2] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="{{ model.renew_many[3] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="data[renew_many][]" min="0" value="{{ model.renew_many[4] }}" class="am-field-valid ipt-w40" required>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group many">
|
||||
<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="number" class="tpl-form-input" name="data[many_price]" min="0" value="{{ model.many_price }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="number" min="0" class="tpl-form-input" name="data[trial_day]" value="{{ model.trial_day }}" required>
|
||||
<small>设置0不启用</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label">备注说明 </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[detail]" value="{{ model.detail }}">
|
||||
</div>
|
||||
</div>
|
||||
<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="number" class="tpl-form-input" name="data[sort]" value="{{ model.sort }}" required>
|
||||
<small>数字越小越靠前</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
1
app/admin/view/applet/template/index.html
Normal file
1
app/admin/view/applet/template/index.html
Normal file
File diff suppressed because one or more lines are too long
55
app/admin/view/applet/tpl_genewal.html
Normal file
55
app/admin/view/applet/tpl_genewal.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!-- 模板:变更到期时间 -->
|
||||
<script id="tpl-genewal" type="text/template">
|
||||
<div class="am-padding-xs am-padding-top-sm">
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">当前到期时间</label>
|
||||
<div class="am-u-sm-8 am-u-end">
|
||||
<div class="am-form--static">{{expire}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">变更方式</label>
|
||||
<div class="am-u-sm-8 am-u-end">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mode]"
|
||||
value="inc" data-am-ucheck checked> 增加
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mode]"
|
||||
value="dec" data-am-ucheck> 减少
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[mode]"
|
||||
value="final" data-am-ucheck> 重置
|
||||
</label>
|
||||
<div class="help-block am-margin-top-sm">
|
||||
<small>重置:从今天的时间开始计算</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">变更单位</label>
|
||||
<div class="am-u-sm-8 am-u-end">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[term_unit]"
|
||||
value="10" data-am-ucheck> 天
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[term_unit]"
|
||||
value="20" data-am-ucheck> 月
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[term_unit]"
|
||||
value="30" data-am-ucheck checked> 年
|
||||
</label>
|
||||
</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 type="number" min="0" class="tpl-form-input"
|
||||
placeholder="请输入要变更的数值(整数)" name="data[term]" value="" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
67
app/admin/view/applet/wxtpl/index.html
Normal file
67
app/admin/view/applet/wxtpl/index.html
Normal file
@ -0,0 +1,67 @@
|
||||
<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">草稿列表</div>
|
||||
</div>
|
||||
<div class="tips am-margin-bottom-sm am-u-sm-12">
|
||||
<div class="pre-info">
|
||||
<p> 注:该记录为最后一次通过微信开发者工具上传的小程序草稿模板,请添加到模板库,已备后续使用,上传时建议在版本描述中注明模板类型,如“商城单门店”。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-body am-fr">
|
||||
<div class="am-scrollable-horizontal am-u-sm-12">
|
||||
<table width="100%" class="am-table am-table-hover tpl-table-black">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>草稿ID</th>
|
||||
<th>版本号</th>
|
||||
<th>描述</th>
|
||||
<th>开发者</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if sizeof($list) > 0}
|
||||
{foreach $list as $item}
|
||||
<tr>
|
||||
<td class="am-text-middle">{$item['draft_id']}</td>
|
||||
<td class="am-text-middle">
|
||||
<p class="item-title">{$item['user_version']}</p>
|
||||
</td>
|
||||
<td class="am-text-middle">{$item['user_desc']}</td>
|
||||
<td class="am-text-middle">{$item['developer']}</td>
|
||||
<td class="am-text-middle">{$item['create_time']|date='Y-m-d H:i'}</td>
|
||||
<td class="am-text-middle">
|
||||
<div class="tpl-table-black-operation">
|
||||
<a href="javascript:;" class="item-del" data-id="{$item['draft_id']}">
|
||||
<i class="am-icon-plus"></i> 添加到模板库
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else /}
|
||||
<tr>
|
||||
<td colspan="6" class="am-text-center">暂无记录</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
// 删除元素
|
||||
var url = "{:url('applet.wxtpl/add')}";
|
||||
$('.item-del').del('id', url, '确定要添加到模板库?');
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
1
app/admin/view/applet/wxtpl/lists.html
Normal file
1
app/admin/view/applet/wxtpl/lists.html
Normal file
@ -0,0 +1 @@
|
||||
<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">模板库列表</div>
</div>
<div class="tips am-margin-bottom-sm am-u-sm-12">
<div class="pre-info">
<p> 注:如果模板库数量超限,可保留不同类型最新的版本。过期版本可删除</p>
</div>
</div>
<div class="widget-body am-fr">
<div class="am-scrollable-horizontal am-u-sm-12">
<table width="100%" class="am-table am-table-hover tpl-table-black">
<thead>
<tr>
<th>模板ID</th>
<th>版本号</th>
<th>模板描述</th>
<th>模板类型</th>
<th>开发者</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{if sizeof($list) > 0}
{foreach $list as $item}
<tr>
<td class="am-text-middle">{$item['template_id']}</td>
<td class="am-text-middle">
<p class="item-title">{$item['user_version']}</p>
</td>
<td class="am-text-middle">{$item['user_desc']}</td>
<td class="am-text-middle">
{$item['template_type']?'标准':'普通'}
</td>
<td class="am-text-middle">{$item['developer']}</td>
<td class="am-text-middle">{$item['create_time']|date='Y-m-d H:i'}</td>
<td class="am-text-middle">
<div class="tpl-table-black-operation">
<a href="javascript:;" class="item-del tpl-table-black-operation-del"
data-id="{$item['template_id']}">
<i class="am-icon-trash"></i> 删除
</a>
</div>
</td>
</tr>
{/foreach}
{else /}
<tr>
<td colspan="6" class="am-text-center">暂无记录</td>
</tr>
{/if}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
// 删除元素
var url = "{:url('applet.wxtpl/delete')}";
$('.item-del').del('id', url);
});
</script>
|
||||
249
app/admin/view/apply/detail.html
Normal file
249
app/admin/view/apply/detail.html
Normal file
@ -0,0 +1,249 @@
|
||||
<!-- 认证 -->
|
||||
<script id="tpl-detail" type="text/template">
|
||||
<div class="am-padding-xs am-padding-top-sm">
|
||||
<input type="hidden" value="{{ model.business_code }}" name="data[business_code]">
|
||||
<input type="hidden" value="{{ model.apply_mode.value }}" name="data[apply_mode]">
|
||||
{{ if(model.apply_mode.value != 40) }}
|
||||
<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">
|
||||
<div class="apply-img">
|
||||
<input type="hidden" value="{{ model.details.license_copy.value }}" name="data[details][license_copy]">
|
||||
<a href="{{ model.details.license_copy.url }}" target="_blank">
|
||||
<img src="{{ model.details.license_copy.url }}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[details][subject_type]" value="SUBJECT_TYPE_INDIVIDUAL" data-am-ucheck
|
||||
{{ model.details.subject_type == 'SUBJECT_TYPE_INDIVIDUAL' ? 'checked' : '' }}> 个体
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[details][subject_type]" value="SUBJECT_TYPE_INSTITUTIONS" data-am-ucheck
|
||||
{{ model.details.subject_type == 'SUBJECT_TYPE_INSTITUTIONS' ? 'checked' : '' }}> 公司
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.merchant_name }}" name="data[details][merchant_name]" required>
|
||||
<small>营业执照上的公司名称或经营门店名称</small>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.license_number }}" name="data[details][license_number]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<div class="apply-img">
|
||||
<input type="hidden" value="{{ model.details.id_card_copy.value }}" name="data[details][id_card_copy]">
|
||||
<a href="{{ model.details.id_card_copy.url }}" target="_blank">
|
||||
<img src="{{ model.details.id_card_copy.url }}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="apply-img">
|
||||
<input type="hidden" value="{{ model.details.id_card_national.value }}" name="data[details][id_card_national]">
|
||||
<a href="{{ model.details.id_card_national.url }}" target="_blank">
|
||||
<img src="{{ model.details.id_card_national.url }}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ /if }}
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.id_card_name }}" name="data[details][id_card_name]" required>
|
||||
</div>
|
||||
</div>
|
||||
{{ if(model.apply_mode.value != 40) }}
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.id_card_number }}" name="data[details][id_card_number]" required>
|
||||
</div>
|
||||
</div>
|
||||
{{ /if }}
|
||||
{{ if(model.apply_mode.value == 30) }}
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.id_card_address }}" name="data[details][id_card_address]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.card_period_begin }}" name="data[details][card_period_begin]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.card_period_end }}" name="data[details][card_period_end]" required>
|
||||
</div>
|
||||
</div>
|
||||
{{ if(model.details.qualifications.url != '') }}
|
||||
<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">
|
||||
<div class="apply-img">
|
||||
<input type="hidden" value="{{ model.details.qualifications.value }}" name="data[details][qualifications]">
|
||||
<a href="{{ model.details.qualifications.url }}" target="_blank">
|
||||
<img src="{{ model.details.qualifications.url }}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ /if }}
|
||||
<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">
|
||||
<div class="apply-img">
|
||||
<input type="hidden" value="{{ model.details.store_entrance_pic.value }}" name="data[details][store_entrance_pic]">
|
||||
<a href="{{ model.details.store_entrance_pic.url }}" target="_blank">
|
||||
<img src="{{ model.details.store_entrance_pic.url }}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<div class="apply-img">
|
||||
<input type="hidden" value="{{ model.details.indoor_pic.value }}" name="data[details][indoor_pic]">
|
||||
<a href="{{ model.details.indoor_pic.url }}" target="_blank">
|
||||
<img src="{{ model.details.indoor_pic.url }}" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="{{ model.app_id }}" name="data[app_id]">
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.merchant_shortname }}" name="data[details][merchant_shortname]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.biz_store_address }}" name="data[details][biz_store_address]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.biz_address_code }}" name="data[details][biz_address_code]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.account_bank }}" name="data[details][account_bank]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.bank_address_code }}" name="data[details][bank_address_code]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="number" class="tpl-form-input" value="{{ model.details.account_number }}" name="data[details][account_number]" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.contact_email }}" name="data[details][contact_email]" required>
|
||||
</div>
|
||||
</div>
|
||||
{{ /if }}
|
||||
<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="number" class="tpl-form-input" value="{{ model.details.mobile_phone }}" name="data[details][mobile_phone]" required>
|
||||
</div>
|
||||
</div>
|
||||
{{ if(model.apply_mode.value == 10 || model.apply_mode.value == 20) }}
|
||||
<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="text" class="tpl-form-input" value="{{ model.details.legal_persona_wechat }}" name="data[details][legal_persona_wechat]" required>
|
||||
</div>
|
||||
</div>
|
||||
{{ /if }}
|
||||
{{ if(model.apply_mode.value == 40) }}
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[agent_mode]" value="10" data-am-ucheck
|
||||
{{ model.agent_mode.value == 10 ? 'checked' : '' }}> 县区
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[agent_mode]" value="20" data-am-ucheck
|
||||
{{ model.agent_mode.value == 20 ? 'checked' : '' }}> 市级
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[agent_mode]" value="30" data-am-ucheck
|
||||
{{ model.agent_mode.value == 30 ? 'checked' : '' }}> 省级
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" value="{{ model.province }}{{ model.city }}{{ model.district }}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
{{ /if }}
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">执行操作</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label">驳回原因 </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" value="{{ model.reject }}" name="data[reject]" {{ model.apply_status.value !=10 ? 'disabled' : '' }}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">{{ model.apply_status.value == 10?'操作动作':'当前状态' }} </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
{{ if model.apply_status.value == 10 }}
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[apply_status]" value="10" data-am-ucheck checked> 保存
|
||||
</label>
|
||||
{{ if(model.apply_mode.value == 10 || model.apply_mode.value == 30) }}
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[apply_status]" value="20" data-am-ucheck> 提交审核
|
||||
</label>
|
||||
{{ else/ }}
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[apply_status]" value="30" checked data-am-ucheck> 审核成功
|
||||
</label>
|
||||
{{ /if }}
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[apply_status]" value="40" data-am-ucheck> 资料驳回
|
||||
</label>
|
||||
{{ else/ }}
|
||||
<input type="text" value="{{ model.apply_status.text }}" disabled>
|
||||
{{ /if }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
109
app/admin/view/apply/index.html
Normal file
109
app/admin/view/apply/index.html
Normal file
@ -0,0 +1,109 @@
|
||||
<div class="row-content am-cf">
|
||||
<div class="row layui-form layui-form-pane">
|
||||
<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">{$title}列表</div>
|
||||
</div>
|
||||
<div class="widget-body am-fr">
|
||||
<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>
|
||||
{if !$list->isEmpty()}
|
||||
{foreach $list as $item}
|
||||
<tr>
|
||||
<td class="am-text-middle">{$item['apply_id']}</td>
|
||||
<td class="am-text-middle">
|
||||
<div class="goods-detail">
|
||||
<div class="goods-image">
|
||||
<img src="{$item['user']['avatar']}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="am-text-middle">{$item['user']['nickname']}</td>
|
||||
<td class="am-text-middle">{$item['user']['phone']|default='--'}</td>
|
||||
<td class="am-text-middle">{$item['pay_status']['text']}</td>
|
||||
<td class="am-text-middle">{$item['apply_status']['text']}</td>
|
||||
<td class="am-text-middle">{$item['create_time']}</td>
|
||||
<td class="am-text-middle">
|
||||
<div class="tpl-table-black-operation">
|
||||
<a href="javascript:;" class="hema-edit" data-id="{$item['apply_id']}">
|
||||
<i class="am-icon-info"></i> 认证
|
||||
</a>
|
||||
<a href="javascript:;" class="hema-del tpl-table-black-operation-del"
|
||||
data-id="{$item['apply_id']}">
|
||||
<i class="am-icon-trash"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else /}
|
||||
<tr>
|
||||
<td colspan="8" class="am-text-center">暂无记录</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="am-u-lg-12 am-cf">
|
||||
<div class="am-fr">{:$list->render()} </div>
|
||||
<div class="am-fr pagination-total am-margin-right">
|
||||
<div class="am-vertical-align-middle">总记录:{:$list->total()}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="apply/detail" /}
|
||||
<script>
|
||||
$(function () {
|
||||
//编辑
|
||||
$('.hema-edit').on('click', function () {
|
||||
var data = $(this).data();
|
||||
$.get("{:url('apply/detail')}?id=" + data.id, function (result) {
|
||||
let btn = ['取消', '确定'];
|
||||
if(result.code == 0){
|
||||
$.show_error(result.msg);
|
||||
return false;
|
||||
}
|
||||
if(result.data.model.apply_status.value > 10){
|
||||
btn = ['关闭'];
|
||||
}
|
||||
$.showAction({
|
||||
title: result.data.model.apply_mode.text + " - 资料认证",
|
||||
area: '750px',
|
||||
btn: btn,
|
||||
content: template('tpl-detail', {model:result.data.model}),
|
||||
uCheck: true,
|
||||
success: function ($content) {
|
||||
$('#my-form').formPost({
|
||||
url: "{:url('apply/detail')}?id=" + data.id
|
||||
});
|
||||
},
|
||||
btn2: function ($content) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
// 删除元素
|
||||
var url = "{:url('apply/delete')}";
|
||||
$('.hema-del').del('id', url);
|
||||
|
||||
});
|
||||
</script>
|
||||
1
app/admin/view/index/index.html
Normal file
1
app/admin/view/index/index.html
Normal file
File diff suppressed because one or more lines are too long
1
app/admin/view/layout/layout.html
Normal file
1
app/admin/view/layout/layout.html
Normal file
File diff suppressed because one or more lines are too long
79
app/admin/view/open/alipayopen.html
Normal file
79
app/admin/view/open/alipayopen.html
Normal file
@ -0,0 +1,79 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">支付宝开放平台 - 第三方应用对接</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> AppID </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[app_id]"
|
||||
value="{$model['app_id']}" placeholder="请输入应用ID" required>
|
||||
<small>获取:开放平台->第三方应用</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">AES密钥 </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[aes_key]"
|
||||
value="{$model['aes_key']}" placeholder="请输入AES密钥" required>
|
||||
<small>获取:开放平台->第三方应用->开发设置->接口内容加密方式</small>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[domain]"
|
||||
value="{$model['domain']}" placeholder="请输入域名白名单" required>
|
||||
<small>获取:开放平台->第三方应用->开发设置->域名白名单配置,填写格式:abc.baidu.com,必须要支持https协议</small>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[redirect_uri]"
|
||||
value="{$model['redirect_uri']}" placeholder="请输入授权回调地址" required>
|
||||
<small>获取:开放平台->第三方应用->开发设置->授权回调地址,设置内容:https://您的域名/applet/task/alipayopen</small>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<textarea class="" rows="3" placeholder="请输入应用私钥"
|
||||
name="data[app_private_key]" required>{$model['app_private_key']}</textarea>
|
||||
<small>获取:开放平台->第三方应用->开发设置->接口加签方式</small>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<textarea class="" rows="3" placeholder="请输入支付宝公钥"
|
||||
name="data[alipay_public_key]" required>{$model['alipay_public_key']}</textarea>
|
||||
<small>获取:开放平台->第三方应用->开发设置->接口加签方式</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
91
app/admin/view/open/wxopen.html
Normal file
91
app/admin/view/open/wxopen.html
Normal file
@ -0,0 +1,91 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">微信开放平台 - 第三方平台对接</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label">通信状态 </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<div class="am-btn-group am-btn-group-xs">
|
||||
<span class="am-btn am-radius {$model['status']['value']?'am-btn-success':'am-btn-default'}">
|
||||
<span class="am-icon-mixcloud am-icon-sm"> </span> {$model['status']['text']}
|
||||
</span>
|
||||
<small style="margin-left:20px;">每10分钟更新一次</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> AppID </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[app_id]"
|
||||
value="{$model['app_id']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> AppSecret </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[app_secret]"
|
||||
value="{$model['app_secret']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 消息校验Token </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[token]"
|
||||
value="{$model['token']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 消息加解密Key </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[encoding_aes_key]"
|
||||
value="{$model['encoding_aes_key']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<textarea class="" rows="3" placeholder="请输入服务器域名"
|
||||
name="data[api_domain]">{$model['api_domain']}</textarea>
|
||||
<small>
|
||||
建议设置多个,多个以为“;”号隔开。<br>
|
||||
第一个为主域名请确保SSL证书配置正常,其它为备用。<br>
|
||||
第一个域名SSL证书过期后请删除,启用第二个(做好配置),以此类推。<br>
|
||||
域名前请勿输入http等协议头。
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[authorize_domain]"
|
||||
value="{$model['authorize_domain']}" required>
|
||||
<small>域名格式例如:www.baidu.com</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
46
app/admin/view/open/wxweb.html
Normal file
46
app/admin/view/open/wxweb.html
Normal file
@ -0,0 +1,46 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">微信开放平台用 - 网站应对接</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> AppID </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[app_id]"
|
||||
value="{$model['app_id']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> AppSecret </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[app_secret]"
|
||||
value="{$model['app_secret']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
1
app/admin/view/passport/login.html
Normal file
1
app/admin/view/passport/login.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>管理登录 - {$web['name']}</title>
<meta name="author" content="{$web['name']}">
<meta name="keywords" content="{$web['keywords']}">
<meta name="description" content="{$web['description']}">
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="stylesheet" href="/assets/css/hema.login.css?v={$version}" />
<link rel="stylesheet" href="/assets/plugins/amazeui/amazeui.css?v={$version}" />
<script src="/assets/plugins/jquery/jquery.min.js?v={$version}"></script>
</head>
<body>
<div class="container">
<div class="login-in">
<div class="form">
<div class="title">管理登录</div>
<form id="my-form">
<div class="input">
<i class="am-icon-user"></i>
<input type="text" name="data[user_name]" value="" placeholder="请输入账号" required>
</div>
<div class="input">
<i class="am-icon-lock"></i>
<input type="password" name="data[password]" value="" placeholder="请输入密码" required>
</div>
<div style="padding:20px 0px;">
<div class="w50">
<i class="am-icon-shield"></i>
<input type="text" name="data[captcha]" value="" placeholder="请输入验证码" required>
</div>
<div class="captcha">
<img src="{:url('passport/captcha')}" alt="验证码" onclick="this.src='{:url('passport/captcha')}?r='+Math.random()" />
</div>
</div>
<div class="sub-btn">
<button class="j-submit am-btn am-btn-primary am-btn-lg am-radius" type="submit">登录</button>
</div>
</form>
</div>
<div class="version">V{$version}</div>
</div>
</div>
</body>
<script>
$(function() {
$('#my-form').formPost();
});
</script>
<script src="/assets/plugins/layer/layer.js?v={$version}"></script>
<script src="/assets/plugins/jquery/jquery.form.min.js?v={$version}"></script>
<script src="/assets/plugins/amazeui/amazeui.min.js?v={$version}"></script>
<script src="/assets/js/hema.app.js?v={$version}"></script>
</html>
|
||||
1
app/admin/view/passport/renew.html
Normal file
1
app/admin/view/passport/renew.html
Normal file
@ -0,0 +1 @@
|
||||
<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">
<form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
<div class="widget-body">
<fieldset>
<div class="widget-head am-cf">
<div class="widget-title am-fl">修改密码</div>
</div>
{if !$model or $user['user']['user_name'] == 'test'}
<div class="tips am-margin-bottom-sm am-u-sm-12">
<div class="pre-error">
账号不存在、体验用户不能进行修改密码操作!
</div>
</div>
{else /}
<div class="am-form-group"> <label class="am-u-sm-3 am-form-label"> 用户名 </label>
<div class="am-u-sm-9"> <input type="text" class="tpl-form-input"
value="{$model['user_name']}" disabled> </div>
</div>
<div class="am-form-group"> <label class="am-u-sm-3 am-form-label form-require"> 登录密码
</label>
<div class="am-u-sm-9"> <input type="password" class="tpl-form-input"
name="data[password]" value="" required> </div>
</div>
<div class="am-form-group"> <label class="am-u-sm-3 am-form-label form-require"> 确认密码
</label>
<div class="am-u-sm-9"> <input type="password" class="tpl-form-input"
name="data[password_confirm]" value="" required> </div>
</div>
<div class="am-form-group">
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg"> <button type="submit"
class="j-submit am-btn am-btn-secondary">提交 </button> </div>
</div>
{/if}
</fieldset>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
$(function() {
$('#my-form').formPost();
});
</script>
|
||||
1
app/admin/view/pay/webpay.html
Normal file
1
app/admin/view/pay/webpay.html
Normal file
File diff suppressed because one or more lines are too long
116
app/admin/view/pay/wxpayisp.html
Normal file
116
app/admin/view/pay/wxpayisp.html
Normal file
@ -0,0 +1,116 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">微信支付服务商设置</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
服务商应用 <span class="tpl-form-line-small-title"> APP_ID </span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[app_id]"
|
||||
value="{$model['app_id']}" required>
|
||||
<small>微信支付服务商关联公众号的APP_ID</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
服务商账号 <span class="tpl-form-line-small-title">MCH_ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[mch_id]"
|
||||
value="{$model['mch_id']}" required>
|
||||
<small>我还没有 <a href="https://mp.weixin.qq.com/" target="_blank">登录公众号去申请</a> 。(支付服务商只能通过公众号申请开通)</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
API密钥 <span class="tpl-form-line-small-title">APIv3</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[api_key]"
|
||||
value="{$model['api_key']}" required>
|
||||
<small>必须是32位的数字和字符组合</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">API证书</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
证书 <span class="tpl-form-line-small-title">序列号</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[api_serial_no]"
|
||||
value="{$model['api_serial_no']}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-padding-top">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
公钥 <span class="tpl-form-line-small-title">apiclient_cert.pem</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<textarea rows="6" name="data[cert_pem]">{$model['cert_pem']}</textarea>
|
||||
<small>退款功能必填:使用文本编辑器打开apiclient_cert.pem文件,将文件的全部内容复制进来</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
私钥 <span class="tpl-form-line-small-title">apiclient_key.pem</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<textarea rows="6" name="data[key_pem]">{$model['key_pem']}</textarea>
|
||||
<small>退款功能必填:使用文本编辑器打开apiclient_key.pem文件,将文件的全部内容复制进来</small>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="data[serial_no]" value="{$model['serial_no']}">
|
||||
<input type="hidden" name="data[certificates]" value="{$model['certificates']}">
|
||||
<input type="hidden" name="data[expire_time]" value="{$model['expire_time']}">
|
||||
{if !empty($model['serial_no'])}
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">平台证书</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
证书 <span class="tpl-form-line-small-title">序列号</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" value="{$model['serial_no']}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-padding-top">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
证书 <span class="tpl-form-line-small-title">报文</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<textarea rows="6" disabled>{$model['certificates']}</textarea>
|
||||
<small>到期时间:{$model['expire_time']|date='Y-m-d'},到期后会自动更新</small>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
116
app/admin/view/setting/ability.html
Normal file
116
app/admin/view/setting/ability.html
Normal file
@ -0,0 +1,116 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">功能设置</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
小程序申请 <span class="tpl-form-line-small-title">审核</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[applet_apply]" value="1" data-am-ucheck
|
||||
{$model['applet_apply'] == 1 ? 'checked':''}>
|
||||
开启
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[applet_apply]" value="0" data-am-ucheck
|
||||
{$model['applet_apply'] == 0 ? 'checked':''}>
|
||||
关闭
|
||||
</label>
|
||||
<div class="help-block">
|
||||
<small>开启:需要平台审核资料。关闭:可跳过平台审核直接提交申请</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
小程序 <span class="tpl-form-line-small-title">审核费</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="number" min="0" class="tpl-form-input" name="data[applet_fee]"
|
||||
value="{$model['applet_fee']}" required>
|
||||
<small>设置为0不收取,单位元</small>
|
||||
</div>
|
||||
</div><div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
小程序发布 <span class="tpl-form-line-small-title">上线</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[applet_online]" value="1" data-am-ucheck
|
||||
{$model['applet_online'] == 1 ? 'checked':''}>
|
||||
自动
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[applet_online]" value="0" data-am-ucheck
|
||||
{$model['applet_online'] == 0 ? 'checked':''}>
|
||||
手动
|
||||
</label>
|
||||
<div class="help-block">
|
||||
<small>用户提审的小程序代码,通过审核后是否自动上线</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
支付申请 <span class="tpl-form-line-small-title">审核</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[pay_apply]" value="1" data-am-ucheck
|
||||
{$model['pay_apply'] == 1 ? 'checked':''}>
|
||||
开启
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="data[pay_apply]" value="0" data-am-ucheck
|
||||
{$model['pay_apply'] == 0 ? 'checked':''}>
|
||||
关闭
|
||||
</label>
|
||||
<div class="help-block">
|
||||
<small>开启:需要平台审核资料。关闭:可跳过平台审核直接提交申请</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label">管理员微信ID </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[open_id]"
|
||||
value="{$model['open_id']}">
|
||||
<small>用于接收站点提醒信息。用于接收的微信关注官方公众号后,回复”id“获得。</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label">微信地图KEY </label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="text" class="tpl-form-input" name="data[wxmap]"
|
||||
value="{$model['wxmap']}">
|
||||
<small>用于商户获取微信地图计算距离。我还没有? <a href="https://lbs.qq.com/" target="_blank"> 去注册</a></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
72
app/admin/view/setting/cache/clear.html
vendored
Normal file
72
app/admin/view/setting/cache/clear.html
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">清理缓存</div>
|
||||
</div>
|
||||
<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">
|
||||
<?php foreach ($cacheList as $key => $item): ?>
|
||||
<label class="am-checkbox-inline">
|
||||
<input type="checkbox" name="cache[keys][]" value="<?= $key ?>"
|
||||
data-am-ucheck checked required>
|
||||
<?= $item['name'] ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($isForce) && $isForce === true): ?>
|
||||
<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">
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="cache[isForce]" value="0" checked
|
||||
data-am-ucheck>
|
||||
否
|
||||
</label>
|
||||
<label class="am-radio-inline">
|
||||
<input type="radio" name="cache[isForce]" value="1" data-am-ucheck>
|
||||
是
|
||||
</label>
|
||||
<div class="help-block">
|
||||
<small class="x-color-red">此操作将会强制清空缓存目录,包含用户授权登录状态、仅允许在开发环境中使用</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3">
|
||||
<small>
|
||||
<a href="<?= url('', ['isForce' => true]) ?>">
|
||||
进入强制模式</a>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
56
app/admin/view/setting/divide.html
Normal file
56
app/admin/view/setting/divide.html
Normal file
@ -0,0 +1,56 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="am-form-group">
|
||||
<div class="tips am-margin-bottom-sm am-u-sm-12">
|
||||
<div class="pre-error">
|
||||
<p> 开启前必须保证旗下的商户开启分账功能,抽取比例必须小于或者等于商户号中设置的分账比例
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">分佣参数设置</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
抽取 <span class="tpl-form-line-small-title">比例</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="number" min="0" max="30" class="tpl-form-input" name="data[extract]" value="{$model['extract']}" required>
|
||||
<small>单位百分比,取值0-30,设置为0不抽取,设置10为收取订单总额的10%。(订单总额不包含配送费)</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
|
||||
代理抽取 <span class="tpl-form-line-small-title">比例</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9 am-u-end">
|
||||
<input type="number" min="0" max="100" class="tpl-form-input" name="data[agent_extract]" value="{$model['agent_extract']}" required>
|
||||
<small>单位百分比,取值0-100,设置为0不抽取,设置50为抽取佣金总额的一半,剩余的为平台所有<br>开启此项必须保证代理配置了收款号</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#my-form').formPost();
|
||||
|
||||
});
|
||||
</script>
|
||||
24
app/admin/view/setting/link/add.html
Normal file
24
app/admin/view/setting/link/add.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!-- 添加 -->
|
||||
<script id="tpl-add" 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="text" class="tpl-form-input" name="data[name]" value="" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[url]" value="" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="number" class="tpl-form-input" name="data[sort]" value="100" required>
|
||||
<small>数字越小越靠前</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
24
app/admin/view/setting/link/edit.html
Normal file
24
app/admin/view/setting/link/edit.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!-- 编辑 -->
|
||||
<script id="tpl-edit" 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="text" class="tpl-form-input" name="data[name]" value="{{ model.name }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="text" class="tpl-form-input" name="data[url]" value="{{ model.url }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<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="number" class="tpl-form-input" name="data[sort]" value="{{ model.sort }}" required>
|
||||
<small>数字越小越靠前</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
120
app/admin/view/setting/link/index.html
Normal file
120
app/admin/view/setting/link/index.html
Normal file
@ -0,0 +1,120 @@
|
||||
<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">友情链接</div>
|
||||
</div>
|
||||
<div class="widget-body am-fr">
|
||||
<div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
|
||||
<div class="am-form-group">
|
||||
<div class="am-btn-toolbar">
|
||||
<div class="am-btn-group am-btn-group-sm">
|
||||
<a href="javascript:void(0);" class="hema-add am-btn am-btn-primary am-radius">
|
||||
<span class="am-icon-plus"></span> 添加
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if !empty($list)}
|
||||
{foreach $list as $item}
|
||||
<tr>
|
||||
<td class="am-text-middle">{$item['link_id']}</td>
|
||||
<td class="am-text-middle">
|
||||
<p>{$item['name']}</p>
|
||||
</td>
|
||||
<td class="am-text-middle">{$item['url']}</td>
|
||||
<td class="am-text-middle">{$item['sort']}</td>
|
||||
<td class="am-text-middle">{$item['create_time']}</td>
|
||||
<td class="am-text-middle">
|
||||
<div class="tpl-table-black-operation">
|
||||
<a href="javascript:;" class="hema-edit" data-id="{$item['link_id']}">
|
||||
<i class="am-icon-pencil"></i> 编辑
|
||||
</a>
|
||||
<a href="javascript:;" class="hema-del tpl-table-black-operation-del"
|
||||
data-id="{$item['link_id']}">
|
||||
<i class="am-icon-trash"></i> 删除
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else /}
|
||||
<tr>
|
||||
<td colspan="6" class="am-text-center">暂无记录</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="setting/link/add" /}
|
||||
{include file="setting/link/edit" /}
|
||||
<script>
|
||||
$(function () {
|
||||
//添加
|
||||
$('.hema-add').on('click', function () {
|
||||
$.showAction({
|
||||
title: '添加',
|
||||
area: '750px',
|
||||
content: template('tpl-add', {}),
|
||||
uCheck: true,
|
||||
success: function ($content) {
|
||||
$('#my-form').formPost({
|
||||
url: "{:url('setting.link/add')}"
|
||||
});
|
||||
},
|
||||
btn2: function ($content) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
//编辑
|
||||
$('.hema-edit').on('click', function () {
|
||||
var data = $(this).data();
|
||||
$.get("{:url('setting.link/edit')}?id=" + data.id, function (result) {
|
||||
if(result.code == 0){
|
||||
$.show_error(result.msg);
|
||||
return false;
|
||||
}
|
||||
$.showAction({
|
||||
title: '编辑',
|
||||
area: '750px',
|
||||
content: template('tpl-edit', {model:result.data.model}),
|
||||
uCheck: true,
|
||||
success: function ($content) {
|
||||
$('#my-form').formPost({
|
||||
url: "{:url('setting.link/edit')}?id=" + data.id
|
||||
});
|
||||
},
|
||||
btn2: function ($content) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
// 删除元素
|
||||
var url = "{:url('setting.link/delete')}";
|
||||
$('.hema-del').del('id', url);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
1
app/admin/view/setting/message/sms.html
Normal file
1
app/admin/view/setting/message/sms.html
Normal file
@ -0,0 +1 @@
|
||||
<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">
<form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
<div class="widget-body">
<fieldset>
<div class="widget-head am-cf">
<div class="widget-title am-fl">短信提醒配置</div>
</div>
<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">
<label class="am-radio-inline">
<input v-model="checked" type="radio" name="data[gateway]" value="" data-am-ucheck
{$model['gateway'] == '' ? 'checked':''}>
无
</label>
{foreach $list as $item}
<label class="am-radio-inline">
<input v-model="checked" type="radio" name="data[gateway]" value="{$item['value']}" data-am-ucheck
{$model['gateway'] == $item['value'] ? 'checked':''}>
{$item['text']}
</label>
{/foreach}
<div class="help-block">
<small>选择平台后,请确保在插件中心对相应的短信平台参数进行配置</small>
</div>
</div>
</div>
<div v-if="checked">
<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">
<label class="am-radio-inline">
<input type="radio" name="data[scene][captcha]" value="0" data-am-ucheck
{$model['scene']['captcha'] == 0 ? 'checked':''}>
关闭
</label>
<label class="am-radio-inline">
<input type="radio" name="data[scene][captcha]" value="1" data-am-ucheck
{$model['scene']['captcha'] == 1 ? 'checked':''}>
开启
</label>
<div class="help-block">
<small>是否启用手机短信验证码,选择平台后有效</small>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
</button>
</div>
</div>
</fieldset>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="/assets/plugins/vue/vue.min.js?v={$version}"></script>
<script>
$(function () {
new Vue({
el: '#my-form',
data: {
checked: "{$model['gateway']}"
}
});
$('#my-form').formPost();
});
</script>
|
||||
113
app/admin/view/setting/message/webtplmsg.html
Normal file
113
app/admin/view/setting/message/webtplmsg.html
Normal file
@ -0,0 +1,113 @@
|
||||
<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">
|
||||
<form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
|
||||
<div class="widget-body">
|
||||
<fieldset>
|
||||
<div class="widget-head am-cf">
|
||||
<div class="widget-title am-fl">公众号模板消息配置</div>
|
||||
</div>
|
||||
<div class="tips am-margin-bottom-sm am-u-sm-12">
|
||||
<div class="pre-info">
|
||||
<p>站点绑定公众号后设置有效:模板消息类目设置为“餐饮/餐饮”和“IT科技/互联网|电子商务”,<a href="https://mp.weixin.qq.com/" target="_blank">去设置获取模板ID</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
新订单通知 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[new_order]"
|
||||
value="{$model['new_order']}">
|
||||
<small>模板编号:OPENTM417875155</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
申请状态更新通知 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[examine]"
|
||||
value="{$model['examine']}">
|
||||
<small>模板编号:OPENTM414769250</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
账户资金变动提醒 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[balance]"
|
||||
value="{$model['balance']}">
|
||||
<small>模板编号:OPENTM415437052</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
申请受理通知 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[apply]"
|
||||
value="{$model['apply']}">
|
||||
<small>模板编号:OPENTM416620550</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
扣费失败通知 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[deduction]"
|
||||
value="{$model['deduction']}">
|
||||
<small>模板编号:OPENTM414769357</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
试用申请成功通知 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[testing]"
|
||||
value="{$model['testing']}">
|
||||
<small>模板编号:OPENTM406071616</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
退款发起通知 <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[refund]"
|
||||
value="{$model['refund']}">
|
||||
<small>模板编号:OPENTM413423705</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label class="am-u-sm-3 am-form-label">
|
||||
抢单提示(骑手) <span class="tpl-form-line-small-title">模板 ID</span>
|
||||
</label>
|
||||
<div class="am-u-sm-9">
|
||||
<input type="text" class="tpl-form-input" name="data[grab]"
|
||||
value="{$model['grab']}">
|
||||
<small>模板编号:OPENTM207709328</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
|
||||
<button type="submit" class="j-submit am-btn am-btn-secondary">提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#my-form').formPost();
|
||||
});
|
||||
</script>
|
||||
1
app/admin/view/setting/passport.html
Normal file
1
app/admin/view/setting/passport.html
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user