mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2026-01-27 04:58:11 +00:00
up niucloud
This commit is contained in:
parent
fd7f31e40a
commit
0022acba80
@ -114,8 +114,24 @@ class ExceptionHandle extends Handle
|
||||
return fail($e->getMessage(), http_code:$e->getCode());
|
||||
} else if ($e instanceof RouteNotFoundException) {
|
||||
return fail('当前访问路由未定义或不匹配 路由地址:' . request()->baseUrl());
|
||||
} else {
|
||||
} else if($e instanceof \RuntimeException){
|
||||
return fail($e->getMessage(), $massageData);
|
||||
} else {
|
||||
return $this->handleException($e);
|
||||
}
|
||||
}
|
||||
|
||||
private function handleException(\Exception $e) {
|
||||
$trace = array_map(function ($class){
|
||||
return str_replace('\\', '/', $class);
|
||||
}, array_column($e->getTrace(), 'class'));
|
||||
|
||||
foreach ($trace as $class) {
|
||||
if (preg_match('#^addon/([^/]+)/#', $class, $matches)) {
|
||||
return fail("{$matches[1]}插件内{$class}第{$e->getLine()}行出现异常,异常信息:" .$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return fail("{$trace[0]}第{$e->getLine()}行出现异常,异常信息:" .$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,6 +184,12 @@ class Diy extends BaseAdminController
|
||||
return success($diy_service->getLink());
|
||||
}
|
||||
|
||||
public function pageLink()
|
||||
{
|
||||
$diy_service = new DiyService();
|
||||
return success($diy_service->pageLink());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面模板
|
||||
* @description 获取页面模板
|
||||
|
||||
38
niucloud/app/adminapi/controller/index/PromotionAdv.php
Normal file
38
niucloud/app/adminapi/controller/index/PromotionAdv.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud-admin.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\index;
|
||||
|
||||
use app\service\admin\sys\AgreementService;
|
||||
use app\service\admin\sys\PromotionAdvService;
|
||||
use app\service\core\index\CorePromotionAdvService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 推广广告控制器
|
||||
* Class PromotionAdv
|
||||
* @package app\adminapi\controller\sys
|
||||
*/
|
||||
class PromotionAdv extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* 广告列表
|
||||
* @return Response
|
||||
*/
|
||||
public function getIndexAdvList()
|
||||
{
|
||||
$res = (new CorePromotionAdvService())->getIndexAdvList();
|
||||
return success('SUCCESS',$res);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -116,4 +116,16 @@ class System extends BaseAdminController
|
||||
]);
|
||||
return success((new SystemService())->getQrcode($params));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取imagick扩展是否开启
|
||||
* @return Response
|
||||
*/
|
||||
public function getImagickIsOpen(){
|
||||
if (extension_loaded('imagick')) {
|
||||
return success(data: true);
|
||||
} else {
|
||||
return success(data: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +56,22 @@ class Upload extends BaseAdminController
|
||||
return success($upload_service->video($data['file'], $data['cate_id']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频上传
|
||||
* @description 音频上传
|
||||
* @return Response
|
||||
*/
|
||||
public function audio()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['file', 'file'],
|
||||
['cate_id', 0]
|
||||
]);
|
||||
$upload_service = new UploadService();
|
||||
return success($upload_service->audio($data['file'], $data['cate_id']));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传(默认不上云)
|
||||
* @description 文件上传
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\adminapi\controller\verify;
|
||||
|
||||
use app\dict\verify\VerifyDict;
|
||||
use app\service\admin\verify\VerifyService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
@ -50,4 +51,31 @@ class Verify extends BaseAdminController
|
||||
{
|
||||
return success(( new VerifyService() )->getDetail($verify_code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核销类型
|
||||
* @description 获取核销类型
|
||||
* @return Response
|
||||
*/
|
||||
public function getVerifyType()
|
||||
{
|
||||
return success(VerifyDict::getType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @框架核销
|
||||
* @description 核销
|
||||
*/
|
||||
public function verify(string $verify_code)
|
||||
{
|
||||
return success('VERIFY_SUCCESS', (new VerifyService())->verify($verify_code));
|
||||
}
|
||||
/**
|
||||
* @获取核销码对应信息
|
||||
* @description 核销
|
||||
*/
|
||||
public function getInfoByCode(string $verify_code)
|
||||
{
|
||||
return success((new VerifyService())->getInfoByCode($verify_code));
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@ class AdminCheckRole
|
||||
{
|
||||
$check_role_service = new AuthService();
|
||||
$check_role_service->checkRole($request);
|
||||
|
||||
//处理用户的权限
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ use app\Request;
|
||||
use app\service\admin\site\UserLogService;
|
||||
use Closure;
|
||||
use ReflectionClass;
|
||||
use think\facade\Log;
|
||||
use think\facade\Route;
|
||||
|
||||
/**
|
||||
* admin用户操作日志
|
||||
@ -29,20 +31,28 @@ class AdminLog
|
||||
//写入日志
|
||||
if ($request->method() != 'GET') {
|
||||
$path = $request->rule()->getRoute();
|
||||
if(strstr($path,'@')){
|
||||
$arr = explode('@', $path);
|
||||
$controller = $arr[0] ?? "";
|
||||
$action = $arr[1] ?? "";
|
||||
}else{
|
||||
//暂时只有APP目录下使用这样的路由定义
|
||||
list($controllerStr, $action) = explode('/', $path, 2);
|
||||
list($module, $controller) = explode('.', $controllerStr, 2);
|
||||
// 拼接完整类名(根据 TP 命名空间规则调整)
|
||||
$controllerClass = "app\\adminapi\\controller\\{$module}\\{$controller}";
|
||||
$controller = $controllerClass;
|
||||
try {
|
||||
if (strstr($path, '@')) {
|
||||
$arr = explode('@', $path);
|
||||
$controller = $arr[0] ?? "";
|
||||
$action = $arr[1] ?? "";
|
||||
} else {
|
||||
//暂时只有APP目录下使用这样的路由定义
|
||||
list($controllerStr, $action) = explode('/', $path, 2);
|
||||
$parts = preg_split('/[\.\\\\]/', $controllerStr, 2);
|
||||
list($module, $controller) = $parts;
|
||||
if (count($parts) >= 2) {
|
||||
// 拼接完整类名(根据 TP 命名空间规则调整)
|
||||
$controllerClass = "app\\adminapi\\controller\\{$module}\\{$controller}";
|
||||
$controller = $controllerClass;
|
||||
}
|
||||
}
|
||||
$operation = $this->extractDescFromAnnotation($controller, $action);
|
||||
} catch (\Exception $e) {
|
||||
$operation = "";
|
||||
Log::write('获取路由描述错误:path' . $path . ' error' . $e->getMessage());
|
||||
}
|
||||
|
||||
$operation = $this->extractDescFromAnnotation($controller, $action);
|
||||
$data = [
|
||||
'uid' => $request->uid(),
|
||||
'username' => $request->username(),
|
||||
@ -79,7 +89,7 @@ class AdminLog
|
||||
$docComment = $method->getDocComment();
|
||||
|
||||
if (preg_match('/@description\s+(.+)/', $docComment, $matches)) {
|
||||
return (empty($controller_desc) ? "" : $controller_desc.'-').$matches[1];
|
||||
return (empty($controller_desc) ? "" : $controller_desc . '-') . $matches[1];
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
@ -54,6 +54,8 @@ Route::group('diy', function() {
|
||||
// 获取自定义链接列表
|
||||
Route::get('link', 'diy.Diy/getLink');
|
||||
|
||||
Route::get('page_link', 'diy.Diy/pageLink');
|
||||
|
||||
// 设为使用
|
||||
Route::put('use/:id', 'diy.Diy/setUse');
|
||||
|
||||
|
||||
24
niucloud/app/adminapi/route/index.php
Normal file
24
niucloud/app/adminapi/route/index.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use app\adminapi\middleware\AdminCheckToken;
|
||||
use app\adminapi\middleware\AdminLog;
|
||||
use think\facade\Route;
|
||||
|
||||
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
Route::group('index', function () {
|
||||
//首页广告列表
|
||||
Route::get('adv_list', 'index.PromotionAdv/getIndexAdvList');
|
||||
})->middleware(AdminCheckToken::class, true)
|
||||
->middleware(AdminLog::class);
|
||||
@ -106,6 +106,8 @@ Route::group('sys', function() {
|
||||
Route::post('image', 'upload.Upload/image');
|
||||
//附件视频上传
|
||||
Route::post('video', 'upload.Upload/video');
|
||||
//附件音频上传
|
||||
Route::post('audio', 'upload.Upload/audio');
|
||||
//附件上传
|
||||
Route::post('document/:type', 'upload.Upload/document');
|
||||
//附件列表
|
||||
@ -326,6 +328,11 @@ Route::group('sys', function() {
|
||||
// 打印小票内容
|
||||
Route::post('printer/printticket', 'sys.Printer/printTicket');
|
||||
|
||||
|
||||
|
||||
// 检验是否开启imagick
|
||||
Route::get('check_imagick', 'sys.System/getImagickIsOpen');
|
||||
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
|
||||
@ -24,6 +24,10 @@ Route::group('verify', function () {
|
||||
Route::get('verify/record', 'verify.Verify/lists');
|
||||
// 订单核销记录详情
|
||||
Route::get('verify/:verify_code', 'verify.Verify/detail');
|
||||
Route::get('detail/:verify_code', 'verify.Verify/getInfoByCode');
|
||||
|
||||
Route::post('verify/:verify_code', 'verify.Verify/verify');
|
||||
|
||||
|
||||
/***************************************************** 核销员相关接口 ****************************************************/
|
||||
// 添加核销员
|
||||
|
||||
@ -51,7 +51,7 @@ class Pay extends BaseApiController
|
||||
['openid', '']
|
||||
]);
|
||||
|
||||
return success('SUCCESS',(new PayService())->pay($data['type'], $data['trade_type'], $data['trade_id'], $data['return_url'], $data['quit_url'], $data['buyer_id'], $data['voucher'], $data['openid']));
|
||||
return success('SUCCESS',(new PayService())->pay($data['type'], $data['trade_type'], (int)$data['trade_id'], $data['return_url'], $data['quit_url'], $data['buyer_id'], $data['voucher'], $data['openid']));
|
||||
}
|
||||
|
||||
public function info($trade_type, $trade_id)
|
||||
|
||||
@ -19,16 +19,17 @@ class Verify extends BaseApiController
|
||||
{
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
* 生成核销码
|
||||
* @return Response
|
||||
*/
|
||||
public function getVerifyCode()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'data', [] ],
|
||||
[ 'type', '' ]
|
||||
['data', []],
|
||||
['type', ''],
|
||||
['need_barcode', 0]//是否需要条形码
|
||||
]);
|
||||
return success(data: ( new VerifyService() )->getVerifyCode($data[ 'type' ], $data[ 'data' ]));
|
||||
return success(data: (new VerifyService())->getVerifyCode($data['type'], $data['data'], $data['need_barcode']));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -38,9 +39,9 @@ class Verify extends BaseApiController
|
||||
public function getInfoByCode()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'code', '' ],
|
||||
['code', ''],
|
||||
]);
|
||||
return success(data: ( new VerifyService() )->getInfoByCode($data[ 'code' ]));
|
||||
return success(data: (new VerifyService())->getInfoByCode($data['code']));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -50,7 +51,7 @@ class Verify extends BaseApiController
|
||||
*/
|
||||
public function verify($code)
|
||||
{
|
||||
return success(data: ( new VerifyService() )->verify($code));
|
||||
return success(data: (new VerifyService())->verify($code));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,7 +60,7 @@ class Verify extends BaseApiController
|
||||
*/
|
||||
public function checkVerifier()
|
||||
{
|
||||
return success(data: ( new VerifyService() )->checkVerifier());
|
||||
return success(data: (new VerifyService())->checkVerifier());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -69,13 +70,14 @@ class Verify extends BaseApiController
|
||||
public function records()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'relate_tag', 0 ],
|
||||
[ 'type', '' ],
|
||||
[ 'code', '' ],
|
||||
[ 'keyword', '' ],
|
||||
[ 'create_time', [] ]
|
||||
['relate_tag', 0],
|
||||
['type', ''],
|
||||
['code', ''],
|
||||
['keyword', ''],
|
||||
['order_id', ''],
|
||||
['create_time', []]
|
||||
]);
|
||||
return success(data: ( new VerifyService() )->getRecordsPageByVerifier($data));
|
||||
return success(data: (new VerifyService())->getRecordsPageByVerifier($data));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,7 +87,21 @@ class Verify extends BaseApiController
|
||||
*/
|
||||
public function detail(string|int $code)
|
||||
{
|
||||
return success(data: ( new VerifyService() )->getRecordsDetailByVerifier($code));
|
||||
return success(data: (new VerifyService())->getRecordsDetailByVerifier($code));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员核销记录
|
||||
* @return Response
|
||||
*/
|
||||
public function memberRecordList()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['relate_tag', 0],
|
||||
['type', ''],
|
||||
['order_id', '']
|
||||
]);
|
||||
return success(data: (new VerifyService())->getMemberRecordsList($data));
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,9 +29,9 @@ Route::any('weapp/serve/:site_id', 'weapp.Serve/serve')
|
||||
->middleware(ApiCheckToken::class)
|
||||
->middleware(ApiLog::class);
|
||||
|
||||
Route::group(function() {
|
||||
Route::post('niucloud/notify', function() {
|
||||
return ( new CoreNotifyService() )->notify();
|
||||
Route::group(function () {
|
||||
Route::post('niucloud/notify', function () {
|
||||
return (new CoreNotifyService())->notify();
|
||||
});
|
||||
|
||||
});
|
||||
@ -39,7 +39,7 @@ Route::group(function() {
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
Route::group(function() {
|
||||
Route::group(function () {
|
||||
//获取授权地址
|
||||
Route::get('wechat/codeurl', 'wechat.Wechat/getCodeUrl');
|
||||
//获取授权信息
|
||||
@ -133,6 +133,8 @@ Route::group(function() {
|
||||
Route::get('check_verifier', 'sys.Verify/checkVerifier');
|
||||
//核销记录
|
||||
Route::get('verify_records', 'sys.Verify/records');
|
||||
//会员核销记录
|
||||
Route::get('member_verify_records', 'sys.Verify/memberRecordList');
|
||||
//核销详情
|
||||
Route::get('verify_detail/:code', 'sys.Verify/detail');
|
||||
//通过code码获取核销信息
|
||||
@ -150,7 +152,7 @@ Route::group(function() {
|
||||
->middleware(ApiCheckToken::class)
|
||||
->middleware(ApiLog::class);
|
||||
|
||||
Route::group(function() {
|
||||
Route::group(function () {
|
||||
//公众号更新用户openid
|
||||
Route::put('wechat/update_openid', 'wechat.Wechat/updateOpenid');
|
||||
//公众号更新用户openid
|
||||
@ -162,4 +164,4 @@ Route::group(function() {
|
||||
->middleware(ApiCheckToken::class, true)
|
||||
->middleware(ApiLog::class);
|
||||
//加载插件路由
|
||||
( new DictLoader("Route") )->load([ 'app_type' => 'api' ]);
|
||||
(new DictLoader("Route"))->load(['app_type' => 'api']);
|
||||
|
||||
@ -19,13 +19,13 @@ use app\service\core\sys\CoreSysConfigService;
|
||||
* @param int $http_code
|
||||
* @return Response
|
||||
*/
|
||||
function success($msg = 'SUCCESS', $data = [], int $code = 1, int $http_code = 200) : Response
|
||||
function success($msg = 'SUCCESS', $data = [], int $code = 1, int $http_code = 200): Response
|
||||
{
|
||||
if (is_array($msg)) {
|
||||
$data = $msg;
|
||||
$msg = 'SUCCESS';
|
||||
}
|
||||
return Response::create([ 'data' => $data, 'msg' => get_lang($msg), 'code' => $code ], 'json', $http_code);
|
||||
return Response::create(['data' => $data, 'msg' => get_lang($msg), 'code' => $code], 'json', $http_code);
|
||||
|
||||
}
|
||||
|
||||
@ -37,13 +37,13 @@ function success($msg = 'SUCCESS', $data = [], int $code = 1, int $http_code = 2
|
||||
* @param int $http_code
|
||||
* @return Response
|
||||
*/
|
||||
function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code = 200) : Response
|
||||
function fail($msg = 'FAIL', ?array $data = [], int $code = 0, int $http_code = 200): Response
|
||||
{
|
||||
if (is_array($msg)) {
|
||||
$data = $msg;
|
||||
$msg = 'FAIL';
|
||||
}
|
||||
return Response::create([ 'data' => $data, 'msg' => get_lang($msg), 'code' => $code ], 'json', $http_code);
|
||||
return Response::create(['data' => $data, 'msg' => get_lang($msg), 'code' => $code], 'json', $http_code);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,17 +74,17 @@ function list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'child', $root =
|
||||
// 创建基于主键的数组引用
|
||||
$refer = array();
|
||||
foreach ($list as $key => $data) {
|
||||
$refer[ $data[ $pk ] ] =& $list[ $key ];
|
||||
$refer[$data[$pk]] =& $list[$key];
|
||||
}
|
||||
foreach ($list as $key => $data) {
|
||||
// 判断是否存在parent
|
||||
$parent_id = $data[ $pid ];
|
||||
$parent_id = $data[$pid];
|
||||
if ($root == $parent_id) {
|
||||
$tree[] =& $list[ $key ];
|
||||
$tree[] =& $list[$key];
|
||||
} else {
|
||||
if (isset($refer[ $parent_id ])) {
|
||||
$parent =& $refer[ $parent_id ];
|
||||
$parent[ $child ][] =& $list[ $key ];
|
||||
if (isset($refer[$parent_id])) {
|
||||
$parent =& $refer[$parent_id];
|
||||
$parent[$child][] =& $list[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,11 +135,11 @@ function array_keys_search($array, $keys, $index = '', $is_sort = true)
|
||||
$list = array();
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (isset($array[ $key ])) {
|
||||
if (isset($array[$key])) {
|
||||
if ($is_sort) {
|
||||
$list[] = $array[ $key ];
|
||||
$list[] = $array[$key];
|
||||
} else {
|
||||
$list[ $key ] = $array[ $key ];
|
||||
$list[$key] = $array[$key];
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ function del_target_dir($path, $delDir)
|
||||
//打开目录句柄
|
||||
$handle = opendir($path);
|
||||
if ($handle) {
|
||||
while (false !== ( $item = readdir($handle) )) {
|
||||
while (false !== ($item = readdir($handle))) {
|
||||
if ($item != "." && $item != "..") {
|
||||
if (is_dir("$path/$item")) {
|
||||
del_target_dir("$path/$item", $delDir);
|
||||
@ -200,7 +200,7 @@ function system_name(?string $key = '')
|
||||
'channel_name' => env('system.channel_name', 'channel'),
|
||||
];
|
||||
if (!empty($key)) {
|
||||
return $params[ $key ];
|
||||
return $params[$key];
|
||||
} else {
|
||||
return $params;
|
||||
}
|
||||
@ -219,11 +219,11 @@ function get_date_by_time(?int $time = null)
|
||||
|
||||
function get_start_and_end_time_by_day($day = '')
|
||||
{
|
||||
$date = $day ? : date('Y-m-d');
|
||||
$date = $day ?: date('Y-m-d');
|
||||
$day_start_time = strtotime($date);
|
||||
//当天结束之间
|
||||
$day_end_time = $day_start_time + 86400;
|
||||
return [ $day_start_time, $day_end_time ];
|
||||
return [$day_start_time, $day_end_time];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -362,7 +362,7 @@ function format_money($number)
|
||||
function format_float_money($number, $precision = 2)
|
||||
{
|
||||
if ($precision > 0) {
|
||||
return sprintf('%.' . $precision . 'f', floor($number * ( 10 ** $precision )) / ( 10 ** $precision ));
|
||||
return sprintf('%.' . $precision . 'f', floor($number * (10 ** $precision)) / (10 ** $precision));
|
||||
} else {
|
||||
return sprintf('%.' . $precision . 'f', floor($number));
|
||||
}
|
||||
@ -492,19 +492,19 @@ function array_merge2(array $array1, array $array2)
|
||||
if (array_key_exists($array2_k, $array1)) {
|
||||
if (is_array($array2_v)) {
|
||||
foreach ($array2_v as $array2_kk => $array2_vv) {
|
||||
if (array_key_exists($array2_kk, $array1[ $array2_k ])) {
|
||||
if (array_key_exists($array2_kk, $array1[$array2_k])) {
|
||||
if (is_array($array2_vv)) {
|
||||
$array1[ $array2_k ][ $array2_kk ] = array_merge($array1[ $array2_k ][ $array2_kk ], $array2_vv);
|
||||
$array1[$array2_k][$array2_kk] = array_merge($array1[$array2_k][$array2_kk], $array2_vv);
|
||||
}
|
||||
} else {
|
||||
$array1[ $array2_k ][ $array2_kk ] = $array2_vv;
|
||||
$array1[$array2_k][$array2_kk] = $array2_vv;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$array1[ $array2_k ] = $array2_v;
|
||||
$array1[$array2_k] = $array2_v;
|
||||
}
|
||||
} else {
|
||||
$array1[ $array2_k ] = $array2_v;
|
||||
$array1[$array2_k] = $array2_v;
|
||||
}
|
||||
}
|
||||
return $array1;
|
||||
@ -551,8 +551,8 @@ function dir_copy(string $src = '', string $dst = '', &$files = [], $exclude_dir
|
||||
}
|
||||
$dir = opendir($src);
|
||||
dir_mkdir($dst);
|
||||
while (false !== ( $file = readdir($dir) )) {
|
||||
if (( $file != '.' ) && ( $file != '..' )) {
|
||||
while (false !== ($file = readdir($dir))) {
|
||||
if (($file != '.') && ($file != '..')) {
|
||||
if (is_dir($src . '/' . $file)) {
|
||||
// 排除目录
|
||||
if (count($exclude_dirs) && in_array($file, $exclude_dirs)) continue;
|
||||
@ -636,7 +636,7 @@ function parse_sql($content = '', $string = false, $replace = [])
|
||||
// 多行注释标记
|
||||
$comment = false;
|
||||
// 按行分割,兼容多个平台
|
||||
$content = str_replace([ "\r\n", "\r" ], "\n", $content);
|
||||
$content = str_replace(["\r\n", "\r"], "\n", $content);
|
||||
$content = explode("\n", trim($content));
|
||||
// 循环处理每一行
|
||||
foreach ($content as $line) {
|
||||
@ -728,10 +728,10 @@ function getFileMap($path, $arr = [])
|
||||
if ($file_path != '.' && $file_path != '..') {
|
||||
$temp_path = $path . '/' . $file_path;
|
||||
if (is_dir($temp_path)) {
|
||||
$arr[ $temp_path ] = $file_path;
|
||||
$arr[$temp_path] = $file_path;
|
||||
$arr = getFileMap($temp_path, $arr);
|
||||
} else {
|
||||
$arr[ $temp_path ] = $file_path;
|
||||
$arr[$temp_path] = $file_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -756,9 +756,9 @@ function cache_remember(string $name = null, $value = '', $tag = null, $options
|
||||
$value = Container::getInstance()->invokeFunction($value);
|
||||
}
|
||||
if (is_null($tag)) {
|
||||
Cache::set($name, $value, $options[ 'expire' ] ?? null);
|
||||
Cache::set($name, $value, $options['expire'] ?? null);
|
||||
} else {
|
||||
Cache::tag($tag)->set($name, $value, $options[ 'expire' ] ?? null);
|
||||
Cache::tag($tag)->set($name, $value, $options['expire'] ?? null);
|
||||
}
|
||||
return $value;
|
||||
|
||||
@ -783,7 +783,7 @@ function image_to_base64(string $path, $is_delete = false)
|
||||
{
|
||||
if (!file_exists($path)) return 'image not exist';
|
||||
|
||||
$mime = getimagesize($path)[ 'mime' ];
|
||||
$mime = getimagesize($path)['mime'];
|
||||
$image_data = file_get_contents($path);
|
||||
// 将图片转换为 base64
|
||||
$base64_data = base64_encode($image_data);
|
||||
@ -805,7 +805,7 @@ function image_to_base64(string $path, $is_delete = false)
|
||||
function get_thumb_images($site_id, $image, $thumb_type = 'all', bool $is_throw_exception = false)
|
||||
{
|
||||
|
||||
return ( new CoreImageService() )->thumb($site_id, $image, $thumb_type, $is_throw_exception);
|
||||
return (new CoreImageService())->thumb($site_id, $image, $thumb_type, $is_throw_exception);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -817,10 +817,10 @@ function version_to_int($version)
|
||||
{
|
||||
$version_array = explode(".", $version);
|
||||
|
||||
$v1 = sprintf('%03s', (int) $version_array[ 0 ] ?? 0);
|
||||
$v2 = sprintf('%03s', (int) $version_array[ 1 ] ?? 0);
|
||||
$v3 = sprintf('%03s', (int) $version_array[ 2 ] ?? 0);
|
||||
return (int) "{$v1}{$v2}{$v3}";
|
||||
$v1 = sprintf('%03s', (int)$version_array[0] ?? 0);
|
||||
$v2 = sprintf('%03s', (int)$version_array[1] ?? 0);
|
||||
$v3 = sprintf('%03s', (int)$version_array[2] ?? 0);
|
||||
return (int)"{$v1}{$v2}{$v3}";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -833,13 +833,13 @@ function version_to_string($ver)
|
||||
if ($ver > 999) {
|
||||
if ($ver > 999999) {
|
||||
$ver .= "";
|
||||
$v3 = (int) substr($ver, -3);
|
||||
$v2 = (int) substr($ver, -6, 3);
|
||||
$v1 = (int) substr($ver, 0, -6);
|
||||
$v3 = (int)substr($ver, -3);
|
||||
$v2 = (int)substr($ver, -6, 3);
|
||||
$v1 = (int)substr($ver, 0, -6);
|
||||
} else {
|
||||
$ver .= "";
|
||||
$v3 = (int) substr($ver, -3);
|
||||
$v2 = (int) substr($ver, 0, -3);
|
||||
$v3 = (int)substr($ver, -3);
|
||||
$v2 = (int)substr($ver, 0, -3);
|
||||
$v1 = 0;
|
||||
}
|
||||
} else {
|
||||
@ -898,10 +898,10 @@ function file_copy(string $source_file, string $to_file)
|
||||
* @param bool $outfile
|
||||
* @return string
|
||||
*/
|
||||
function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style = [ 'is_transparent' => true ], $outfile = true)
|
||||
function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style = ['is_transparent' => true], $outfile = true)
|
||||
{
|
||||
if ($outfile) {
|
||||
$dir = $dir ? : 'upload' . '/' . 'qrcode' . '/' . $site_id;//二维码默认存储位置
|
||||
$dir = $dir ?: 'upload' . '/' . 'qrcode' . '/' . $site_id;//二维码默认存储位置
|
||||
if (!is_dir($dir) && !mkdir($dir, 0777, true) && !is_dir($dir)) {
|
||||
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
|
||||
}
|
||||
@ -921,8 +921,8 @@ function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style
|
||||
'channel' => $channel,
|
||||
'outfile' => $outfile
|
||||
])));
|
||||
if (!empty($result[ 0 ])) {
|
||||
$path = $result[ 0 ];
|
||||
if (!empty($result[0])) {
|
||||
$path = $result[0];
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
@ -939,7 +939,7 @@ function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style
|
||||
*/
|
||||
function poster(int $site_id, $id, $type, array $param = [], string $channel = '', bool $is_throw_exception = true)
|
||||
{
|
||||
return ( new \app\service\core\poster\CorePosterService() )->get($site_id, $id, $type, $param, $channel, $is_throw_exception);
|
||||
return (new \app\service\core\poster\CorePosterService())->get($site_id, $id, $type, $param, $channel, $is_throw_exception);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -961,7 +961,7 @@ function is_url($string)
|
||||
* @param int $site_id
|
||||
* @return array
|
||||
*/
|
||||
function get_site_addons($site_id = 0) : array
|
||||
function get_site_addons($site_id = 0): array
|
||||
{
|
||||
$addons = $site_id ? Cache::get("local_install_addons_{$site_id}") : Cache::get("local_install_addons");
|
||||
return is_null($addons) ? [] : $addons;
|
||||
@ -969,7 +969,7 @@ function get_site_addons($site_id = 0) : array
|
||||
|
||||
function get_wap_domain($site_id)
|
||||
{
|
||||
$wap_url = ( new CoreSysConfigService() )->getSceneDomain($site_id)[ 'wap_url' ];
|
||||
$wap_url = (new CoreSysConfigService())->getSceneDomain($site_id)['wap_url'];
|
||||
return $wap_url;
|
||||
}
|
||||
|
||||
@ -982,7 +982,23 @@ function get_wap_domain($site_id)
|
||||
*/
|
||||
function str_sub($str, $length = 10, $is_need_apostrophe = true)
|
||||
{
|
||||
return mb_substr($str, 0, $length, 'UTF-8') . ( $is_need_apostrophe ? '...' : '' );
|
||||
return mb_substr($str, 0, $length, 'UTF-8') . ($is_need_apostrophe ? '...' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* $str为要进行截取的字符串,$length为截取长度(汉字算一个字,字母算半个字
|
||||
* @param $str
|
||||
* @param int $length
|
||||
* @param bool $is_need_apostrophe
|
||||
* @return string
|
||||
*/
|
||||
function str_sub2($str, $length = 10, $is_need_apostrophe=true)
|
||||
{
|
||||
if (mb_strlen($str, 'UTF-8') > $length) {
|
||||
return mb_substr($str, 0, $length, 'UTF-8') . ($is_need_apostrophe ? '...' : '');
|
||||
} else {
|
||||
return mb_substr($str, 0, $length, 'UTF-8');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1022,10 +1038,10 @@ function get_last_time($time = null)
|
||||
$text = floor($t / 60) . '分钟前'; //一小时内
|
||||
break;
|
||||
case $t < 60 * 60 * 24:
|
||||
$text = floor($t / ( 60 * 60 )) . '小时前'; // 一天内
|
||||
$text = floor($t / (60 * 60)) . '小时前'; // 一天内
|
||||
break;
|
||||
case $t < 60 * 60 * 24 * 3:
|
||||
$text = floor($time / ( 60 * 60 * 24 )) == 1 ? '昨天' . date('H:i', $time) : '前天' . date('H:i', $time); //昨天和前天
|
||||
$text = floor($time / (60 * 60 * 24)) == 1 ? '昨天' . date('H:i', $time) : '前天' . date('H:i', $time); //昨天和前天
|
||||
break;
|
||||
case $t < 60 * 60 * 24 * 30:
|
||||
$text = date('m-d H:i', $time); //一个月内
|
||||
@ -1062,14 +1078,14 @@ function checkDirPermissions($dir, $data = [], $exclude_dir = [])
|
||||
|
||||
try {
|
||||
if (!is_readable($dir)) {
|
||||
$data[ 'unreadable' ][] = $dir;
|
||||
$data['unreadable'][] = $dir;
|
||||
}
|
||||
if (!is_writable($dir)) {
|
||||
$data[ 'not_writable' ][] = $dir;
|
||||
$data['not_writable'][] = $dir;
|
||||
}
|
||||
if (is_readable($dir)) {
|
||||
$dh = opendir($dir);
|
||||
while (( $file = readdir($dh) ) !== false) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file === '.' || $file === '..') {
|
||||
continue;
|
||||
}
|
||||
@ -1091,16 +1107,16 @@ function checkDirPermissions($dir, $data = [], $exclude_dir = [])
|
||||
$data = checkDirPermissions($fullPath, $data, $exclude_dir); // 递归调用自身来检查子目录
|
||||
} else {
|
||||
// 如果是文件,则检查其读写权限
|
||||
if (!is_readable($fullPath)) $data[ 'unreadable' ][] = $fullPath;
|
||||
if (!is_writable($fullPath)) $data[ 'not_writable' ][] = $fullPath;
|
||||
if (!is_readable($fullPath)) $data['unreadable'][] = $fullPath;
|
||||
if (!is_writable($fullPath)) $data['not_writable'][] = $fullPath;
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
return $data;
|
||||
} catch (Exception $e) {
|
||||
$data[ 'unreadable' ][] = $dir;
|
||||
$data[ 'not_writable' ][] = $dir;
|
||||
$data['unreadable'][] = $dir;
|
||||
$data['not_writable'][] = $dir;
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,4 +75,166 @@ class CommonActiveDict
|
||||
];
|
||||
return !empty($active) ? $data[$active] : $data;
|
||||
}
|
||||
|
||||
// 活动背景特效
|
||||
const ACTIVE_BG_EFFECT = [
|
||||
'normal' => [
|
||||
'title' => '无特效',
|
||||
'child_list' => []
|
||||
],
|
||||
'promotion' => [
|
||||
'title' => '促销',
|
||||
'child_list' => [
|
||||
'red_packet' => '红包',
|
||||
'gift_box' => '礼盒',
|
||||
'big_wing' => '大元宝'
|
||||
]
|
||||
],
|
||||
// 'graph' => [
|
||||
// 'title' => '图形',
|
||||
// 'child_list' => [
|
||||
// 'english_letters' => '英文字母',
|
||||
// 'lantern' => '灯笼',
|
||||
// 'love' => '爱心'
|
||||
// ]
|
||||
// ],
|
||||
// 'natural' => [
|
||||
// 'title' => '自然',
|
||||
// 'child_list' => [
|
||||
// 'roses' => '玫瑰花',
|
||||
// 'petals' => '花瓣',
|
||||
// ]
|
||||
// ],
|
||||
'festival' => [
|
||||
'title' => '节庆',
|
||||
'child_list' => [
|
||||
// 'santa_claus' => '圣诞老人',
|
||||
// 'christmas_trees' => '圣诞树',
|
||||
'blessing' => '花瓣',
|
||||
'firecrackers' => '爆竹',
|
||||
'i_love_you' => '我爱你',
|
||||
'kongmin_light' => '孔明灯',
|
||||
// 'zongzi' => '粽子',
|
||||
// 'moon_cake' => '月饼',
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
// 背景音乐模板
|
||||
const ACTIVE_BG_MUSIC = [
|
||||
'popular' => [
|
||||
'title' => '流行',
|
||||
'child_list' => [
|
||||
// 'red_packet_bonus_song' => [
|
||||
// 'title' => '红包返利歌曲',
|
||||
// 'url' => ''
|
||||
// ],
|
||||
'quiet_guitar_soundtrack' => [
|
||||
'title' => '安静吉他配乐',
|
||||
'url' => 'static/resource/audio/quiet_guitar_soundtrack.mp3'
|
||||
],
|
||||
'city_of_hope' => [
|
||||
'title' => 'City Of Hope',
|
||||
'url' => 'static/resource/audio/city_of_hope.mp3'
|
||||
],
|
||||
'intro' => [
|
||||
'title' => 'Intro',
|
||||
'url' => 'static/resource/audio/intro.mp3'
|
||||
],
|
||||
'dreams_exploring_world' => [
|
||||
'title' => '探索世界的梦想',
|
||||
'url' => 'static/resource/audio/dreams_exploring_world.mp3'
|
||||
],
|
||||
]
|
||||
],
|
||||
'holiday' => [
|
||||
'title' => '节日',
|
||||
'child_list' => [
|
||||
'spring_festival_overture' => [
|
||||
'title' => '过年春节序曲',
|
||||
'url' => 'static/resource/audio/spring_festival_overture.mp3'
|
||||
],
|
||||
]
|
||||
],
|
||||
'classical' => [
|
||||
'title' => '古典',
|
||||
'child_list' => [
|
||||
'elegant_chinese_style' => [
|
||||
'title' => '古典高雅中国风',
|
||||
'url' => 'static/resource/audio/elegant_chinese_style.mp3'
|
||||
],
|
||||
'city_hope_soundtrack' => [
|
||||
'title' => '希望之城配乐',
|
||||
'url' => 'static/resource/audio/city_hope_soundtrack.mp3'
|
||||
],
|
||||
'ink_painting_chinese_style' => [
|
||||
'title' => '墨水画中国风',
|
||||
'url' => 'static/resource/audio/ink_painting_chinese_style.mp3'
|
||||
],
|
||||
]
|
||||
],
|
||||
'epic' => [
|
||||
'title' => '史诗',
|
||||
'child_list' => [
|
||||
'destiny_honor' => [
|
||||
'title' => 'Destiny & Honor',
|
||||
'url' => 'static/resource/audio/destiny_honor.mp3'
|
||||
],
|
||||
'electric_romeo' => [
|
||||
'title' => 'Electric Romeo',
|
||||
'url' => 'static/resource/audio/electric_romeo.mp3'
|
||||
],
|
||||
]
|
||||
],
|
||||
'piano' => [
|
||||
'title' => '钢琴',
|
||||
'child_list' => [
|
||||
'tapeworm_compilation' => [
|
||||
'title' => 'Tapeworm Compilation I',
|
||||
'url' => 'static/resource/audio/tapeworm_compilation.mp3'
|
||||
],
|
||||
]
|
||||
],
|
||||
'happy' => [
|
||||
'title' => '欢快',
|
||||
'child_list' => [
|
||||
'laugh_smile_no_vox' => [
|
||||
'title' => 'A Laugh And A Smile No Vox',
|
||||
'url' => 'static/resource/audio/laugh_smile_no_vox.mp3'
|
||||
],
|
||||
'easy_run_soundtrack' => [
|
||||
'title' => '轻松奔跑配乐',
|
||||
'url' => 'static/resource/audio/easy_run_soundtrack.mp3'
|
||||
],
|
||||
'theme_happy_no_1' => [
|
||||
'title' => 'Theme-Happy No.1',
|
||||
'url' => 'static/resource/audio/theme_happy_no_1.mp3'
|
||||
],
|
||||
'sunny_jim' => [
|
||||
'title' => 'Sunny Jim',
|
||||
'url' => 'static/resource/audio/sunny_jim.mp3'
|
||||
],
|
||||
'energetic_warm_soundtrack' => [
|
||||
'title' => '活力温暖配乐',
|
||||
'url' => 'static/resource/audio/energetic_warm_soundtrack.mp3'
|
||||
],
|
||||
'light_soothing_soundtrack' => [
|
||||
'title' => '轻快舒缓配乐',
|
||||
'url' => 'static/resource/audio/light_soothing_soundtrack.mp3'
|
||||
],
|
||||
'inspirational_bright_music' => [
|
||||
'title' => '励志明亮配乐',
|
||||
'url' => 'static/resource/audio/inspirational_bright_music.mp3'
|
||||
],
|
||||
'sharp_rhythm_whistling' => [
|
||||
'title' => '节奏鲜明口哨',
|
||||
'url' => 'static/resource/audio/sharp_rhythm_whistling.mp3'
|
||||
],
|
||||
'cheerful_korean_music' => [
|
||||
'title' => '欢快韩风配乐',
|
||||
'url' => 'static/resource/audio/cheerful_korean_music.mp3'
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
@ -527,9 +527,9 @@ return [
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '编辑分组',
|
||||
'menu_key' => 'edit_attachment_category',
|
||||
'menu_short_name' => '编辑分组',
|
||||
'menu_name' => '删除分组',
|
||||
'menu_key' => 'del_attachment_category',
|
||||
'menu_short_name' => '删除分组',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'sys/attachment/category/<id>',
|
||||
|
||||
@ -231,6 +231,20 @@ return [
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '删除分组',
|
||||
'menu_key' => 'del_attachment_category',
|
||||
'menu_short_name' => '删除分组',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'sys/attachment/category/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'delete',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
]
|
||||
]
|
||||
],
|
||||
@ -880,7 +894,7 @@ return [
|
||||
'router_path' => 'app/marketing',
|
||||
'view_path' => 'app/marketing',
|
||||
'methods' => 'get',
|
||||
'sort' => '50',
|
||||
'sort' => '160',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
@ -889,7 +903,8 @@ return [
|
||||
[
|
||||
'menu_name' => '核销管理',
|
||||
'menu_key' => 'verify',
|
||||
'menu_short_name' => '核销管理',
|
||||
'menu_short_name' => '核销',
|
||||
'parent_key' => 'addon',
|
||||
'menu_type' => '0',
|
||||
'icon' => '',
|
||||
'api_url' => '',
|
||||
@ -898,8 +913,22 @@ return [
|
||||
'methods' => 'get',
|
||||
'sort' => '48',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '核销台',
|
||||
'menu_key' => 'verify_index',
|
||||
'menu_short_name' => '核销',
|
||||
'menu_type' => '1',
|
||||
'icon' => '',
|
||||
'api_url' => '',
|
||||
'router_path' => 'marketing/verify/index',
|
||||
'view_path' => 'marketing/verify_index',
|
||||
'methods' => 'get',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '核销员',
|
||||
'menu_key' => 'verifier_list',
|
||||
@ -992,6 +1021,7 @@ return [
|
||||
'menu_name' => '签到管理',
|
||||
'menu_key' => 'sign',
|
||||
'menu_short_name' => '签到管理',
|
||||
'parent_key' => 'active',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'element FolderChecked',
|
||||
'api_url' => '',
|
||||
@ -1000,7 +1030,7 @@ return [
|
||||
'methods' => 'get',
|
||||
'sort' => '30',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '签到设置',
|
||||
@ -1073,7 +1103,7 @@ return [
|
||||
'router_path' => 'app/index',
|
||||
'view_path' => 'app/index',
|
||||
'methods' => 'get',
|
||||
'sort' => '50',
|
||||
'sort' => '130',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
@ -2483,6 +2513,7 @@ return [
|
||||
'menu_name' => '万能表单',
|
||||
'menu_key' => 'diy_form',
|
||||
'menu_short_name' => '万能表单',
|
||||
'parent_key' => 'addon',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'element Files',
|
||||
'api_url' => '',
|
||||
@ -2532,6 +2563,7 @@ return [
|
||||
'menu_name' => '数据导出',
|
||||
'menu_key' => 'setting_export',
|
||||
'menu_short_name' => '数据导出',
|
||||
'parent_key' => 'addon',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'element Files',
|
||||
'api_url' => '',
|
||||
@ -2544,9 +2576,9 @@ return [
|
||||
'menu_attr' => 'setting_export',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '数据导出列表',
|
||||
'menu_name' => '数据导出',
|
||||
'menu_key' => 'setting_export_list',
|
||||
'menu_short_name' => '数据导出列表',
|
||||
'menu_short_name' => '列表',
|
||||
'menu_type' => '1',
|
||||
'icon' => 'element FolderChecked',
|
||||
'api_url' => 'sys/export',
|
||||
@ -2581,6 +2613,7 @@ return [
|
||||
'menu_name' => '打印管理',
|
||||
'menu_key' => 'printer_management',
|
||||
'menu_short_name' => '打印管理',
|
||||
'parent_key' => 'addon',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'element Files',
|
||||
'api_url' => '',
|
||||
|
||||
@ -29,7 +29,7 @@ return [
|
||||
"y" => 759,
|
||||
"angle" => 0,
|
||||
"zIndex" => 8,
|
||||
"fontFamily" => "static/font/SourceHanSansCN-Regular.ttf",
|
||||
"fontFamily" => "static/font/PingFang-Medium.ttf",
|
||||
"fontSize" => 24,
|
||||
"weight" => false,
|
||||
"lineHeight" => 20,
|
||||
@ -75,7 +75,7 @@ return [
|
||||
"y" => 1097,
|
||||
"angle" => 0,
|
||||
"zIndex" => 10,
|
||||
"fontFamily" => "static/font/SourceHanSansCN-Regular.ttf",
|
||||
"fontFamily" => "static/font/PingFang-Medium.ttf",
|
||||
"fontSize" => 26,
|
||||
"weight" => false,
|
||||
"lineHeight" => 26,
|
||||
@ -98,7 +98,7 @@ return [
|
||||
"y" => 570,
|
||||
"angle" => 0,
|
||||
"zIndex" => 4,
|
||||
"fontFamily" => "static/font/SourceHanSansCN-Regular.ttf",
|
||||
"fontFamily" => "static/font/PingFang-Medium.ttf",
|
||||
"fontSize" => 26,
|
||||
"weight" => false,
|
||||
"lineHeight" => 10,
|
||||
@ -139,7 +139,7 @@ return [
|
||||
"y" => 512,
|
||||
"angle" => 0,
|
||||
"zIndex" => 6,
|
||||
"fontFamily" => "static/font/SourceHanSansCN-Regular.ttf",
|
||||
"fontFamily" => "static/font/PingFang-Medium.ttf",
|
||||
"fontSize" => 30,
|
||||
"weight" => false,
|
||||
"lineHeight" => 10,
|
||||
|
||||
@ -39,4 +39,5 @@ class ConfigKeyDict
|
||||
public const WECHAT_TRANSFER_SCENE_CONFIG = 'WECHAT_TRANSFER_SCENE_CONFIG';//微信转账场景配置
|
||||
|
||||
public const SMS = 'SMS';//短信配置
|
||||
public const PINTUAN_ORDER_CONFIG = 'PINTUAN_ORDER_CONFIG';//拼团订单配置
|
||||
}
|
||||
|
||||
@ -17,6 +17,9 @@ class FileDict
|
||||
public const IMAGE = 'image';
|
||||
//上传方式 视频
|
||||
public const VIDEO = 'video';
|
||||
|
||||
//上传方式 音频
|
||||
public const AUDIO = 'audio';
|
||||
//上传方式 文件
|
||||
public const DOCUMENT = 'document';
|
||||
|
||||
@ -41,6 +44,7 @@ class FileDict
|
||||
return [
|
||||
self::IMAGE => get_lang('dict_file.type_image'),//图片
|
||||
self::VIDEO => get_lang('dict_file.type_video'),//视频
|
||||
self::AUDIO => get_lang('dict_file.type_audio'),//视频
|
||||
];
|
||||
}
|
||||
|
||||
@ -69,6 +73,7 @@ class FileDict
|
||||
self::ALIYUN,//阿里云相关上传
|
||||
self::IMAGE,//图片上传
|
||||
self::VIDEO,//视频上传
|
||||
self::AUDIO,//视频上传
|
||||
self::APPLET,//小程序包上传
|
||||
self::EXCEL,//excel导入
|
||||
];
|
||||
|
||||
@ -347,8 +347,10 @@ class Index extends BaseInstall
|
||||
if (!$site->isEmpty()) {
|
||||
$site->save([
|
||||
'site_name' => $admin_name,
|
||||
'icon'=>'static/resource/images/site/icon.png'
|
||||
]);
|
||||
}
|
||||
|
||||
//修改自增主键默认值
|
||||
Db::execute("alter table " . env('database.prefix', '') . "site auto_increment = 100000");
|
||||
//获取默认套餐
|
||||
|
||||
@ -4920,3 +4920,28 @@ INSERT INTO `sys_area` VALUES
|
||||
(460400407, 460400, '国营八一农场', '国营八一农场', '109.364519', '19.413460', 3, 0, 1),
|
||||
(460400499, 460400, '洋浦经济开发区', '洋浦经济开发区', '109.202064', '19.736941', 3, 0, 1),
|
||||
(460400500, 460400, '华南热作学院', '华南热作学院', '109.494073', '19.505382', 3, 0, 1);
|
||||
|
||||
|
||||
ALTER TABLE `verify` CHANGE COLUMN `verifier_member_id` `verifier_member_id` INT NOT NULL DEFAULT 0 COMMENT '核销员的会员id';
|
||||
|
||||
ALTER TABLE `verify`ADD COLUMN `is_admin` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否后台核销0-否1-是';
|
||||
|
||||
CREATE TABLE `activity_exchange_code`
|
||||
(
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`site_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`code` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '兑换码',
|
||||
`status` VARCHAR(20) NOT NULL DEFAULT 'normal' COMMENT 'normal-正常 received-被领取',
|
||||
`activity_type` VARCHAR(20) NOT NULL DEFAULT '' COMMENT 'seckill-秒杀活动',
|
||||
`activity_id` INT(11) NOT NULL DEFAULT 0 COMMENT '活动ID',
|
||||
`type` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '类型 例seckill_goods-秒杀商品',
|
||||
`type_id` INT(11) NOT NULL DEFAULT 0 COMMENT '类型对应id 秒杀商品id',
|
||||
`expire_time` INT(11) NOT NULL DEFAULT 0 COMMENT '过期时间 0-不过期',
|
||||
`member_id` INT(11) NOT NULL DEFAULT 0 COMMENT '领取会员',
|
||||
`received_time` INT(11) NOT NULL DEFAULT 0 COMMENT '领取时间',
|
||||
`order_id` INT(11) NOT NULL DEFAULT 0 COMMENT '对应订单id',
|
||||
`admin_username` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '操作人名称(添加人)',
|
||||
`admin_id` INT(11) NOT NULL DEFAULT 0 COMMENT '操作人id',
|
||||
`create_time` INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='活动兑换码表';
|
||||
@ -13,6 +13,7 @@ namespace app\job\notice;
|
||||
|
||||
use core\base\BaseJob;
|
||||
use core\exception\NoticeException;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 消息发送任务
|
||||
@ -34,10 +35,13 @@ class Notice extends BaseJob
|
||||
//通过业务获取模板变量属于以及发送对象
|
||||
$result = event('NoticeData', ['site_id' => $site_id, 'key' => $key, 'data' => $data, 'template' => $template]);
|
||||
$notice_data = array_values(array_filter($result))[0] ?? [];
|
||||
Log::write("消息发送任务");
|
||||
Log::write($notice_data);
|
||||
if (empty($notice_data)) throw new NoticeException('NOTICE_TEMPLATE_IS_NOT_EXIST');
|
||||
event('Notice', ['site_id' => $site_id, 'key' => $key, 'to' => $notice_data['to'], 'vars' => $notice_data['vars'], 'template' => $template]);
|
||||
return true;
|
||||
}catch (\Exception $e){
|
||||
Log::write("消息发送任务异常".$e->getMessage());
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ return [
|
||||
'EDIT_SUCCESS' => '编辑成功',
|
||||
'DELETE_SUCCESS' => '删除成功',
|
||||
'MODIFY_SUCCESS' => '更新成功',
|
||||
'VERIFY_SUCCESS' => '核销成功',
|
||||
'FAIL' => '操作失败',
|
||||
'SAVE_FAIL' => '保存失败',
|
||||
'EDIT_FAIL' => '修改失败',
|
||||
@ -155,6 +156,7 @@ return [
|
||||
'MEMBER_TYPE_NOT_EXIST' => '账户类型不存在',
|
||||
'MEMBER_IS_EXIST' => '账号已存在',
|
||||
'MEMBER_NO_IS_EXIST' => '会员编号已存在',
|
||||
'MEMBER_NO_CREATE_ERROR' => '会员编号创建失败',
|
||||
'REG_CHANNEL_NOT_EXIST' => '无效的注册渠道',
|
||||
'MEMBER_USERNAME_LOGIN_NOT_OPEN' => '未开启账号登录注册',
|
||||
'AUTH_LOGIN_NOT_OPEN' => '未开启第三方登录注册',
|
||||
|
||||
@ -79,6 +79,7 @@ return [
|
||||
'dict_sms_api' => [
|
||||
'template_status_again_report' => '需重新报备',
|
||||
'template_status_need_edit' => '需修改报备参数',
|
||||
'template_status_need_pull' => '需拉取同步状态',
|
||||
'template_status_not_report' => '未报备',
|
||||
'template_status_wait' => '待审核',
|
||||
'template_status_pass' => '审核通过',
|
||||
@ -103,6 +104,7 @@ return [
|
||||
//上传附件类型
|
||||
'type_image' => '图片',
|
||||
'type_video' => '视频',
|
||||
'type_audio' => '音频',
|
||||
//存储方式
|
||||
'storage_type_local' => '本地存储',
|
||||
'storage_type_qiniu' => '七牛云',
|
||||
|
||||
@ -7,6 +7,7 @@ use app\service\core\member\CoreMemberService;
|
||||
use app\service\core\notice\CoreNoticeLogService;
|
||||
use core\exception\NoticeException;
|
||||
use core\template\TemplateLoader;
|
||||
use think\facade\Log;
|
||||
|
||||
class Weapp
|
||||
{
|
||||
@ -19,6 +20,7 @@ class Weapp
|
||||
$key = $data['key'];
|
||||
$to = $data['to'];//发送对象主题
|
||||
|
||||
Log::write("小程序消息发送" . json_encode($data));
|
||||
//完全信任消息的设置, 不再依赖support_type
|
||||
if ($template['is_weapp']) {
|
||||
$member_id = $to['member_id'] ?? 0;
|
||||
@ -27,6 +29,7 @@ class Weapp
|
||||
$openid = $info['weapp_openid'] ?? '';
|
||||
$nickname = $info['nickname'] ?? '';
|
||||
}
|
||||
Log::write("小程序消息发送 member_id:{$member_id} openid:{$openid}");
|
||||
if (!empty($openid)) {
|
||||
$weapp_template_id = $template['weapp_template_id'];
|
||||
$weapp = $template['weapp'];
|
||||
@ -50,6 +53,8 @@ class Weapp
|
||||
'params' => $data,
|
||||
'content' => $weapp
|
||||
);
|
||||
|
||||
Log::write("小程序消息发送参数" . json_encode($log_data));
|
||||
try {
|
||||
(new TemplateLoader(NoticeTypeDict::WEAPP, ['site_id' => $site_id]))->send(
|
||||
[
|
||||
@ -59,7 +64,7 @@ class Weapp
|
||||
'page' => $url,
|
||||
]);
|
||||
(new CoreNoticeLogService())->add($site_id, $log_data);
|
||||
} catch ( NoticeException $e ) {
|
||||
} catch (NoticeException $e) {
|
||||
$log_data['result'] = $e->getMessage();
|
||||
(new CoreNoticeLogService())->add($site_id, $log_data);
|
||||
//这儿决定要不要抛出
|
||||
|
||||
@ -33,7 +33,7 @@ class WechatQrcodeListener extends BaseNoticeTemplate
|
||||
$url .= '?'.implode('&', $scene);
|
||||
}
|
||||
ob_start();//开启缓冲区
|
||||
\core\util\QRcode::png($url, $path, QR_ECLEVEL_L, 4, 1);
|
||||
\core\util\QRcode::png($url, $path, QR_ECLEVEL_L, 10, 1);
|
||||
if($outfile === false){
|
||||
$img = ob_get_contents();//获取缓冲区内容
|
||||
$path = 'data:image/png;base64,' . base64_encode($img);//转base64
|
||||
|
||||
@ -30,6 +30,13 @@ class ShowAppListener
|
||||
],
|
||||
// 工具
|
||||
'tool' => [
|
||||
[
|
||||
'title' => '核销管理',
|
||||
'desc' => '管理核销员及核销记录',
|
||||
'icon' => 'static/resource/images/marketing/verifier.png',
|
||||
'key' => 'verify',
|
||||
'url' => '/marketing/verifier',
|
||||
],
|
||||
[
|
||||
'title' => '万能表单',
|
||||
'desc' => '适用于各种应用场景,满足多样化的业务需求',
|
||||
@ -51,6 +58,7 @@ class ShowAppListener
|
||||
'key' => 'setting_export',
|
||||
'url' => '/setting/export',
|
||||
],
|
||||
|
||||
],
|
||||
// 营销
|
||||
'promotion' => [
|
||||
|
||||
@ -30,17 +30,9 @@ class ShowMarketingListener
|
||||
],
|
||||
// 工具
|
||||
'tool' => [
|
||||
|
||||
],
|
||||
// 营销
|
||||
'marketing' => [
|
||||
[
|
||||
'title' => '核销管理',
|
||||
'desc' => '管理核销员及核销记录',
|
||||
'icon' => 'static/resource/images/marketing/verifier.png',
|
||||
'key' => 'verify',
|
||||
'url' => '/marketing/verifier',
|
||||
],
|
||||
[
|
||||
'title' => '签到管理',
|
||||
'desc' => '客户每日签到发放奖励',
|
||||
|
||||
@ -27,7 +27,7 @@ class SiteInitListener
|
||||
'diy_form_records_fields', //万能表单填写字段表
|
||||
'diy_form_submit_config', //万能表单提交页配置表
|
||||
'diy_form_write_config', //万能表单填写配置表
|
||||
'diy_page', //自定义页面
|
||||
// 'diy_page', //自定义页面 todo有点问题先注释 事件顺序问题
|
||||
'diy_route', //自定义路由
|
||||
'diy_theme', //自定义主题配色表
|
||||
'member', //会员表
|
||||
@ -58,7 +58,7 @@ class SiteInitListener
|
||||
'sys_notice_sms_log', //短信发送表
|
||||
'sys_notice_sms_log', //短信发送表
|
||||
'sys_role', //角色表
|
||||
'sys_poster', //海报表
|
||||
// 'sys_poster', //海报表 todo有点问题先注释 事件顺序问题
|
||||
'sys_printer', //小票打印机
|
||||
'sys_printer_template', //小票打印模板
|
||||
'sys_schedule', //系统任务
|
||||
|
||||
@ -201,7 +201,11 @@ class Diy extends BaseModel
|
||||
public function searchTypeAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("type", $value);
|
||||
if(is_array($value)){
|
||||
$query->where("type", 'in', $value);
|
||||
}else{
|
||||
$query->where("type", $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ use app\dict\member\MemberDict;
|
||||
use app\dict\member\MemberLoginTypeDict;
|
||||
use app\dict\member\MemberRegisterChannelDict;
|
||||
use app\dict\member\MemberRegisterTypeDict;
|
||||
use app\dict\sys\FileDict;
|
||||
use core\base\BaseModel;
|
||||
use think\db\Query;
|
||||
use think\model\concern\SoftDelete;
|
||||
@ -275,5 +276,15 @@ class Member extends BaseModel
|
||||
{
|
||||
return $this->hasOne(MemberLevel::class, 'level_id', 'member_level')->bind([ 'member_level_name' => 'level_name' ]);
|
||||
}
|
||||
/**
|
||||
* 获取头像缩略图(小)
|
||||
*/
|
||||
public function getHeadimgSmallAttr($value, $data)
|
||||
{
|
||||
if (isset($data['headimg']) && $data['headimg'] != '') {
|
||||
return get_thumb_images($data['site_id'], $data['headimg'], FileDict::SMALL);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ class Verify extends BaseModel
|
||||
protected $name = 'verify';
|
||||
|
||||
// 设置json类型字段
|
||||
protected $json = [ 'data', 'value' ];
|
||||
protected $json = ['data', 'value'];
|
||||
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
@ -120,14 +120,43 @@ class Verify extends BaseModel
|
||||
*/
|
||||
public function searchCreateTimeAttr(Query $query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[ 0 ]) ? 0 : strtotime($value[ 0 ]);
|
||||
$end_time = empty($value[ 1 ]) ? 0 : strtotime($value[ 1 ]);
|
||||
$start_time = empty($value[0]) ? 0 : strtotime($value[0]);
|
||||
$end_time = empty($value[1]) ? 0 : strtotime($value[1]);
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$query->whereBetweenTime('create_time', $start_time, $end_time);
|
||||
} else if ($start_time > 0 && $end_time == 0) {
|
||||
$query->where([ [ 'create_time', '>=', $start_time ] ]);
|
||||
$query->where([['create_time', '>=', $start_time]]);
|
||||
} else if ($start_time == 0 && $end_time > 0) {
|
||||
$query->where([ [ 'create_time', '<=', $end_time ] ]);
|
||||
$query->where([['create_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单id搜索
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function searchOrderIdAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("data", "like", '%"' . $value . '"%');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员id搜索
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function searchMemberIdAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("data", "like", '%"' . $value . '"%');
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,9 +168,9 @@ class Verify extends BaseModel
|
||||
*/
|
||||
public function getTypeNameAttr($value, $data)
|
||||
{
|
||||
if (empty($data[ 'type' ]))
|
||||
if (empty($data['type']))
|
||||
return '';
|
||||
return VerifyDict::getType()[ $data[ 'type' ] ][ 'name' ] ?? '';
|
||||
return VerifyDict::getType()[$data['type']]['name'] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -75,7 +75,6 @@ class AuthService extends BaseAdminService
|
||||
|
||||
$menu_service = new MenuService();
|
||||
$all_menu_list = $menu_service->getAllApiList($this->app_type);
|
||||
|
||||
//先判断当前访问的接口是否收到权限的限制
|
||||
$method_menu_list = $all_menu_list[ $method ] ?? [];
|
||||
if (!in_array($rule, $method_menu_list)) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,7 @@ use core\exception\AdminException;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 会员服务层
|
||||
@ -44,11 +45,11 @@ class MemberService extends BaseAdminService
|
||||
public function getPage(array $where = [])
|
||||
{
|
||||
$field = 'member_id, member_no, site_id, username, mobile, password, register_channel, register_type, nickname, headimg, member_level, member_label, wx_openid, weapp_openid, wx_unionid, ali_openid, douyin_openid, login_ip, login_type, login_channel, login_count, login_time, create_time, last_visit_time, last_consum_time, sex, status, birthday, point, point_get, balance, balance_get, growth, growth_get, is_member, member_time, is_del, province_id, city_id, district_id, address, location, delete_time, money, money_get, commission, commission_get, commission_cash_outing';
|
||||
$search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'keyword', 'register_type', 'create_time', 'is_del', 'member_label', 'register_channel', 'member_level' ], $where)
|
||||
$search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['keyword', 'register_type', 'create_time', 'is_del', 'member_label', 'register_channel', 'member_level'], $where)
|
||||
->field($field)
|
||||
->order('member_id desc')
|
||||
->with('member_level_name_bind')
|
||||
->append([ 'register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name' ]);
|
||||
->append(['register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name']);
|
||||
return $this->pageQuery($search_model, function ($item, $key) {
|
||||
$item = $this->makeUp($item);
|
||||
});
|
||||
@ -65,11 +66,11 @@ class MemberService extends BaseAdminService
|
||||
public function getList(array $where = [])
|
||||
{
|
||||
$field = 'member_id, nickname, headimg';
|
||||
$temp_where[] = [ 'site_id', '=', $this->site_id ];
|
||||
if (!empty($where[ 'member_ids' ])) {
|
||||
$temp_where[] = [ 'member_id', 'in', implode(',', $where[ 'member_ids' ]) ];
|
||||
$temp_where[] = ['site_id', '=', $this->site_id];
|
||||
if (!empty($where['member_ids'])) {
|
||||
$temp_where[] = ['member_id', 'in', implode(',', $where['member_ids'])];
|
||||
}
|
||||
return $this->model->where($temp_where)->withSearch([ 'keyword' ], $where)->field($field)->order('member_id desc')->limit($this->getPageParam()[ 'limit' ] ?? 0)->select()->toArray();
|
||||
return $this->model->where($temp_where)->withSearch(['keyword'], $where)->field($field)->order('member_id desc')->limit($this->getPageParam()['limit'] ?? 0)->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -80,7 +81,11 @@ class MemberService extends BaseAdminService
|
||||
public function getInfo(int $member_id)
|
||||
{
|
||||
$field = 'member_id,member_no, id_card,remark,site_id, username, mobile, password, register_channel, register_type, nickname, headimg, member_level, member_label, wx_openid, weapp_openid, wx_unionid, ali_openid, douyin_openid, login_ip, login_type, login_channel, login_count, login_time, create_time, last_visit_time, last_consum_time, sex, status, birthday, point, point_get, balance, balance_get, growth, growth_get, is_member, member_time, is_del, province_id, city_id, district_id, address, location, delete_time, money, money_get, commission, commission_get, commission_cash_outing';
|
||||
return $this->makeUp($this->model->where([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $this->site_id ] ])->field($field)->with('member_level_name_bind')->append([ 'register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name' ])->findOrEmpty()->toArray());
|
||||
$info = $this->makeUp($this->model->where([['member_id', '=', $member_id], ['site_id', '=', $this->site_id]])->field($field)->with('member_level_name_bind')->append(['register_channel_name', 'register_type_name', 'sex_name', 'login_channel_name', 'login_type_name', 'status_name'])->findOrEmpty()->toArray());
|
||||
if (empty($info['member_level'])) {
|
||||
$info['member_level'] = '';
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,37 +97,37 @@ class MemberService extends BaseAdminService
|
||||
{
|
||||
|
||||
//检测手机是否重复
|
||||
if (!empty($data[ 'mobile' ])) {
|
||||
if (!$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'mobile', '=', $data[ 'mobile' ] ] ])->findOrEmpty()->isEmpty())
|
||||
if (!empty($data['mobile'])) {
|
||||
if (!$this->model->where([['site_id', '=', $this->site_id], ['mobile', '=', $data['mobile']]])->findOrEmpty()->isEmpty())
|
||||
throw new AdminException('MOBILE_IS_EXIST');
|
||||
}
|
||||
if ($data[ 'init_member_no' ] != $data[ 'member_no' ]) {
|
||||
if (!$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'member_no', '=', $data[ 'member_no' ] ] ])->findOrEmpty()->isEmpty())
|
||||
if ($data['init_member_no'] != $data['member_no']) {
|
||||
if (!$this->model->where([['site_id', '=', $this->site_id], ['member_no', '=', $data['member_no']]])->findOrEmpty()->isEmpty())
|
||||
throw new AdminException('MEMBER_NO_IS_EXIST');
|
||||
} else {
|
||||
if (!$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'member_no', '=', $data[ 'member_no' ] ] ])->findOrEmpty()->isEmpty()) {
|
||||
$data[ 'member_no' ] = $this->getMemberNo();
|
||||
if (!$this->model->where([['site_id', '=', $this->site_id], ['member_no', '=', $data['member_no']]])->findOrEmpty()->isEmpty()) {
|
||||
$data['member_no'] = $this->getMemberNo();
|
||||
}
|
||||
}
|
||||
|
||||
$data[ 'username' ] = $data[ 'mobile' ];
|
||||
if (!empty($data[ 'username' ])) {
|
||||
if (!$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'username', '=', $data[ 'username' ] ] ])->findOrEmpty()->isEmpty())
|
||||
$data['username'] = $data['mobile'];
|
||||
if (!empty($data['username'])) {
|
||||
if (!$this->model->where([['site_id', '=', $this->site_id], ['username', '=', $data['username']]])->findOrEmpty()->isEmpty())
|
||||
throw new AdminException('MEMBER_IS_EXIST');
|
||||
}
|
||||
|
||||
if (empty($data[ 'nickname' ]) && !empty($data[ 'mobile' ])) {
|
||||
$data[ 'nickname' ] = substr_replace($data[ 'mobile' ], '****', 3, 4);
|
||||
if (empty($data['nickname']) && !empty($data['mobile'])) {
|
||||
$data['nickname'] = substr_replace($data['mobile'], '****', 3, 4);
|
||||
}
|
||||
|
||||
$data[ 'site_id' ] = $this->site_id;
|
||||
$password_hash = create_password($data[ 'password' ]);
|
||||
$data[ 'password' ] = $password_hash;
|
||||
$data[ 'register_type' ] = MemberRegisterTypeDict::MANUAL;
|
||||
$data[ 'register_channel' ] = MemberRegisterChannelDict::MANUAL; // todo 公共化渠道
|
||||
$data['site_id'] = $this->site_id;
|
||||
$password_hash = create_password($data['password']);
|
||||
$data['password'] = $password_hash;
|
||||
$data['register_type'] = MemberRegisterTypeDict::MANUAL;
|
||||
$data['register_channel'] = MemberRegisterChannelDict::MANUAL; // todo 公共化渠道
|
||||
|
||||
$member = $this->model->create($data);
|
||||
$data[ 'member_id' ] = $member->member_id;
|
||||
$data['member_id'] = $member->member_id;
|
||||
event("MemberRegister", $data);
|
||||
return $member->member_id;
|
||||
}
|
||||
@ -136,11 +141,11 @@ class MemberService extends BaseAdminService
|
||||
public function edit(int $member_id, array $data)
|
||||
{
|
||||
$where = array(
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'member_id', '=', $member_id ],
|
||||
['site_id', '=', $this->site_id],
|
||||
['member_id', '=', $member_id],
|
||||
);
|
||||
if (!empty($data[ 'password' ])) {
|
||||
$data[ 'password' ] = create_password($data[ 'password' ]);
|
||||
if (!empty($data['password'])) {
|
||||
$data['password'] = create_password($data['password']);
|
||||
}
|
||||
$this->model->where($where)->update($data);
|
||||
return true;
|
||||
@ -155,7 +160,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function modify(int $member_id, string $field, $data)
|
||||
{
|
||||
return ( new CoreMemberService() )->modify($this->site_id, $member_id, $field, $data);
|
||||
return (new CoreMemberService())->modify($this->site_id, $member_id, $field, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,7 +170,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function batchModify($data)
|
||||
{
|
||||
return ( new CoreMemberService() )->batchModify($this->site_id, $data);
|
||||
return (new CoreMemberService())->batchModify($this->site_id, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -179,8 +184,8 @@ class MemberService extends BaseAdminService
|
||||
public function makeUp($data)
|
||||
{
|
||||
//会员标签
|
||||
if (!empty($data[ 'member_label' ])) {
|
||||
$data[ 'member_label_array' ] = ( new MemberLabelService() )->getMemberLabelListByLabelIds($data[ 'member_label' ]);
|
||||
if (!empty($data['member_label'])) {
|
||||
$data['member_label_array'] = (new MemberLabelService())->getMemberLabelListByLabelIds($data['member_label']);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@ -192,8 +197,8 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getCount(array $where = [])
|
||||
{
|
||||
$where[] = [ 'site_id', '=', $this->site_id ];
|
||||
$where[] = [ 'is_del', '=', 0 ];
|
||||
$where[] = ['site_id', '=', $this->site_id];
|
||||
$where[] = ['is_del', '=', 0];
|
||||
return $this->model->where($where)->count();
|
||||
}
|
||||
|
||||
@ -206,8 +211,8 @@ class MemberService extends BaseAdminService
|
||||
public function setStatus(array $member_ids, int $status)
|
||||
{
|
||||
$where = array(
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'member_id', 'in', $member_ids ],
|
||||
['site_id', '=', $this->site_id],
|
||||
['member_id', 'in', $member_ids],
|
||||
);
|
||||
$data = array(
|
||||
'status' => $status
|
||||
@ -223,7 +228,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getSum($field)
|
||||
{
|
||||
return $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->sum($field);
|
||||
return $this->model->where([['site_id', '=', $this->site_id]])->sum($field);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +237,16 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getMemberNo()
|
||||
{
|
||||
return ( new CoreMemberService() )->createMemberNo($this->site_id);
|
||||
//开启事务,解决创建会员编码重复
|
||||
try{
|
||||
Db::startTrans();
|
||||
$member_no = (new CoreMemberService())->createMemberNo($this->site_id);
|
||||
Db::commit();
|
||||
return $member_no;
|
||||
}catch (AdminException $e){
|
||||
Db::rollback();
|
||||
throw new AdminException("MEMBER_NO_CREATE_ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,7 +257,7 @@ class MemberService extends BaseAdminService
|
||||
public function deleteMember(int $member_id)
|
||||
{
|
||||
$this->model->destroy(function ($query) use ($member_id) {
|
||||
$query->where([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $this->site_id ] ]);
|
||||
$query->where([['member_id', '=', $member_id], ['site_id', '=', $this->site_id]]);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@ -257,9 +271,9 @@ class MemberService extends BaseAdminService
|
||||
{
|
||||
$field = 'member_id, member_no, username, mobile, nickname, point, balance, money, growth, commission, register_channel, status, create_time, last_visit_time';
|
||||
//查询导出数据
|
||||
$data = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'keyword', 'register_type', 'create_time', 'is_del', 'member_label', 'register_channel' ], $where)->field($field)->append([ 'register_channel_name', 'status_name' ])->select()->toArray();
|
||||
$data = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['keyword', 'register_type', 'create_time', 'is_del', 'member_label', 'register_channel'], $where)->field($field)->append(['register_channel_name', 'status_name'])->select()->toArray();
|
||||
//执行导出
|
||||
( new ExportService() )->exportData('member', $data);
|
||||
(new ExportService())->exportData('member', $data);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -269,7 +283,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getMemberBenefitsDict()
|
||||
{
|
||||
return ( new DictLoader("MemberBenefits") )->load();
|
||||
return (new DictLoader("MemberBenefits"))->load();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -278,7 +292,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getMemberGiftDict()
|
||||
{
|
||||
return ( new DictLoader("MemberGift") )->load();
|
||||
return (new DictLoader("MemberGift"))->load();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -287,7 +301,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getGrowthRuleDict()
|
||||
{
|
||||
return ( new DictLoader("GrowthRule") )->load();
|
||||
return (new DictLoader("GrowthRule"))->load();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -296,7 +310,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getPointRuleDict()
|
||||
{
|
||||
return ( new DictLoader("PointRule") )->load();
|
||||
return (new DictLoader("PointRule"))->load();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -306,7 +320,7 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getMemberBenefitsContent(array $benefits)
|
||||
{
|
||||
return ( new CoreMemberService() )->getBenefitsContent($this->site_id, $benefits);
|
||||
return (new CoreMemberService())->getBenefitsContent($this->site_id, $benefits);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -316,6 +330,6 @@ class MemberService extends BaseAdminService
|
||||
*/
|
||||
public function getMemberGiftsContent(array $gifts)
|
||||
{
|
||||
return ( new CoreMemberService() )->getGiftContent($this->site_id, $gifts);
|
||||
return (new CoreMemberService())->getGiftContent($this->site_id, $gifts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class NiuSmsService extends BaseAdminService
|
||||
{
|
||||
$account_info = $this->niu_service->loginAccount($params);
|
||||
if ($account_info) {
|
||||
(new CoreNiuSmsService())->setNiuLoginConfig($params);
|
||||
(new CoreNiuSmsService())->setNiuLoginConfig($params,true);
|
||||
}
|
||||
return $account_info;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ use app\dict\sys\AppTypeDict;
|
||||
use app\model\addon\Addon;
|
||||
use app\model\site\Site;
|
||||
use app\model\site\SiteGroup;
|
||||
use app\model\sys\SysMenu;
|
||||
use app\model\sys\SysUserRole;
|
||||
use app\service\admin\addon\AddonService;
|
||||
use app\service\admin\auth\AuthService;
|
||||
@ -118,7 +119,8 @@ class SiteService extends BaseAdminService
|
||||
'expire_time' => $data['expire_time'],
|
||||
'app' => $site_group['app'],
|
||||
'addons' => '',
|
||||
'status' => strtotime($data['expire_time']) > time() ? SiteDict::ON : SiteDict::EXPIRE
|
||||
'status' => strtotime($data['expire_time']) > time() ? SiteDict::ON : SiteDict::EXPIRE,
|
||||
'icon' => 'static/resource/images/site/site_icon.jpg'
|
||||
];
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -231,7 +233,7 @@ class SiteService extends BaseAdminService
|
||||
*/
|
||||
public function del(int $site_id)
|
||||
{
|
||||
( new CaptchaService() )->check();
|
||||
(new CaptchaService())->check();
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -426,10 +428,73 @@ class SiteService extends BaseAdminService
|
||||
*/
|
||||
public function getShowAppTools()
|
||||
{
|
||||
|
||||
$list = [
|
||||
'addon' => [
|
||||
'title' => '运营工具',
|
||||
'tool' => $this->getAllAddonAndTool()['tool'],
|
||||
// 'promotion' => [
|
||||
// 'title' => '营销活动',
|
||||
// 'list' => []
|
||||
// ]
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询营销列表
|
||||
* @return array
|
||||
*/
|
||||
public function getShowMarketingTools()
|
||||
{
|
||||
$all = $this->getAllAddonAndTool();
|
||||
$list = [
|
||||
'marketing' => $all['marketing'],
|
||||
'addon' => $all['addon'],
|
||||
];
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
private function getMarketing()
|
||||
{
|
||||
$list = [
|
||||
'marketing' => [
|
||||
'title' => '营销活动',
|
||||
'list' => []
|
||||
]
|
||||
];
|
||||
$apps = event('ShowMarketing', ['site_id' => $this->site_id]);
|
||||
|
||||
|
||||
$keys = [];
|
||||
foreach ($apps as $v) {
|
||||
foreach ($v as $ck => $cv) {
|
||||
if (!empty($cv)) {
|
||||
foreach ($cv as $addon_k => $addon_v) {
|
||||
if (in_array($addon_v['key'], $keys)) {
|
||||
continue;
|
||||
}
|
||||
$list[$ck]['list'][] = $addon_v;
|
||||
$keys[] = $addon_v['key'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
private function getAllAddonAndTool()
|
||||
{
|
||||
$markting_list = $this->getMarketing() ?? [];
|
||||
$markting = $markting_list['marketing'];
|
||||
$marking_addon = $markting_list['tool']['list'] ?? [];
|
||||
|
||||
$list = [
|
||||
'marketing' => $markting,
|
||||
'addon' => [
|
||||
'title' => '营销工具',
|
||||
'list' => $marking_addon
|
||||
],
|
||||
'tool' => [
|
||||
'title' => '系统工具',
|
||||
@ -460,15 +525,34 @@ class SiteService extends BaseAdminService
|
||||
|
||||
}
|
||||
|
||||
$menu_model = (new SysMenu());
|
||||
$site_addons = $this->getSiteAddons([]);
|
||||
|
||||
$addon_urls = $menu_model
|
||||
->where([['addon', 'in', array_column($site_addons, 'key')], ['is_show', '=', 1], ['menu_type', '=', 1]])
|
||||
->order('id asc')
|
||||
->group('addon')
|
||||
->column('router_path', 'addon');
|
||||
|
||||
if (!empty($site_addons)) {
|
||||
foreach ($site_addons as $k => $v) {
|
||||
if (!in_array($v['key'], $keys)) {
|
||||
$continue = true;
|
||||
if (!empty($markting['list'])) {
|
||||
foreach ($markting['list'] as $key => $val) {
|
||||
if ($v['key'] == $val['key']) {
|
||||
unset($site_addons[$k]);
|
||||
$continue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($continue && !in_array($v['key'], $keys)) {
|
||||
$url = $addon_urls[$v['key']] ?? '';
|
||||
$list['addon']['list'][] = [
|
||||
'title' => $v['title'],
|
||||
'desc' => $v['desc'],
|
||||
'icon' => $v['icon'],
|
||||
'key' => $v['key']
|
||||
'key' => $v['key'],
|
||||
'url' => $url ? '/' . $url : ''
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -477,55 +561,21 @@ class SiteService extends BaseAdminService
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询营销列表
|
||||
* @return array
|
||||
*/
|
||||
public function getShowMarketingTools()
|
||||
{
|
||||
$list = [
|
||||
'marketing' => [
|
||||
'title' => '营销活动',
|
||||
'list' => []
|
||||
]
|
||||
];
|
||||
|
||||
$apps = event('ShowMarketing');
|
||||
|
||||
|
||||
$keys = [];
|
||||
foreach ($apps as $v) {
|
||||
foreach ($v as $ck => $cv) {
|
||||
if (!empty($cv)) {
|
||||
foreach ($cv as $addon_k => $addon_v) {
|
||||
if (in_array($addon_v['key'], $keys)) {
|
||||
continue;
|
||||
}
|
||||
$list[$ck]['list'][] = $addon_v;
|
||||
$keys[] = $addon_v['key'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 站点初始化
|
||||
* @return bool
|
||||
*/
|
||||
public function siteInit($data)
|
||||
{
|
||||
( new CaptchaService() )->check();
|
||||
(new CaptchaService())->check();
|
||||
|
||||
$site_id = $data['site_id'];
|
||||
if (empty($site_id)) throw new AdminException('SITE_NOT_EXIST');
|
||||
|
||||
$site = $this->model->where([['site_id', '=', $site_id]])->with(['site_group'])->findOrEmpty()->toArray();
|
||||
if (empty($site)) throw new AdminException('SITE_NOT_EXIST');
|
||||
|
||||
//todo 特殊处理 优先删除的数据
|
||||
(new CoreSiteService())->siteInitBySiteId($site_id, ['diy_page', 'sys_poster']);
|
||||
event('SiteInit', ['site_id' => $site_id, 'main_app' => $site['site_group']['app'], 'site_addons' => $site['site_group']['addon']]);
|
||||
|
||||
// 更新微页面数据
|
||||
|
||||
@ -142,6 +142,11 @@ class AreaService extends BaseAdminService
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
// 设置 Referer 头(需替换为你的授权域名)
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, [
|
||||
'Referer: ' . $this->request->domain()
|
||||
]);
|
||||
|
||||
$res = curl_exec($curl);
|
||||
$res = json_decode($res, true);
|
||||
if($res){
|
||||
|
||||
@ -198,6 +198,7 @@ class AttachmentService extends BaseAdminService
|
||||
*/
|
||||
public function delCategory(int $id)
|
||||
{
|
||||
|
||||
//查询是否有下级菜单或按钮
|
||||
$category = $this->findCategory($this->site_id, $id);
|
||||
if ($this->model->where([ [ 'cate_id', '=', $id ] ])->count() > 0)
|
||||
|
||||
@ -73,7 +73,6 @@ class ConfigService extends BaseAdminService
|
||||
$info['site_login_logo'] = $service_info[ 'site_login_logo' ];
|
||||
$info['site_login_bg_img'] = $service_info[ 'site_login_bg_img' ];
|
||||
return $info;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,7 +105,7 @@ class ConfigService extends BaseAdminService
|
||||
'enterprise_wechat' => $info[ 'enterprise_wechat' ] ?? '',
|
||||
'site_login_logo' => $info[ 'site_login_logo' ] ?? '',
|
||||
'site_login_bg_img' => $info[ 'site_login_bg_img' ] ?? 'static/resource/images/site/login_bg.jpg',
|
||||
'tel' => $info[ 'tel' ] ?? ''
|
||||
'tel' => $info[ 'tel' ] ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ class PosterService extends BaseAdminService
|
||||
}
|
||||
Db::startTrans();
|
||||
$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'type', '=', $info[ 'type' ] ] ])->update([ 'is_default' => 0 ]);
|
||||
$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'id', '=', $data[ 'id' ] ] ])->update([ 'is_default' => 1, 'update_time' => time() ]);
|
||||
$this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'id', '=', $data[ 'id' ] ] ])->update([ 'is_default' => 1, 'status' => 1, 'update_time' => time() ]);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
|
||||
@ -197,7 +197,7 @@ class SystemService extends BaseAdminService
|
||||
'value' => $item[ 'column_value' ]
|
||||
];
|
||||
}
|
||||
$dir = 'upload/' . $this->site_id . '/' . $data[ 'folder' ] . '_qrcode';
|
||||
$dir = 'upload/' . $this->site_id . '/' . $data[ 'folder' ] . ' ';
|
||||
|
||||
try {
|
||||
// h5
|
||||
|
||||
@ -36,8 +36,9 @@ class UploadService extends BaseAdminService
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function image($file, int $cate_id = 0, $is_attachment = true){
|
||||
$dir = $this->root_path.'/'.'image'.'/'.$this->site_id.'/'.date('Ym').'/'.date('d');
|
||||
public function image($file, int $cate_id = 0, $is_attachment = true)
|
||||
{
|
||||
$dir = $this->root_path . '/' . 'image' . '/' . $this->site_id . '/' . date('Ym') . '/' . date('d');
|
||||
$core_upload_service = new CoreUploadService($is_attachment);
|
||||
//如果没有选择相册分组的话,就选择第一个相册分组
|
||||
return $core_upload_service->image($file, $this->site_id, $dir, $cate_id);
|
||||
@ -49,12 +50,26 @@ class UploadService extends BaseAdminService
|
||||
* @param int $cate_id
|
||||
* @return array
|
||||
*/
|
||||
public function video($file, int $cate_id = 0){
|
||||
$dir = $this->root_path.'/'.'video'.'/'.$this->site_id.'/'.date('Ym').'/'.date('d');
|
||||
public function video($file, int $cate_id = 0)
|
||||
{
|
||||
$dir = $this->root_path . '/' . 'video' . '/' . $this->site_id . '/' . date('Ym') . '/' . date('d');
|
||||
$core_upload_service = new CoreUploadService(true);
|
||||
return $core_upload_service->video($file, $this->site_id, $dir, $cate_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件库上传音频
|
||||
* @param $file
|
||||
* @param int $cate_id
|
||||
* @return array
|
||||
*/
|
||||
public function audio($file, int $cate_id = 0)
|
||||
{
|
||||
$dir = $this->root_path . '/' . 'audio' . '/' . $this->site_id . '/' . date('Ym') . '/' . date('d');
|
||||
$core_upload_service = new CoreUploadService(true);
|
||||
return $core_upload_service->audio($file, $this->site_id, $dir, $cate_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* @param $file
|
||||
@ -62,10 +77,11 @@ class UploadService extends BaseAdminService
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function document($file, string $type){
|
||||
if(!in_array($type, FileDict::getSceneType()))
|
||||
public function document($file, string $type)
|
||||
{
|
||||
if (!in_array($type, FileDict::getSceneType()))
|
||||
throw new UploadFileException('UPLOAD_TYPE_ERROR');
|
||||
$dir = $this->root_path.'/document/'.$type.'/'.$this->site_id.'/'.date('Ym').'/'.date('d');
|
||||
$dir = $this->root_path . '/document/' . $type . '/' . $this->site_id . '/' . date('Ym') . '/' . date('d');
|
||||
$core_upload_service = new CoreUploadService();
|
||||
return $core_upload_service->document($file, $this->site_id, $type, $dir, StorageDict::LOCAL);
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
namespace app\service\admin\verify;
|
||||
|
||||
use app\model\verify\Verify;
|
||||
use app\service\core\verify\CoreVerifyService;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
/**
|
||||
@ -35,14 +36,29 @@ class VerifyService extends BaseAdminService
|
||||
*/
|
||||
public function getPage(array $where = [])
|
||||
{
|
||||
$search_model = $this->model->where([ [ 'site_id', '=', $this->site_id ] ])->withSearch([ 'code', 'type', 'create_time', 'verifier_member_id' ], $where)
|
||||
->with([ 'member' => function($query) {
|
||||
$search_model = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['code', 'type', 'create_time', 'verifier_member_id', 'relate_tag', 'keyword', 'order_id'], $where)
|
||||
->with(['member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
} ])->field('*')->order('create_time desc')->append([ 'type_name' ]);
|
||||
}])->field('*')->order('create_time desc')->append(['type_name']);
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核销记录列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DbException
|
||||
*/
|
||||
public function getList(array $where = [])
|
||||
{
|
||||
$list = $this->model->where([['site_id', '=', $this->site_id]])->withSearch(['code', 'type', 'create_time', 'verifier_member_id', 'relate_tag', 'keyword', 'order_id'], $where)
|
||||
->with(['member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
}])->field('*')->order('create_time desc')->append(['type_name'])->select()->toArray();
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核销信息
|
||||
* @param string $verify_code
|
||||
@ -51,16 +67,41 @@ class VerifyService extends BaseAdminService
|
||||
public function getDetail(string $verify_code)
|
||||
{
|
||||
$info = $this->model->where([
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'code', '=', $verify_code ]
|
||||
['site_id', '=', $this->site_id],
|
||||
['code', '=', $verify_code]
|
||||
])->field('*')
|
||||
->with([ 'member' => function($query) {
|
||||
->with(['member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
} ])->append([ 'type_name' ])->findOrEmpty()->toArray();
|
||||
}])->append(['type_name'])->findOrEmpty()->toArray();
|
||||
|
||||
$info[ 'verify_info' ] = event('VerifyInfo', $info);
|
||||
$info['verify_info'] = event('VerifyInfo', $info);
|
||||
return $info;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 框架后台核销
|
||||
* @param string $verify_code
|
||||
* @param $num
|
||||
* @return true
|
||||
*/
|
||||
public function verify(string $verify_code, $num = 1)
|
||||
{
|
||||
|
||||
return (new CoreVerifyService())->adminVerify($this->site_id, $verify_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 框架后台核销
|
||||
* @param string $verify_code
|
||||
* @param $num
|
||||
* @return true
|
||||
*/
|
||||
public function getInfoByCode(string $verify_code)
|
||||
{
|
||||
|
||||
return (new CoreVerifyService())->adminGetInfoByCode($this->site_id, $verify_code);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -167,9 +167,9 @@ class DiyService extends BaseApiService
|
||||
];
|
||||
$data = [];
|
||||
foreach ($addon_list as $key => $value) {
|
||||
if (isset($value[ 'support_app' ]) && empty($value[ 'support_app' ]) && $value[ 'type' ] == 'addon') {
|
||||
continue;
|
||||
}
|
||||
// if (isset($value[ 'support_app' ]) && empty($value[ 'support_app' ]) && $value[ 'type' ] == 'addon') {
|
||||
// continue;
|
||||
// }
|
||||
$addon_theme = array_values(array_filter(event('ThemeColor', [ 'key' => $value[ 'key' ] ])))[ 0 ] ?? [];
|
||||
if (!empty($addon_theme) && !empty($addon_theme[ 'theme_color' ])) {
|
||||
$data[ $value[ 'key' ] ][ 'title' ] = $theme_data[ $value[ 'key' ] ][ 'title' ] ?? $addon_theme[ 'theme_color' ][ 0 ][ 'title' ];
|
||||
|
||||
@ -15,6 +15,7 @@ use app\model\verify\Verifier;
|
||||
use app\model\verify\Verify;
|
||||
use app\service\core\verify\CoreVerifyService;
|
||||
use core\base\BaseApiService;
|
||||
use core\util\Barcode;
|
||||
use think\db\exception\DbException;
|
||||
|
||||
/**
|
||||
@ -29,17 +30,26 @@ class VerifyService extends BaseApiService
|
||||
* @param $data = ['order_id' => , 'goods_id' => ]
|
||||
* @return array
|
||||
*/
|
||||
public function getVerifyCode($type, array $data)
|
||||
public function getVerifyCode($type, array $data, $is_need_barcode = 0)
|
||||
{
|
||||
$list = ( new CoreVerifyService() )->create($this->site_id, $this->member_id, $type, $data);
|
||||
$temp = [];
|
||||
foreach ($list as $item) {
|
||||
$temp[] = [
|
||||
'code' => $item,
|
||||
'qrcode' => qrcode($item, '', [], $this->site_id, outfile: false)
|
||||
$list = (new CoreVerifyService())->create($this->site_id, $this->member_id, $type, $data);
|
||||
$return = [];
|
||||
foreach ($list as $code) {
|
||||
$temp = [
|
||||
'code' => $code,
|
||||
'qrcode' => qrcode($code, '', [], $this->site_id, outfile: false)
|
||||
];
|
||||
if ($is_need_barcode == 1) {
|
||||
$qrcode_dir = 'upload/temp';
|
||||
if (!is_dir($qrcode_dir)) mkdir($qrcode_dir, intval('0755', 8), true);
|
||||
// 生成核销码条形码
|
||||
$barcode_path = (new Barcode(14, $code))->generateBarcode($qrcode_dir, 2);
|
||||
$barcode = image_to_base64($barcode_path);
|
||||
$temp['barcode'] = $barcode;
|
||||
}
|
||||
$return[] = $temp;
|
||||
}
|
||||
return $temp;
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,7 +59,7 @@ class VerifyService extends BaseApiService
|
||||
*/
|
||||
public function getInfoByCode($code)
|
||||
{
|
||||
return ( new CoreVerifyService() )->getInfoByCode($this->site_id, $this->member_id,$code);
|
||||
return (new CoreVerifyService())->getInfoByCode($this->site_id, $this->member_id, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,7 +69,7 @@ class VerifyService extends BaseApiService
|
||||
*/
|
||||
public function verify($code)
|
||||
{
|
||||
return ( new CoreVerifyService() )->verify($this->site_id, $code, $this->member_id);
|
||||
return (new CoreVerifyService())->verify($this->site_id, $code, $this->member_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -68,7 +78,7 @@ class VerifyService extends BaseApiService
|
||||
*/
|
||||
public function checkVerifier()
|
||||
{
|
||||
$verifier = ( new Verifier() )->where([ [ 'member_id', '=', $this->member_id ], [ 'site_id', '=', $this->site_id ] ])->findOrEmpty();
|
||||
$verifier = (new Verifier())->where([['member_id', '=', $this->member_id], ['site_id', '=', $this->site_id]])->findOrEmpty();
|
||||
if (!$verifier->isEmpty()) return true;
|
||||
return false;
|
||||
}
|
||||
@ -82,18 +92,18 @@ class VerifyService extends BaseApiService
|
||||
public function getRecordsPageByVerifier(array $data)
|
||||
{
|
||||
$field = '*';
|
||||
$search_model = ( new Verify() )->where([
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'verifier_member_id', '=', $this->member_id ]
|
||||
])->withSearch([ 'code', 'type', 'create_time', 'relate_tag', 'keyword' ], $data)
|
||||
$search_model = (new Verify())->where([
|
||||
['site_id', '=', $this->site_id],
|
||||
['verifier_member_id', '=', $this->member_id]
|
||||
])->withSearch(['code', 'type', 'create_time', 'relate_tag', 'keyword'], $data)
|
||||
->with([
|
||||
'member' => function($query) {
|
||||
'member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
}
|
||||
])
|
||||
->field($field)
|
||||
->order('create_time desc')
|
||||
->append([ 'type_name' ]);
|
||||
->append(['type_name']);
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
@ -105,15 +115,61 @@ class VerifyService extends BaseApiService
|
||||
public function getRecordsDetailByVerifier($code)
|
||||
{
|
||||
$field = '*';
|
||||
return ( new Verify() )->where([
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'verifier_member_id', '=', $this->member_id ],
|
||||
[ 'code', '=', $code ]
|
||||
return (new Verify())->where([
|
||||
['site_id', '=', $this->site_id],
|
||||
['verifier_member_id', '=', $this->member_id],
|
||||
['code', '=', $code]
|
||||
])->with([
|
||||
'member' => function($query) {
|
||||
'member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
}
|
||||
])->field($field)->append([ 'type_name' ])->findOrEmpty()->toArray();
|
||||
])->field($field)->append(['type_name'])->findOrEmpty()->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取核销记录列表
|
||||
* @return array
|
||||
* @throws DbException
|
||||
*/
|
||||
public function getRecordsList($data)
|
||||
{
|
||||
$field = '*';
|
||||
$search_model = (new Verify())->where([
|
||||
['site_id', '=', $this->site_id],
|
||||
])->withSearch(['code', 'type', 'create_time', 'relate_tag', 'keyword', 'order_id'], $data)
|
||||
->with([
|
||||
'member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
}
|
||||
])
|
||||
->field($field)
|
||||
->order('create_time desc')
|
||||
->append(['type_name']);
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核销记录列表
|
||||
* @return array
|
||||
* @throws DbException
|
||||
*/
|
||||
public function getMemberRecordsList($data)
|
||||
{
|
||||
$data['member_id'] = $this->member_id;
|
||||
$field = '*';
|
||||
$search_model = (new Verify())->where([
|
||||
['site_id', '=', $this->site_id],
|
||||
])->withSearch(['code', 'type', 'create_time', 'relate_tag', 'keyword', 'order_id', 'member_id'], $data)
|
||||
->with([
|
||||
'member' => function ($query) {
|
||||
$query->field('member_id, nickname, mobile, headimg');
|
||||
}
|
||||
])
|
||||
->field($field)
|
||||
->order('create_time desc')
|
||||
->append(['type_name']);
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -136,11 +136,14 @@ class WechatAuthService extends BaseApiService
|
||||
return [ 'avatar' => $avatar, 'nickname' => $nickname, 'openid' => $openid, 'unionid' => $unionid ];
|
||||
} else if ($is_force_access_user_info) {
|
||||
// 开启强制获取会员信息时,必须获取到昵称和头像才能进行注册
|
||||
if (!empty($nickname) && !empty($avatar)) {
|
||||
// if (!empty($nickname) && !empty($avatar)) {
|
||||
if (empty($nickname)){
|
||||
$nickname = unique_random();
|
||||
}
|
||||
return $this->register($openid, '', $nickname, $avatar, $unionid); // 获取到昵称和头像,然后进行注册
|
||||
} else {
|
||||
return [ 'avatar' => $avatar, 'nickname' => $nickname, 'openid' => $openid, 'unionid' => $unionid ];
|
||||
}
|
||||
// } else {
|
||||
// return [ 'avatar' => $avatar, 'nickname' => $nickname, 'openid' => $openid, 'unionid' => $unionid ];
|
||||
// }
|
||||
} else if ($is_bind_mobile) {
|
||||
// 开启强制绑定手机号,必须获取手机号才能进行注册,由于公众号无法主动获取,所以不能注册
|
||||
return [ 'openid' => $openid, 'unionid' => $unionid ];
|
||||
|
||||
@ -45,7 +45,8 @@ class CoreDiyService extends BaseCoreService
|
||||
'create_time' => time(),
|
||||
];
|
||||
}
|
||||
foreach ($site_addon[ 'apps' ] as $value) {
|
||||
$site_addon_theme = array_merge($site_addon['apps'], $site_addon['site_addons']);
|
||||
foreach ($site_addon_theme as $value) {
|
||||
$addon_theme = array_values(array_filter(event('ThemeColor', [ 'key' => $value[ 'key' ] ])))[ 0 ] ?? [];
|
||||
if (empty($addon_theme)) continue;
|
||||
|
||||
|
||||
35
niucloud/app/service/core/index/CorePromotionAdvService.php
Normal file
35
niucloud/app/service/core/index/CorePromotionAdvService.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud-admin.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\core\index;
|
||||
|
||||
use app\service\core\addon\CoreAddonBaseService;
|
||||
use app\service\core\niucloud\CoreModuleService;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 推广广告控制器
|
||||
* Class PromotionAdv
|
||||
* @package app\adminapi\controller\sys
|
||||
*/
|
||||
class CorePromotionAdvService extends CoreAddonBaseService
|
||||
{
|
||||
/**
|
||||
* 广告列表
|
||||
* @return Response
|
||||
*/
|
||||
public function getIndexAdvList()
|
||||
{
|
||||
return (new CoreModuleService())->getIndexAdvList()['data'] ?? [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -48,11 +48,18 @@ class CoreModuleService extends BaseNiucloudClient
|
||||
'code' => $this->code,
|
||||
'secret' => $this->secret,
|
||||
'labels' => [ $label_id ],
|
||||
'product_key' => self::PRODUCT,
|
||||
'is_recommend' => 1,
|
||||
'order_field' => 'sale_num desc, visit_num desc',
|
||||
];
|
||||
return $this->httpGet('store/app', $params);
|
||||
return $this->httpGet('store/saas/app', $params);
|
||||
}
|
||||
|
||||
public function getIndexAdvList()
|
||||
{
|
||||
$params = [
|
||||
'code' => $this->code,
|
||||
'secret' => $this->secret,
|
||||
];
|
||||
return $this->httpGet('promotion_adv', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -63,14 +63,14 @@ class CoreNiuSmsService extends BaseAdminService
|
||||
* @param $params
|
||||
* @return \app\model\sys\SysConfig|bool|\think\Model
|
||||
*/
|
||||
public function setNiuLoginConfig($params)
|
||||
public function setNiuLoginConfig($params, $is_login = false)
|
||||
{
|
||||
$config = $this->getNiuLoginConfig(true);
|
||||
$config['default'] = $params['default'] ?? ($config['default'] ?? "");
|
||||
$config[SmsDict::NIUSMS] = [
|
||||
'username' => $params['username'] ?? $config[SmsDict::NIUSMS]['username'] ?? "",
|
||||
'password' => $params['password'] ?? $config[SmsDict::NIUSMS]['password'] ?? "",
|
||||
'signature' => $params['signature'] ?? $config[SmsDict::NIUSMS]['signature'] ?? "",
|
||||
'signature' => $is_login ? "" : ($params['signature'] ?? $config[SmsDict::NIUSMS]['signature'] ?? ""),//登录清空默认签名重新选择
|
||||
];
|
||||
return (new CoreConfigService())->setConfig($this->site_id, ConfigKeyDict::SMS, $config);
|
||||
}
|
||||
@ -325,7 +325,7 @@ class CoreNiuSmsService extends BaseAdminService
|
||||
$url = "https://api-shss.zthysms.com/sms/v2/template/delete";
|
||||
$res = (new HttpHelper())->httpRequest('POST', $url, $request);
|
||||
if ($res['code'] != 200) {
|
||||
throw new \Exception('ZT'.$res['code'].":".$res['msg']);
|
||||
throw new \Exception('ZT' . $res['code'] . ":" . $res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -154,8 +154,7 @@ class CoreNoticeService extends BaseCoreService
|
||||
'wechat_first' => '',
|
||||
'wechat_remark' => ''
|
||||
];
|
||||
$notice = array_merge(NoticeDict::getNotice($key), $data);
|
||||
|
||||
$notice = array_merge($data,NoticeDict::getNotice($key));
|
||||
}
|
||||
return $notice;
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ namespace app\service\core\notice;
|
||||
use app\job\notice\Notice;
|
||||
use app\model\sys\SysNotice;
|
||||
use core\base\BaseCoreService;
|
||||
use think\facade\Log;
|
||||
|
||||
|
||||
/**
|
||||
@ -37,15 +38,18 @@ class NoticeService extends BaseCoreService
|
||||
* @return false|mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function send($site_id, $key, $data){
|
||||
public static function send($site_id, $key, $data)
|
||||
{
|
||||
|
||||
try {
|
||||
$template = (new CoreNoticeService())->getInfo($site_id, $key);
|
||||
if(empty($template)) return false;
|
||||
Log::write("消息发送");
|
||||
Log::write($template);
|
||||
if (empty($template)) return false;
|
||||
|
||||
return Notice::dispatch(['site_id' => $site_id, 'key' => $key, 'data' => $data, 'template' => $template], is_async:$template['async']);
|
||||
return Notice::dispatch(['site_id' => $site_id, 'key' => $key, 'data' => $data, 'template' => $template], is_async: $template['async']);
|
||||
|
||||
}catch (\Exception $e){
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ class CoreRefundService extends BaseCoreService
|
||||
}
|
||||
|
||||
} catch (Throwable $e) {
|
||||
throw new PayException($e->getMessage());
|
||||
throw new PayException($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -183,7 +183,7 @@ class CoreRefundService extends BaseCoreService
|
||||
} catch (Throwable $e) {
|
||||
// 回滚事务
|
||||
Db::rollback();
|
||||
throw new PayException($e->getMessage());
|
||||
throw new PayException($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,22 @@ use Throwable;
|
||||
*/
|
||||
class CorePosterService extends BaseCoreService
|
||||
{
|
||||
/**
|
||||
* 根据类型及插件获取默认海报
|
||||
* @param $site_id
|
||||
* @param $type
|
||||
* @return int|mixed
|
||||
*/
|
||||
public function getDefaultPosterIdByType($site_id, $type, $addon)
|
||||
{
|
||||
return (new Poster())->where([
|
||||
'site_id' => $site_id,
|
||||
'type' => $type,
|
||||
'is_default' => 1,
|
||||
'status' => 1,
|
||||
'addon' => $addon,
|
||||
])->value('id') ?: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建模板
|
||||
@ -36,12 +52,13 @@ class CorePosterService extends BaseCoreService
|
||||
*/
|
||||
public function add($site_id, $addon, $data)
|
||||
{
|
||||
$data[ 'addon' ] = $addon;
|
||||
$data[ 'site_id' ] = $site_id;
|
||||
( new Poster() )->create($data);
|
||||
$data['addon'] = $addon;
|
||||
$data['site_id'] = $site_id;
|
||||
(new Poster())->create($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param $condition
|
||||
@ -49,7 +66,7 @@ class CorePosterService extends BaseCoreService
|
||||
*/
|
||||
public function del($condition)
|
||||
{
|
||||
( new Poster() )->where($condition)->delete();
|
||||
(new Poster())->where($condition)->delete();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -102,18 +119,18 @@ class CorePosterService extends BaseCoreService
|
||||
public function get(int $site_id, $id, $type, array $param = [], $channel = '', $is_throw_exception = true)
|
||||
{
|
||||
$condition = [
|
||||
[ 'site_id', '=', $site_id ],
|
||||
[ 'type', '=', $type ],
|
||||
[ 'status', '=', PosterDict::ON ],
|
||||
['site_id', '=', $site_id],
|
||||
['type', '=', $type],
|
||||
['status', '=', PosterDict::ON],
|
||||
];
|
||||
if (!empty($id)) {
|
||||
// 查询指定海报
|
||||
$condition[] = [ 'id', '=', $id ];
|
||||
$condition[] = ['id', '=', $id];
|
||||
} else {
|
||||
// 查询默认海报
|
||||
$condition[] = [ 'is_default', '=', 1 ];
|
||||
$condition[] = ['is_default', '=', 1];
|
||||
}
|
||||
$poster = ( new Poster() )->where($condition)->findOrEmpty();
|
||||
$poster = (new Poster())->where($condition)->findOrEmpty();
|
||||
|
||||
try {
|
||||
|
||||
@ -121,11 +138,11 @@ class CorePosterService extends BaseCoreService
|
||||
// 查询指定类型的海报模板
|
||||
$template = $this->getTemplateList('', $type);
|
||||
if (!empty($template)) {
|
||||
$poster = $template[ 0 ][ 'data' ];
|
||||
$poster = $template[0]['data'];
|
||||
}
|
||||
} else {
|
||||
$poster = $poster->toArray();
|
||||
$poster = $poster[ 'value' ];
|
||||
$poster = $poster['value'];
|
||||
}
|
||||
|
||||
if (empty($poster)) throw new CommonException('海报模板不存在');
|
||||
@ -146,7 +163,7 @@ class CorePosterService extends BaseCoreService
|
||||
$dir = 'upload/poster/' . $site_id;
|
||||
$temp1 = md5(json_encode($poster));
|
||||
$temp2 = md5(json_encode($poster_data));
|
||||
$file_path = 'poster' . $temp1 . '_' . $temp2 .'_'.$channel. '.png';
|
||||
$file_path = 'poster' . $temp1 . '_' . $temp2 . '_' . $channel . '.png';
|
||||
$path = $dir . '/' . $file_path;
|
||||
|
||||
//判断当前海报是否存在,存在直接返回地址,不存在的话则创建
|
||||
@ -180,35 +197,35 @@ class CorePosterService extends BaseCoreService
|
||||
{
|
||||
//将模版中的部分待填充值替换
|
||||
$core_upload_service = new CoreFetchService();
|
||||
if ($poster[ 'global' ][ 'bgType' ] == 'url') {
|
||||
if (!empty($poster[ 'global' ][ 'bgUrl' ]) && str_contains($poster[ 'global' ][ 'bgUrl' ], 'http://') || str_contains($poster[ 'global' ][ 'bgUrl' ], 'https://')) {
|
||||
if ($poster['global']['bgType'] == 'url') {
|
||||
if (!empty($poster['global']['bgUrl']) && str_contains($poster['global']['bgUrl'], 'http://') || str_contains($poster['global']['bgUrl'], 'https://')) {
|
||||
//判断是否是是远程图片,远程图片需要本地化
|
||||
$temp_dir = 'file/' . 'image' . '/' . $site_id . '/' . date('Ym') . '/' . date('d');
|
||||
try {
|
||||
$poster[ 'global' ][ 'bgUrl' ] = $core_upload_service->image($poster[ 'global' ][ 'bgUrl' ], $site_id, $temp_dir, FileDict::LOCAL)[ 'url' ] ?? '';
|
||||
$poster['global']['bgUrl'] = $core_upload_service->image($poster['global']['bgUrl'], $site_id, $temp_dir, FileDict::LOCAL)['url'] ?? '';
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($poster[ 'value' ] as &$v) {
|
||||
foreach ($poster['value'] as &$v) {
|
||||
foreach ($data as $data_k => $data_v) {
|
||||
if ($data_k == $v[ 'relate' ]) {
|
||||
$v[ 'value' ] = $data_v; // 赋值
|
||||
if ($data_k == $v['relate']) {
|
||||
$v['value'] = $data_v; // 赋值
|
||||
// 如果类型是二维码的话就根据渠道生成对应的二维码
|
||||
if ($v[ 'type' ] == 'qrcode') {
|
||||
$v[ 'type' ] = 'image';
|
||||
if ($v['type'] == 'qrcode') {
|
||||
$v['type'] = 'image';
|
||||
// 将二维码类型转化为图片类型,并且将二维码链接转化为图片路径
|
||||
$v[ 'value' ] = qrcode($data_v[ 'url' ], $data_v[ 'page' ], $data_v[ 'data' ], $site_id, '', $channel);
|
||||
} else if ($v[ 'type' ] == 'image') {//校验图片文件是否是远程文件
|
||||
if (str_contains($v[ 'value' ], 'http://') || str_contains($v[ 'value' ], 'https://')) {
|
||||
$v['value'] = qrcode($data_v['url'], $data_v['page'], $data_v['data'], $site_id, '', $channel);
|
||||
} else if ($v['type'] == 'image') {//校验图片文件是否是远程文件
|
||||
if (str_contains($v['value'], 'http://') || str_contains($v['value'], 'https://')) {
|
||||
//判断是否是是远程图片,远程图片需要本地化
|
||||
$temp_dir = 'file/' . 'image' . '/' . $site_id . '/' . date('Ym') . '/' . date('d');
|
||||
try {
|
||||
$v[ 'value' ] = $core_upload_service->image($v[ 'value' ], $site_id, $temp_dir, FileDict::LOCAL)[ 'url' ] ?? '';
|
||||
$v['value'] = $core_upload_service->image($v['value'], $site_id, $temp_dir, FileDict::LOCAL)['url'] ?? '';
|
||||
} catch (\Exception $e) {
|
||||
$v[ 'value' ] = '';
|
||||
$v['value'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,6 +107,25 @@ class CoreUploadService extends CoreFileService
|
||||
return $this->after($site_id, $file_dir, FileDict::VIDEO, $cate_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 音频上传
|
||||
* @param string $file
|
||||
* @param int $site_id
|
||||
* @param string $file_dir
|
||||
* @param int $cate_id
|
||||
* @param string $storage_type
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function audio(string $file, int $site_id, string $file_dir, int $cate_id, string $storage_type = '')
|
||||
{
|
||||
//实例化上传引擎
|
||||
$this->upload_driver = $this->driver($site_id, $storage_type);
|
||||
//读取上传附件的信息用于后续得校验和数据写入
|
||||
$this->upload_driver->read($file);
|
||||
return $this->after($site_id, $file_dir, FileDict::AUDIO, $cate_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param string $file
|
||||
|
||||
@ -17,6 +17,7 @@ use app\model\verify\Verify;
|
||||
use core\base\BaseCoreService;
|
||||
use core\exception\CommonException;
|
||||
use think\facade\Cache;
|
||||
use function DI\string;
|
||||
|
||||
/**
|
||||
* 核销服务层
|
||||
@ -35,31 +36,39 @@ class CoreVerifyService extends BaseCoreService
|
||||
*/
|
||||
public function create(int $site_id, int $member_id, string|int $type, array $param)
|
||||
{
|
||||
$param['member_id'] = (string)$member_id;
|
||||
if (!array_key_exists($type, VerifyDict::getType())) throw new CommonException('VERIFY_TYPE_ERROR');//核销类型错误
|
||||
//遇到错误直接抛出即可
|
||||
$result = array_filter(event('VerifyCreate', [ 'site_id' => $site_id, 'type' => $type, 'member_id' => $member_id, 'data' => $param ]))[ 0 ] ?? [];
|
||||
$result = event('VerifyCreate', ['site_id' => $site_id, 'type' => $type, 'member_id' => $member_id, 'data' => $param]);
|
||||
foreach ($result as $item) {
|
||||
if(!empty($item)){
|
||||
$result = $item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$data = [];
|
||||
if (empty($result)) {
|
||||
$count = 1;
|
||||
} else {
|
||||
$count = $result[ 'count' ] ?? 1;
|
||||
$data = $result[ 'data' ] ?? [];
|
||||
$body = $result[ 'body' ] ?? '';
|
||||
$relate_tag = $result[ 'relate_tag' ] ?? 0;
|
||||
$expire_time = $result[ 'expire_time' ] ?? null;
|
||||
$count = $result['count'] ?? 1;
|
||||
$data = $result['data'] ?? [];
|
||||
$body = $result['body'] ?? '';
|
||||
$relate_tag = $result['relate_tag'] ?? 0;
|
||||
$expire_time = $result['expire_time'] ?? null;
|
||||
}
|
||||
$strData = json_encode($param);
|
||||
$value = [
|
||||
'site_id' => $site_id,
|
||||
'type' => $type,
|
||||
'type_name' => VerifyDict::getType()[ $type ][ 'name' ] ?? '',
|
||||
'type_name' => VerifyDict::getType()[$type]['name'] ?? '',
|
||||
'data' => $param,
|
||||
'value' => $data,
|
||||
'body' => $body ?? '',
|
||||
'relate_tag' => $relate_tag,
|
||||
'relate_tag' => $relate_tag ?? 0,
|
||||
];
|
||||
$verify_code_list = [];
|
||||
$temp = 0;
|
||||
|
||||
while ($temp < $count) {
|
||||
$salt = uniqid();
|
||||
$verify_code = md5($salt . $strData);
|
||||
@ -82,16 +91,22 @@ class CoreVerifyService extends BaseCoreService
|
||||
//获取核销码数据
|
||||
$value = $this->getCodeData($verify_code);
|
||||
//检测站点数据
|
||||
if ($value[ 'site_id' ] != $site_id) throw new CommonException('VERIFY_CODE_EXPIRED');//核销码已过期
|
||||
if ($value['site_id'] != $site_id) throw new CommonException('VERIFY_CODE_EXPIRED');//核销码已过期
|
||||
$data = event('VerifyCheck', $value);
|
||||
|
||||
if (!empty($data)) {
|
||||
$value = end($data);
|
||||
foreach ($data as $datum) {
|
||||
if (!empty($datum)) {
|
||||
$value = $datum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检测核销员身份,是否有核销权限
|
||||
$verifier = ( new Verifier() )->where([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $site_id ] ])->field('id,verify_type')->findOrEmpty()->toArray();
|
||||
$verifier = (new Verifier())->where([['member_id', '=', $member_id], ['site_id', '=', $site_id]])->field('id,verify_type')->findOrEmpty()->toArray();
|
||||
if (!empty($verifier)) {
|
||||
if (!in_array($value[ 'type' ], $verifier[ 'verify_type' ])) {
|
||||
if (!in_array($value['type'], $verifier['verify_type'])) {
|
||||
throw new CommonException('VERIFIER_NOT_AUTH');
|
||||
}
|
||||
}
|
||||
@ -108,20 +123,20 @@ class CoreVerifyService extends BaseCoreService
|
||||
//获取核销码数据
|
||||
$value = $this->getCodeData($verify_code);
|
||||
//检测站点数据
|
||||
if ($value[ 'site_id' ] != $site_id) throw new CommonException('VERIFY_CODE_EXPIRED');//核销码已过期
|
||||
if ($value['site_id'] != $site_id) throw new CommonException('VERIFY_CODE_EXPIRED');//核销码已过期
|
||||
//检测核销员身份
|
||||
$verifierModel = new Verifier();
|
||||
$verifier = $verifierModel->where([ [ 'site_id', '=', $value[ 'site_id' ] ], [ 'member_id', '=', $verify_member_id ] ])->findOrEmpty()->toArray();
|
||||
$verifier = $verifierModel->where([['site_id', '=', $value['site_id']], ['member_id', '=', $verify_member_id]])->findOrEmpty()->toArray();
|
||||
if (empty($verifier)) throw new CommonException('VERIFIER_NOT_EXIST');
|
||||
|
||||
$verify_data = [
|
||||
'site_id' => $value[ 'site_id' ],
|
||||
'site_id' => $value['site_id'],
|
||||
'code' => $verify_code,
|
||||
'data' => $value[ 'data' ],
|
||||
'value' => $value[ 'value' ],
|
||||
'type' => $value[ 'type' ],
|
||||
'body' => $value[ 'body' ],
|
||||
'relate_tag' => $value[ 'relate_tag' ],
|
||||
'data' => $value['data'],
|
||||
'value' => $value['value'],
|
||||
'type' => $value['type'],
|
||||
'body' => $value['body'],
|
||||
'relate_tag' => $value['relate_tag'],
|
||||
'create_time' => time(),
|
||||
'verifier_member_id' => $verify_member_id,
|
||||
];
|
||||
@ -135,6 +150,65 @@ class CoreVerifyService extends BaseCoreService
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 核销(核销api调用)
|
||||
* @return true
|
||||
*/
|
||||
public function adminVerify($site_id, string $verify_code)
|
||||
{
|
||||
//获取核销码数据
|
||||
$value = $this->getCodeData($verify_code);
|
||||
//检测站点数据
|
||||
if ($value['site_id'] != $site_id) throw new CommonException('VERIFY_CODE_EXPIRED');//核销码已过期
|
||||
|
||||
$verify_data = [
|
||||
'site_id' => $value['site_id'],
|
||||
'code' => $verify_code,
|
||||
'data' => $value['data'],
|
||||
'value' => $value['value'],
|
||||
'type' => $value['type'],
|
||||
'body' => $value['body'],
|
||||
'relate_tag' => $value['relate_tag'],
|
||||
'create_time' => time(),
|
||||
'verifier_member_id' => 0,
|
||||
'is_admin' => 1,
|
||||
];
|
||||
//核销
|
||||
event('Verify', $verify_data); //todo:相关核销业务回调
|
||||
$model = new Verify();
|
||||
$model->create($verify_data);
|
||||
//是核销码失效
|
||||
$this->clearCode($verify_code);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核销码信息
|
||||
* @param $site_id
|
||||
* @param string $member_id
|
||||
* @param string $verify_code
|
||||
* @return array
|
||||
*/
|
||||
public function adminGetInfoByCode($site_id, $verify_code)
|
||||
{
|
||||
//获取核销码数据
|
||||
$value = $this->getCodeData($verify_code);
|
||||
//检测站点数据
|
||||
if ($value['site_id'] != $site_id) throw new CommonException('VERIFY_CODE_EXPIRED');//核销码已过期
|
||||
$data = event('VerifyCheck', $value);
|
||||
|
||||
if (!empty($data)) {
|
||||
foreach ($data as $datum) {
|
||||
if (!empty($datum)) {
|
||||
$value = $datum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置核销码数据缓存
|
||||
* @param $verify_code
|
||||
|
||||
24
niucloud/app/upgrade/v114/upgrade.sql
Normal file
24
niucloud/app/upgrade/v114/upgrade.sql
Normal file
@ -0,0 +1,24 @@
|
||||
ALTER TABLE `verify` CHANGE COLUMN `verifier_member_id` `verifier_member_id` INT NOT NULL DEFAULT 0 COMMENT '核销员的会员id';
|
||||
|
||||
ALTER TABLE `verify`ADD COLUMN `is_admin` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否后台核销0-否1-是';
|
||||
|
||||
DROP TABLE IF EXISTS `activity_exchange_code`;
|
||||
CREATE TABLE `activity_exchange_code`
|
||||
(
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`site_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`code` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '兑换码',
|
||||
`status` VARCHAR(20) NOT NULL DEFAULT 'normal' COMMENT 'normal-正常 received-被领取',
|
||||
`activity_type` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '例seckill-秒杀活动',
|
||||
`activity_id` INT(11) NOT NULL DEFAULT 0 COMMENT '活动ID',
|
||||
`type` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '类型 例seckill_goods-秒杀商品',
|
||||
`type_id` INT(11) NOT NULL DEFAULT 0 COMMENT '类型对应id 秒杀商品id',
|
||||
`expire_time` INT(11) NOT NULL DEFAULT 0 COMMENT '过期时间 0-不过期',
|
||||
`member_id` INT(11) NOT NULL DEFAULT 0 COMMENT '领取会员',
|
||||
`received_time` INT(11) NOT NULL DEFAULT 0 COMMENT '领取时间',
|
||||
`order_id` INT(11) NOT NULL DEFAULT 0 COMMENT '对应订单id',
|
||||
`admin_username` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '操作人名称(添加人)',
|
||||
`admin_id` INT(11) NOT NULL DEFAULT 0 COMMENT '操作人id',
|
||||
`create_time` INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='活动兑换码表';
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'version' => '1.1.3',
|
||||
'code' => '202507190001'
|
||||
'version' => '1.1.4',
|
||||
'code' => '202508230001'
|
||||
];
|
||||
|
||||
@ -83,7 +83,7 @@ abstract class BaseService
|
||||
|
||||
/**
|
||||
* 分页数据查询,传入model(查询后结果)
|
||||
* @param $model BaseModel
|
||||
* @param $model
|
||||
* @return array
|
||||
* @throws DbException
|
||||
*/
|
||||
|
||||
@ -35,7 +35,10 @@ class Poster extends BasePoster
|
||||
public function createPoster(array $poster_data, string $dir, string $file_path)
|
||||
{
|
||||
$bg_type = $poster_data[ 'global' ][ 'bgType' ];
|
||||
$instance = PosterInstance::extension('gd')->config([ 'path' => realpath($dir) . DIRECTORY_SEPARATOR . $file_path ]);
|
||||
$instance = PosterInstance::extension('imagick')->config([
|
||||
'path' => realpath($dir) . DIRECTORY_SEPARATOR . $file_path,
|
||||
'dpi' => [480,480]
|
||||
]);
|
||||
$bg_width = $poster_data[ 'global' ][ 'width' ];
|
||||
$bg_height = $poster_data[ 'global' ][ 'height' ];
|
||||
if ($bg_type == 'url' && !empty($poster_data[ 'global' ][ 'bgUrl' ]) && is_file($poster_data[ 'global' ][ 'bgUrl' ])) {
|
||||
@ -54,44 +57,16 @@ class Poster extends BasePoster
|
||||
switch ($type) {
|
||||
case 'text':
|
||||
$font_size = ceil($v[ 'fontSize' ]);
|
||||
$default_font = 'static' . DIRECTORY_SEPARATOR . 'font' . DIRECTORY_SEPARATOR . 'SourceHanSansCN-Regular.ttf';
|
||||
$default_font = 'static' . DIRECTORY_SEPARATOR . 'font' . DIRECTORY_SEPARATOR . 'PingFang-Medium.ttf';
|
||||
// $font = $default_font;
|
||||
$font = $v[ 'fontFamily' ] ? : $default_font;
|
||||
$content_list = $this->getText($v[ 'value' ], $font_size, $font, $v[ 'space' ] ?? 0, $v[ 'width' ], $v[ 'height' ], $v[ 'lineHeight' ] + $font_size);
|
||||
$base_y = $this->getX($v[ 'y' ]);
|
||||
if (is_array($base_y)) {
|
||||
$diff_height = count($content_list) * ( $v[ 'lineHeight' ] + $font_size );
|
||||
$again_y = $base_y[ 0 ];
|
||||
if ($again_y == 'center') {
|
||||
$base_y_num = ( $bg_height - $diff_height ) > 0 ? ( $bg_height - $diff_height ) / 2 : 0;
|
||||
} else if ($again_y == 'top') {
|
||||
$base_y_num = 0;
|
||||
} else {
|
||||
$base_y_num = $bg_height - $v[ 'height' ];
|
||||
}
|
||||
// $content_list = $this->getText($v[ 'value' ], $font_size, $font, $v[ 'space' ] ?? 0, $v[ 'width' ], $v[ 'height' ], $v[ 'lineHeight' ] + $font_size);
|
||||
$base_y = $this->getY($v[ 'y' ]);
|
||||
$base_y_num = $base_y;
|
||||
$temp_line_height = $v[ 'lineHeight' ];
|
||||
$base_y_num += $temp_line_height;
|
||||
|
||||
} else {
|
||||
$base_y_num = $base_y;
|
||||
}
|
||||
// if(in_array($base_y, $align_array)){
|
||||
// $diff_height = count($content_list)*($v[ 'lineHeight' ]+$font_size);
|
||||
// $base_y_num = ($bg_height-$diff_height) > 0 ? ($bg_height-$diff_height)/2 : 0;
|
||||
// }else{
|
||||
// $base_y_num = $base_y[0];
|
||||
// }
|
||||
foreach ($content_list as $ck => $content) {
|
||||
if ($ck == 0) {
|
||||
if ($v[ 'lineHeight' ] > 0) {
|
||||
$item_line = $v[ 'lineHeight' ] / 2;
|
||||
} else {
|
||||
$item_line = 0;
|
||||
}
|
||||
} else {
|
||||
$item_line = $v[ 'lineHeight' ] + $font_size;
|
||||
}
|
||||
$base_y_num += $item_line;
|
||||
//计算文本框宽度
|
||||
$im = $im->buildText($content, $this->getX($v[ 'x' ]), $base_y_num, $font_size, $this->getRgbColor($v[ 'fontColor' ]), $v[ 'width' ], $font, $v[ 'weight' ] ? 10 : null); # 合成文字
|
||||
}
|
||||
$im = $im->buildText($v[ 'value' ], $this->getX($v[ 'x' ]), $base_y_num, $font_size, $this->getRgbColor($v[ 'fontColor' ]), $v[ 'width' ], $font, $v[ 'weight' ] ? 10 : null); # 合成文字
|
||||
break;
|
||||
case 'image':
|
||||
if (is_file($v[ 'value' ])) {
|
||||
@ -160,7 +135,7 @@ class Poster extends BasePoster
|
||||
{
|
||||
$calcSpace = $space > $fontSize ? ( $space - $fontSize ) : 0; // 获取间距计算值
|
||||
|
||||
$fontSize = ( $fontSize * 3 ) / 4; // px 转化为 pt
|
||||
// $fontSize = ( $fontSize * 3 ) / 4; // px 转化为 pt
|
||||
|
||||
mb_internal_encoding('UTF-8'); // 设置编码
|
||||
// 这几个变量分别是 字体大小, 角度, 字体名称, 字符串, 预设宽度
|
||||
|
||||
@ -62,6 +62,7 @@ class Tencent extends BaseSms
|
||||
$clientProfile->setHttpProfile($httpProfile);
|
||||
|
||||
$client = new SmsClient($cred, 'ap-guangzhou', $clientProfile);
|
||||
if (isset($data['url_params'])) unset($data['url_params']);
|
||||
$params = [
|
||||
'PhoneNumberSet' => [ '+86' . $mobile ],
|
||||
'TemplateID' => $template_id,
|
||||
@ -103,4 +104,4 @@ class Tencent extends BaseSms
|
||||
public function record($id)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ use EasyWeChat\Kernel\Exceptions\InvalidConfigException;
|
||||
use EasyWeChat\Kernel\Support\Collection;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use think\facade\Log;
|
||||
|
||||
|
||||
class Weapp extends BaseTemplate
|
||||
@ -45,12 +46,13 @@ class Weapp extends BaseTemplate
|
||||
public function send(array $data)
|
||||
{
|
||||
$api = CoreWeappService::appApiClient($this->site_id);
|
||||
$api->postJson('cgi-bin/message/subscribe/send', [
|
||||
$res = $api->postJson('cgi-bin/message/subscribe/send', [
|
||||
'template_id' => $data['template_id'], // 所需下发的订阅模板id
|
||||
'touser' => $data['openid'], // 接收者(用户)的 openid
|
||||
'page' => $data['page'], // 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。
|
||||
'data' => $data['data'],
|
||||
]);
|
||||
Log::write("发送小程序消息Response-" . json_encode($res->toArray(), 256));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,11 +65,13 @@ class Weapp extends BaseTemplate
|
||||
public function addTemplate(array $data)
|
||||
{
|
||||
$api = CoreWeappService::appApiClient($this->site_id);
|
||||
return $api->postJson('wxaapi/newtmpl/addtemplate', [
|
||||
$res = $api->postJson('wxaapi/newtmpl/addtemplate', [
|
||||
'tid' => $data['tid'],
|
||||
'kidList' => $data['kid_list'],
|
||||
'sceneDesc' => $data['scene_desc'],
|
||||
]);
|
||||
Log::write("添加小程序模版Response-" . json_encode($res->toArray(), 256));
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -80,9 +84,11 @@ class Weapp extends BaseTemplate
|
||||
public function delete(array $data)
|
||||
{
|
||||
$api = CoreWeappService::appApiClient($this->site_id);
|
||||
return $api->postJson('wxaapi/newtmpl/deltemplate', [
|
||||
$res = $api->postJson('wxaapi/newtmpl/deltemplate', [
|
||||
'priTmplId' => $data['template_id'],
|
||||
]);
|
||||
Log::write("删除小程序模版Response-" . json_encode($res->toArray(), 256));
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1 +1 @@
|
||||
import{d as l,r as d,o as i,c as p,a as t,b as u,e as m,w as x,u as v,f,E as h,p as b,g,h as I,i as w,t as S}from"./index-d3b02fcc.js";/* empty css */import{_ as B}from"./_plugin-vue_export-helper-c27b6911.js";const k=""+new URL("error-ab7e4004.png",import.meta.url).href,o=e=>(b("data-v-4f4088b5"),e=e(),g(),e),y={class:"error"},C={class:"flex items-center"},E=o(()=>t("div",null,[t("img",{class:"w-[240px]",src:k})],-1)),N={class:"text-left ml-[100px]"},R=o(()=>t("div",{class:"error-text text-[28px] font-bold"},"404错误!",-1)),U=o(()=>t("div",{class:"text-[#222] text-[20px] mt-[15px]"},"哎呀,出错了!您访问的页面不存在...",-1)),V=o(()=>t("div",{class:"text-[#c4c2c2] text-[12px] mt-[5px]"},"尝试检查URL的错误,然后点击浏览器刷新按钮。",-1)),L={class:"mt-[40px]"},$=l({__name:"404",setup(e){let s=null;const a=d(5),n=f();return s=setInterval(()=>{a.value===0?(clearInterval(s),n.go(-1)):a.value--},1e3),i(()=>{s&&clearInterval(s)}),(r,c)=>{const _=h;return I(),p("div",y,[t("div",C,[u(r.$slots,"content",{},()=>[E],!0),t("div",N,[R,U,V,t("div",L,[m(_,{class:"bottom",onClick:c[0]||(c[0]=D=>v(n).go(-1))},{default:x(()=>[w(S(a.value)+" 秒后返回上一页",1)]),_:1})])])])])}}});const z=B($,[["__scopeId","data-v-4f4088b5"]]);export{z as default};
|
||||
import{d as l,r as d,o as i,c as p,a as t,b as u,e as m,w as x,u as v,f,E as h,p as b,g,h as I,i as w,t as S}from"./index-c66fcffe.js";/* empty css */import{_ as B}from"./_plugin-vue_export-helper-c27b6911.js";const k=""+new URL("error-ab7e4004.png",import.meta.url).href,o=e=>(b("data-v-4f4088b5"),e=e(),g(),e),y={class:"error"},C={class:"flex items-center"},E=o(()=>t("div",null,[t("img",{class:"w-[240px]",src:k})],-1)),N={class:"text-left ml-[100px]"},R=o(()=>t("div",{class:"error-text text-[28px] font-bold"},"404错误!",-1)),U=o(()=>t("div",{class:"text-[#222] text-[20px] mt-[15px]"},"哎呀,出错了!您访问的页面不存在...",-1)),V=o(()=>t("div",{class:"text-[#c4c2c2] text-[12px] mt-[5px]"},"尝试检查URL的错误,然后点击浏览器刷新按钮。",-1)),L={class:"mt-[40px]"},$=l({__name:"404",setup(e){let s=null;const a=d(5),n=f();return s=setInterval(()=>{a.value===0?(clearInterval(s),n.go(-1)):a.value--},1e3),i(()=>{s&&clearInterval(s)}),(r,c)=>{const _=h;return I(),p("div",y,[t("div",C,[u(r.$slots,"content",{},()=>[E],!0),t("div",N,[R,U,V,t("div",L,[m(_,{class:"bottom",onClick:c[0]||(c[0]=D=>v(n).go(-1))},{default:x(()=>[w(S(a.value)+" 秒后返回上一页",1)]),_:1})])])])])}}});const z=B($,[["__scopeId","data-v-4f4088b5"]]);export{z as default};
|
||||
1
niucloud/public/admin/assets/App-3261cc91.js
Normal file
1
niucloud/public/admin/assets/App-3261cc91.js
Normal file
@ -0,0 +1 @@
|
||||
import{dz as f}from"./index-c66fcffe.js";export{f as default};
|
||||
@ -1 +0,0 @@
|
||||
import{d1 as f}from"./index-d3b02fcc.js";export{f as default};
|
||||
BIN
niucloud/public/admin/assets/OPLUSSANS3-REGULAR-67fd9e25.ttf
Normal file
BIN
niucloud/public/admin/assets/OPLUSSANS3-REGULAR-67fd9e25.ttf
Normal file
Binary file not shown.
BIN
niucloud/public/admin/assets/PingFang-Medium-ddf051a9.ttf
Normal file
BIN
niucloud/public/admin/assets/PingFang-Medium-ddf051a9.ttf
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
import z from"./VerifySlide-1ec6c311.js";import g from"./VerifyPoints-d6b26d35.js";import{Q as k,r as o,l as w,b1 as T,Z as V,_ as B,h as p,c as u,a as c,i as N,C as y,x as d,s as C,b2 as j,v}from"./index-d3b02fcc.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import"./index-1a1af23f.js";const P={name:"Vue2Verify",components:{VerifySlide:z,VerifyPoints:g},props:{captchaType:{type:String,required:!0},figure:{type:Number},arith:{type:Number},mode:{type:String,default:"pop"},vSpace:{type:Number},explain:{type:String},imgSize:{type:Object,default(){return{width:"310px",height:"155px"}}},blockSize:{type:Object},barSize:{type:Object}},setup(m){const{captchaType:i,figure:e,arith:t,mode:n,vSpace:h,explain:f,imgSize:Q,blockSize:R,barSize:W}=k(m),a=o(!1),r=o(void 0),s=o(void 0),l=o({}),S=w(()=>n.value=="pop"?a.value:!0),b=()=>{l.value.refresh&&l.value.refresh()},x=()=>{a.value=!1,b()},_=()=>{n.value=="pop"&&(a.value=!0)};return T(()=>{switch(i.value){case"blockPuzzle":r.value="2",s.value="VerifySlide";break;case"clickWord":r.value="",s.value="VerifyPoints";break}}),{clickShow:a,verifyType:r,componentType:s,instance:l,showBox:S,closeBox:x,show:_}}},D={key:0,class:"verifybox-top"},E=c("i",{class:"iconfont icon-close"},null,-1),q=[E];function I(m,i,e,t,n,h){return V((p(),u("div",{class:v(e.mode=="pop"?"mask":"")},[c("div",{class:v(e.mode=="pop"?"verifybox":""),style:d({"max-width":parseInt(e.imgSize.width)+30+"px"})},[e.mode=="pop"?(p(),u("div",D,[N(" 请完成安全验证 "),c("span",{class:"verifybox-close",onClick:i[0]||(i[0]=(...f)=>t.closeBox&&t.closeBox(...f))},q)])):y("",!0),c("div",{class:"verifybox-bottom",style:d({padding:e.mode=="pop"?"15px":"0"})},[t.componentType?(p(),C(j(t.componentType),{key:0,captchaType:e.captchaType,type:t.verifyType,figure:e.figure,arith:e.arith,mode:e.mode,vSpace:e.vSpace,explain:e.explain,imgSize:e.imgSize,blockSize:e.blockSize,barSize:e.barSize,ref:"instance"},null,8,["captchaType","type","figure","arith","mode","vSpace","explain","imgSize","blockSize","barSize"])):y("",!0)],4)],6)],2)),[[B,t.showBox]])}const J=O(P,[["render",I]]);export{J as default};
|
||||
import z from"./VerifySlide-443eea4c.js";import g from"./VerifyPoints-48fa9e0e.js";import{Q as k,r as o,l as w,bd as T,Z as V,_ as B,h as p,c as u,a as c,i as N,C as d,x as y,s as C,be as j,v}from"./index-c66fcffe.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import"./index-17d5e669.js";const P={name:"Vue2Verify",components:{VerifySlide:z,VerifyPoints:g},props:{captchaType:{type:String,required:!0},figure:{type:Number},arith:{type:Number},mode:{type:String,default:"pop"},vSpace:{type:Number},explain:{type:String},imgSize:{type:Object,default(){return{width:"310px",height:"155px"}}},blockSize:{type:Object},barSize:{type:Object}},setup(m){const{captchaType:i,figure:e,arith:t,mode:n,vSpace:h,explain:f,imgSize:Q,blockSize:R,barSize:W}=k(m),a=o(!1),r=o(void 0),s=o(void 0),l=o({}),S=w(()=>n.value=="pop"?a.value:!0),b=()=>{l.value.refresh&&l.value.refresh()},x=()=>{a.value=!1,b()},_=()=>{n.value=="pop"&&(a.value=!0)};return T(()=>{switch(i.value){case"blockPuzzle":r.value="2",s.value="VerifySlide";break;case"clickWord":r.value="",s.value="VerifyPoints";break}}),{clickShow:a,verifyType:r,componentType:s,instance:l,showBox:S,closeBox:x,show:_}}},D={key:0,class:"verifybox-top"},E=c("i",{class:"iconfont icon-close"},null,-1),q=[E];function I(m,i,e,t,n,h){return V((p(),u("div",{class:v(e.mode=="pop"?"mask":"")},[c("div",{class:v(e.mode=="pop"?"verifybox":""),style:y({"max-width":parseInt(e.imgSize.width)+30+"px"})},[e.mode=="pop"?(p(),u("div",D,[N(" 请完成安全验证 "),c("span",{class:"verifybox-close",onClick:i[0]||(i[0]=(...f)=>t.closeBox&&t.closeBox(...f))},q)])):d("",!0),c("div",{class:"verifybox-bottom",style:y({padding:e.mode=="pop"?"15px":"0"})},[t.componentType?(p(),C(j(t.componentType),{key:0,captchaType:e.captchaType,type:t.verifyType,figure:e.figure,arith:e.arith,mode:e.mode,vSpace:e.vSpace,explain:e.explain,imgSize:e.imgSize,blockSize:e.blockSize,barSize:e.barSize,ref:"instance"},null,8,["captchaType","type","figure","arith","mode","vSpace","explain","imgSize","blockSize","barSize"])):d("",!0)],4)],6)],2)),[[B,t.showBox]])}const J=O(P,[["render",I]]);export{J as default};
|
||||
@ -1 +1 @@
|
||||
import{r as F,a as V,b as K,c as G}from"./index-1a1af23f.js";import{Q,b3 as X,r as s,n as m,aO as Y,h as P,c as I,a as l,x as O,Z,_ as U,F as $,W as ee,t as L,aH as te}from"./index-d3b02fcc.js";import{_ as ae}from"./_plugin-vue_export-helper-c27b6911.js";const ie={name:"VerifyPoints",props:{mode:{type:String,default:"fixed"},captchaType:{type:String},vSpace:{type:Number,default:5},imgSize:{type:Object,default(){return{width:"310px",height:"155px"}}},barSize:{type:Object,default(){return{width:"310px",height:"40px"}}}},setup(A,f){const{mode:_,captchaType:e,vSpace:R,imgSize:q,barSize:c}=Q(A),{proxy:n}=X(),h=s(""),z=s(3),p=m([]),a=m([]),o=s(1),N=s(""),w=m([]),v=s(""),u=m({imgHeight:0,imgWidth:0,barHeight:0,barWidth:0}),y=m([]),d=s(""),b=s(void 0),x=s(void 0),j=s(!0),C=s(!0),J=()=>{p.splice(0,p.length),a.splice(0,a.length),o.value=1,B(),te(()=>{const{imgHeight:i,imgWidth:t,barHeight:g,barWidth:r}=F(n);u.imgHeight=i,u.imgWidth=t,u.barHeight=g,u.barWidth=r,n.$parent.$emit("ready",n)})};Y(()=>{J(),n.$el.onselectstart=function(){return!1}});const S=s(null),D=i=>{if(a.push(k(S,i)),o.value==z.value){o.value=T(k(S,i));const t=M(a,u);a.length=0,a.push(...t),setTimeout(()=>{const g=h.value?V(v.value+"---"+JSON.stringify(a),h.value):v.value+"---"+JSON.stringify(a),r={captchaType:e.value,captcha_code:h.value?V(JSON.stringify(a),h.value):JSON.stringify(a),captcha_key:v.value};K(r).then(H=>{H.code==1?(b.value="#4cae4c",x.value="#5cb85c",d.value="验证成功",C.value=!1,_.value=="pop"&&setTimeout(()=>{n.$parent.clickShow=!1,W()},1500),n.$parent.$emit("success",{captchaVerification:g})):(n.$parent.$emit("error",n),b.value="#d9534f",x.value="#d9534f",d.value="验证失败",setTimeout(()=>{W()},700))})},400)}o.value<z.value&&(o.value=T(k(S,i)))},k=function(i,t){const g=t.offsetX,r=t.offsetY;return{x:g,y:r}},T=function(i){return y.push(Object.assign({},i)),o.value+1},W=function(){y.splice(0,y.length),b.value="#000",x.value="#ddd",C.value=!0,p.splice(0,p.length),a.splice(0,a.length),o.value=1,B(),d.value="验证失败",j.value=!0};function B(){const i={captchaType:e.value};G(i).then(t=>{t.code==1?(N.value=t.data.originalImageBase64,v.value=t.data.token,h.value=t.data.secretKey,w.value=t.data.wordList,d.value="请依次点击【"+w.value.join(",")+"】"):d.value=t.msg})}const M=function(i,t){return i.map(r=>{const H=Math.round(310*r.x/parseInt(t.imgWidth)),E=Math.round(155*r.y/parseInt(t.imgHeight));return{x:H,y:E}})};return{secretKey:h,checkNum:z,fontPos:p,checkPosArr:a,num:o,pointBackImgBase:N,pointTextList:w,backToken:v,setSize:u,tempPoints:y,text:d,barAreaColor:b,barAreaBorderColor:x,showRefresh:j,bindingClick:C,init:J,canvas:S,canvasClick:D,getMousePos:k,createPoint:T,refresh:W,getPictrue:B,pointTransfrom:M}}},ne={style:{position:"relative"}},se={class:"verify-img-out"},oe=l("i",{class:"iconfont icon-refresh"},null,-1),re=[oe],ce=["src"],le={class:"verify-msg"};function he(A,f,_,e,R,q){return P(),I("div",ne,[l("div",se,[l("div",{class:"verify-img-panel",style:O({width:e.setSize.imgWidth,height:e.setSize.imgHeight,"background-size":e.setSize.imgWidth+" "+e.setSize.imgHeight,"margin-bottom":_.vSpace+"px"})},[Z(l("div",{class:"verify-refresh",style:{"z-index":"3"},onClick:f[0]||(f[0]=(...c)=>e.refresh&&e.refresh(...c))},re,512),[[U,e.showRefresh]]),l("img",{src:"data:image/png;base64,"+e.pointBackImgBase,ref:"canvas",alt:"",style:{width:"100%",height:"100%",display:"block"},onClick:f[1]||(f[1]=c=>e.bindingClick?e.canvasClick(c):void 0)},null,8,ce),(P(!0),I($,null,ee(e.tempPoints,(c,n)=>(P(),I("div",{key:n,class:"point-area",style:O({"background-color":"#1abd6c",color:"#fff","z-index":9999,width:"20px",height:"20px","text-align":"center","line-height":"20px","border-radius":"50%",position:"absolute",top:parseInt(c.y-10)+"px",left:parseInt(c.x-10)+"px"})},L(n+1),5))),128))],4)]),l("div",{class:"verify-bar-area",style:O({width:e.setSize.imgWidth,color:this.barAreaColor,"border-color":this.barAreaBorderColor,"line-height":this.barSize.height})},[l("span",le,L(e.text),1)],4)])}const fe=ae(ie,[["render",he]]);export{fe as default};
|
||||
import{r as F,a as V,b as K,c as G}from"./index-17d5e669.js";import{Q,bf as X,r as s,n as m,a_ as Y,h as H,c as I,a as l,x as A,Z,_ as U,F as $,W as ee,t as L,aT as te}from"./index-c66fcffe.js";import{_ as ae}from"./_plugin-vue_export-helper-c27b6911.js";const ie={name:"VerifyPoints",props:{mode:{type:String,default:"fixed"},captchaType:{type:String},vSpace:{type:Number,default:5},imgSize:{type:Object,default(){return{width:"310px",height:"155px"}}},barSize:{type:Object,default(){return{width:"310px",height:"40px"}}}},setup(N,g){const{mode:_,captchaType:e,vSpace:R,imgSize:q,barSize:c}=Q(N),{proxy:n}=X(),h=s(""),z=s(3),p=m([]),a=m([]),o=s(1),O=s(""),w=m([]),v=s(""),u=m({imgHeight:0,imgWidth:0,barHeight:0,barWidth:0}),y=m([]),d=s(""),b=s(void 0),x=s(void 0),j=s(!0),C=s(!0),J=()=>{p.splice(0,p.length),a.splice(0,a.length),o.value=1,B(),te(()=>{const{imgHeight:i,imgWidth:t,barHeight:f,barWidth:r}=F(n);u.imgHeight=i,u.imgWidth=t,u.barHeight=f,u.barWidth=r,n.$parent.$emit("ready",n)})};Y(()=>{J(),n.$el.onselectstart=function(){return!1}});const S=s(null),D=i=>{if(a.push(k(S,i)),o.value==z.value){o.value=T(k(S,i));const t=M(a,u);a.length=0,a.push(...t),setTimeout(()=>{const f=h.value?V(v.value+"---"+JSON.stringify(a),h.value):v.value+"---"+JSON.stringify(a),r={captchaType:e.value,captcha_code:h.value?V(JSON.stringify(a),h.value):JSON.stringify(a),captcha_key:v.value};K(r).then(P=>{P.code==1?(b.value="#4cae4c",x.value="#5cb85c",d.value="验证成功",C.value=!1,_.value=="pop"&&setTimeout(()=>{n.$parent.clickShow=!1,W()},1500),n.$parent.$emit("success",{captchaVerification:f})):(n.$parent.$emit("error",n),b.value="#d9534f",x.value="#d9534f",d.value="验证失败",setTimeout(()=>{W()},700))})},400)}o.value<z.value&&(o.value=T(k(S,i)))},k=function(i,t){const f=t.offsetX,r=t.offsetY;return{x:f,y:r}},T=function(i){return y.push(Object.assign({},i)),o.value+1},W=function(){y.splice(0,y.length),b.value="#000",x.value="#ddd",C.value=!0,p.splice(0,p.length),a.splice(0,a.length),o.value=1,B(),d.value="验证失败",j.value=!0};function B(){const i={captchaType:e.value};G(i).then(t=>{t.code==1?(O.value=t.data.originalImageBase64,v.value=t.data.token,h.value=t.data.secretKey,w.value=t.data.wordList,d.value="请依次点击【"+w.value.join(",")+"】"):d.value=t.msg})}const M=function(i,t){return i.map(r=>{const P=Math.round(310*r.x/parseInt(t.imgWidth)),E=Math.round(155*r.y/parseInt(t.imgHeight));return{x:P,y:E}})};return{secretKey:h,checkNum:z,fontPos:p,checkPosArr:a,num:o,pointBackImgBase:O,pointTextList:w,backToken:v,setSize:u,tempPoints:y,text:d,barAreaColor:b,barAreaBorderColor:x,showRefresh:j,bindingClick:C,init:J,canvas:S,canvasClick:D,getMousePos:k,createPoint:T,refresh:W,getPictrue:B,pointTransfrom:M}}},ne={style:{position:"relative"}},se={class:"verify-img-out"},oe=l("i",{class:"iconfont icon-refresh"},null,-1),re=[oe],ce=["src"],le={class:"verify-msg"};function he(N,g,_,e,R,q){return H(),I("div",ne,[l("div",se,[l("div",{class:"verify-img-panel",style:A({width:e.setSize.imgWidth,height:e.setSize.imgHeight,"background-size":e.setSize.imgWidth+" "+e.setSize.imgHeight,"margin-bottom":_.vSpace+"px"})},[Z(l("div",{class:"verify-refresh",style:{"z-index":"3"},onClick:g[0]||(g[0]=(...c)=>e.refresh&&e.refresh(...c))},re,512),[[U,e.showRefresh]]),l("img",{src:"data:image/png;base64,"+e.pointBackImgBase,ref:"canvas",alt:"",style:{width:"100%",height:"100%",display:"block"},onClick:g[1]||(g[1]=c=>e.bindingClick?e.canvasClick(c):void 0)},null,8,ce),(H(!0),I($,null,ee(e.tempPoints,(c,n)=>(H(),I("div",{key:n,class:"point-area",style:A({"background-color":"#1abd6c",color:"#fff","z-index":9999,width:"20px",height:"20px","text-align":"center","line-height":"20px","border-radius":"50%",position:"absolute",top:parseInt(c.y-10)+"px",left:parseInt(c.x-10)+"px"})},L(n+1),5))),128))],4)]),l("div",{class:"verify-bar-area",style:A({width:e.setSize.imgWidth,color:this.barAreaColor,"border-color":this.barAreaBorderColor,"line-height":this.barSize.height})},[l("span",le,L(e.text),1)],4)])}const ge=ae(ie,[["render",he]]);export{ge as default};
|
||||
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
import{d as $,y as T,f as j,r as m,aO as F,aY as U,o as z,h as w,c as g,e as n,w as s,a,t as o,u as e,q as t,i as r,F as C,B as I,ap as L,aq as M,E as P,aP as Q,aQ as D,aR as G,K,aS as O,a9 as Y}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{g as H}from"./weapp-6e9e1853.js";import{a as J}from"./wxoplatform-9d091425.js";const X={class:"main-container"},Z={class:"flex justify-between items-center"},ee={class:"text-page-title"},te={class:"p-[20px]"},se={class:"panel-title !text-sm"},ae={class:"text-[14px] font-[700]"},ne={class:"text-[#999]"},oe={class:"mt-[20px] mb-[40px] h-[32px]"},le={class:"text-[14px] font-[700]"},pe={class:"text-[#999]"},ie={class:"mt-[20px] mb-[40px] h-[32px]"},ce={class:"text-[14px] font-[700]"},re={class:"text-[#999]"},_e={class:"mt-[20px] mb-[40px] h-[32px]"},de={class:"text-[14px] font-[700]"},ue={class:"text-[#999]"},me=a("div",{class:"mt-[20px] mb-[40px] h-[32px]"},null,-1),he={class:"flex justify-center"},fe={class:"w-[100%] h-[100%] flex items-center justify-center bg-[#f5f7fa]"},xe={class:"mt-[22px] text-center"},ve={class:"text-[12px]"},qe=$({__name:"access",setup(we){const k=T(),_=j(),E=k.meta.title,h=m("/channel/weapp"),d=m(""),f=m({}),x=m({}),b=async()=>{await H().then(({data:p})=>{f.value=p,d.value=p.qr_code})};F(async()=>{await b(),await U().then(({data:p})=>{x.value=p}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&b()})}),z(()=>{document.removeEventListener("visibilitychange",()=>{})});const S=p=>{window.open(p,"_blank")},A=p=>{_.push({path:h.value})},B=()=>{J().then(({data:p})=>{window.open(p)})};return(p,l)=>{const v=L,V=M,i=P,u=Q,q=D,y=G,R=K,N=O,W=Y;return w(),g("div",X,[n(W,{class:"card !border-none",shadow:"never"},{default:s(()=>[a("div",Z,[a("span",ee,o(e(E)),1)]),n(V,{modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=c=>h.value=c),class:"mt-[20px]",onTabChange:A},{default:s(()=>[n(v,{label:e(t)("weappAccessFlow"),name:"/channel/weapp"},null,8,["label"]),n(v,{label:e(t)("subscribeMessage"),name:"/channel/weapp/message"},null,8,["label"]),n(v,{label:e(t)("weappRelease"),name:"/channel/weapp/code"},null,8,["label"])]),_:1},8,["modelValue"]),a("div",te,[a("h3",se,o(e(t)("weappInlet")),1),n(N,null,{default:s(()=>[n(y,{span:20},{default:s(()=>[n(q,{class:"!mt-[10px]",active:4,direction:"vertical"},{default:s(()=>[n(u,null,{title:s(()=>[a("p",ae,o(e(t)("weappAttestation")),1)]),description:s(()=>[a("span",ne,o(e(t)("weappAttest")),1),a("div",oe,[n(i,{type:"primary",onClick:l[1]||(l[1]=c=>S("https://mp.weixin.qq.com/"))},{default:s(()=>[r(o(e(t)("clickAccess")),1)]),_:1})])]),_:1}),n(u,null,{title:s(()=>[a("p",le,o(e(t)("weappSetting")),1)]),description:s(()=>[a("span",pe,o(e(t)("emplace")),1),a("div",ie,[x.value.app_id&&x.value.app_secret?(w(),g(C,{key:0},[n(i,{type:"primary",onClick:l[2]||(l[2]=c=>e(_).push("/channel/weapp/config"))},{default:s(()=>[r(o(f.value.app_id?e(t)("seeConfig"):e(t)("weappSettingBtn")),1)]),_:1}),n(i,{type:"primary",plain:"",onClick:B},{default:s(()=>[r(o(f.value.is_authorization?e(t)("refreshAuth"):e(t)("authWeapp")),1)]),_:1})],64)):(w(),g(C,{key:1},[n(i,{type:"primary",onClick:l[3]||(l[3]=c=>e(_).push("/channel/weapp/config"))},{default:s(()=>[r(o(e(t)("weappSettingBtn")),1)]),_:1}),n(i,{type:"primary",plain:"",onClick:l[4]||(l[4]=c=>e(_).push("/channel/weapp/course"))},{default:s(()=>[r("配置教程")]),_:1})],64))])]),_:1}),n(u,null,{title:s(()=>[a("p",ce,o(e(t)("uploadVersion")),1)]),description:s(()=>[a("span",re,o(e(t)("releaseCourse")),1),a("div",_e,[n(i,{type:"primary",plain:"",onClick:l[5]||(l[5]=c=>e(_).push("/channel/weapp/code"))},{default:s(()=>[r(o(e(t)("weappRelease")),1)]),_:1})])]),_:1}),n(u,null,{title:s(()=>[a("p",de,o(e(t)("completeAccess")),1)]),description:s(()=>[a("span",ue,o(e(t)("releaseCourse")),1),me]),_:1})]),_:1})]),_:1}),n(y,{span:4},{default:s(()=>[a("div",he,[n(R,{class:"w-[180px] h-[180px]",src:d.value?e(I)(d.value):""},{error:s(()=>[a("div",fe,[a("span",null,o(d.value?e(t)("fileErr"):e(t)("emptyQrCode")),1)])]),_:1},8,["src"])]),a("div",xe,[a("p",ve,o(e(t)("clickAccess2")),1)])]),_:1})]),_:1})])]),_:1})])}}});export{qe as default};
|
||||
@ -1 +1 @@
|
||||
import{d as V,y as B,f as S,r as x,aO as N,h as q,c as R,e as o,w as s,a as t,t as n,u as e,q as a,i as h,B as T,ap as j,aq as I,E as P,aP as Q,aQ as $,aR as D,K as F,aS as K,a9 as M}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{g as O}from"./aliapp-da6c6f75.js";const U={class:"main-container"},z={class:"flex justify-between items-center"},G={class:"text-page-title"},H={class:"p-[20px]"},J={class:"panel-title !text-sm"},L={class:"text-[14px] font-[700]"},W={class:"text-[#999]"},X={class:"mt-[20px] mb-[40px] h-[32px]"},Y={class:"text-[14px] font-[700]"},Z={class:"text-[#999]"},tt={class:"mt-[20px] mb-[40px] h-[32px]"},et={class:"text-[14px] font-[700]"},st={class:"text-[#999]"},at=t("div",{class:"mt-[20px] mb-[40px] h-[32px]"},null,-1),ot={class:"text-[14px] font-[700]"},nt={class:"text-[#999]"},lt={class:"flex justify-center"},ct={class:"w-[100%] h-[100%] flex items-center justify-center bg-[#f5f7fa]"},pt={class:"mt-[22px] text-center"},it={class:"text-[12px]"},bt=V({__name:"access",setup(_t){const f=B(),d=S(),v=f.meta.title,_=x("/channel/aliapp"),p=x("");N(async()=>{const c=await O();p.value=c.data.qr_code});const w=c=>{window.open(c,"_blank")},b=c=>{d.push({path:_.value})};return(c,l)=>{const g=j,y=I,m=P,i=Q,C=$,u=D,E=F,k=K,A=M;return q(),R("div",U,[o(A,{class:"card !border-none",shadow:"never"},{default:s(()=>[t("div",z,[t("span",G,n(e(v)),1)]),o(y,{modelValue:_.value,"onUpdate:modelValue":l[0]||(l[0]=r=>_.value=r),class:"my-[20px]",onTabChange:b},{default:s(()=>[o(g,{label:e(a)("weappAccessFlow"),name:"/channel/aliapp"},null,8,["label"])]),_:1},8,["modelValue"]),t("div",H,[t("h3",J,n(e(a)("weappInlet")),1),o(k,null,{default:s(()=>[o(u,{span:20},{default:s(()=>[o(C,{active:4,direction:"vertical"},{default:s(()=>[o(i,null,{title:s(()=>[t("p",L,n(e(a)("weappAttestation")),1)]),description:s(()=>[t("span",W,n(e(a)("weappAttest")),1),t("div",X,[o(m,{type:"primary",onClick:l[1]||(l[1]=r=>w("https://open.alipay.com/develop/manage"))},{default:s(()=>[h(n(e(a)("clickAccess")),1)]),_:1})])]),_:1}),o(i,null,{title:s(()=>[t("p",Y,n(e(a)("weappSetting")),1)]),description:s(()=>[t("span",Z,n(e(a)("emplace")),1),t("div",tt,[o(m,{type:"primary",plain:"",onClick:l[2]||(l[2]=r=>e(d).push("/channel/aliapp/config"))},{default:s(()=>[h(n(e(a)("weappSettingBtn")),1)]),_:1})])]),_:1}),o(i,null,{title:s(()=>[t("p",et,n(e(a)("uploadVersion")),1)]),description:s(()=>[t("span",st,n(e(a)("releaseCourse")),1),at]),_:1}),o(i,null,{title:s(()=>[t("p",ot,n(e(a)("completeAccess")),1)]),description:s(()=>[t("span",nt,n(e(a)("releaseCourse")),1)]),_:1})]),_:1})]),_:1}),o(u,{span:4},{default:s(()=>[t("div",lt,[o(E,{class:"w-[180px] h-[180px]",src:p.value?e(T)(p.value):""},{error:s(()=>[t("div",ct,[t("span",null,n(p.value?e(a)("fileErr"):e(a)("emptyQrCode")),1)])]),_:1},8,["src"])]),t("div",pt,[t("p",it,n(e(a)("clickAccess2")),1)])]),_:1})]),_:1})])]),_:1})])}}});export{bt as default};
|
||||
import{d as V,y as B,f as N,r as x,a_ as S,h as T,c as j,e as o,w as s,a as t,t as n,u as e,q as a,i as h,B as q,au as R,av as $,E as I,a$ as D,b0 as F,b1 as K,K as M,b2 as P,a9 as Q}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{g as U}from"./aliapp-81111246.js";const z={class:"main-container"},G={class:"flex justify-between items-center"},H={class:"text-page-title"},J={class:"p-[20px]"},L={class:"panel-title !text-sm"},O={class:"text-[14px] font-[700]"},W={class:"text-[#999]"},X={class:"mt-[20px] mb-[40px] h-[32px]"},Y={class:"text-[14px] font-[700]"},Z={class:"text-[#999]"},tt={class:"mt-[20px] mb-[40px] h-[32px]"},et={class:"text-[14px] font-[700]"},st={class:"text-[#999]"},at=t("div",{class:"mt-[20px] mb-[40px] h-[32px]"},null,-1),ot={class:"text-[14px] font-[700]"},nt={class:"text-[#999]"},lt={class:"flex justify-center"},ct={class:"w-[100%] h-[100%] flex items-center justify-center bg-[#f5f7fa]"},pt={class:"mt-[22px] text-center"},it={class:"text-[12px]"},wt=V({__name:"access",setup(_t){const f=B(),d=N(),v=f.meta.title,_=x("/channel/aliapp"),p=x("");S(async()=>{const c=await U();p.value=c.data.qr_code});const b=c=>{window.open(c,"_blank")},w=c=>{d.push({path:_.value})};return(c,l)=>{const g=R,y=$,m=I,i=D,C=F,u=K,E=M,k=P,A=Q;return T(),j("div",z,[o(A,{class:"card !border-none",shadow:"never"},{default:s(()=>[t("div",G,[t("span",H,n(e(v)),1)]),o(y,{modelValue:_.value,"onUpdate:modelValue":l[0]||(l[0]=r=>_.value=r),class:"my-[20px]",onTabChange:w},{default:s(()=>[o(g,{label:e(a)("weappAccessFlow"),name:"/channel/aliapp"},null,8,["label"])]),_:1},8,["modelValue"]),t("div",J,[t("h3",L,n(e(a)("weappInlet")),1),o(k,null,{default:s(()=>[o(u,{span:20},{default:s(()=>[o(C,{active:4,direction:"vertical"},{default:s(()=>[o(i,null,{title:s(()=>[t("p",O,n(e(a)("weappAttestation")),1)]),description:s(()=>[t("span",W,n(e(a)("weappAttest")),1),t("div",X,[o(m,{type:"primary",onClick:l[1]||(l[1]=r=>b("https://open.alipay.com/develop/manage"))},{default:s(()=>[h(n(e(a)("clickAccess")),1)]),_:1})])]),_:1}),o(i,null,{title:s(()=>[t("p",Y,n(e(a)("weappSetting")),1)]),description:s(()=>[t("span",Z,n(e(a)("emplace")),1),t("div",tt,[o(m,{type:"primary",plain:"",onClick:l[2]||(l[2]=r=>e(d).push("/channel/aliapp/config"))},{default:s(()=>[h(n(e(a)("weappSettingBtn")),1)]),_:1})])]),_:1}),o(i,null,{title:s(()=>[t("p",et,n(e(a)("uploadVersion")),1)]),description:s(()=>[t("span",st,n(e(a)("releaseCourse")),1),at]),_:1}),o(i,null,{title:s(()=>[t("p",ot,n(e(a)("completeAccess")),1)]),description:s(()=>[t("span",nt,n(e(a)("releaseCourse")),1)]),_:1})]),_:1})]),_:1}),o(u,{span:4},{default:s(()=>[t("div",lt,[o(E,{class:"w-[180px] h-[180px]",src:p.value?e(q)(p.value):""},{error:s(()=>[t("div",ct,[t("span",null,n(p.value?e(a)("fileErr"):e(a)("emptyQrCode")),1)])]),_:1},8,["src"])]),t("div",pt,[t("p",it,n(e(a)("clickAccess2")),1)])]),_:1})]),_:1})])]),_:1})])}}});export{wt as default};
|
||||
1
niucloud/public/admin/assets/access-7eb25206.js
Normal file
1
niucloud/public/admin/assets/access-7eb25206.js
Normal file
@ -0,0 +1 @@
|
||||
import{d as W,y as T,f as j,r as m,a_ as F,b8 as U,o as z,h as w,c as b,e as n,w as s,a,t as o,u as e,q as t,i as r,F as C,B as I,au as L,av as M,E as D,a$ as G,b0 as K,b1 as P,K as Q,b2 as H,a9 as J}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{g as O}from"./weapp-0d63f0b9.js";import{a as X}from"./wxoplatform-ddac1110.js";const Y={class:"main-container"},Z={class:"flex justify-between items-center"},ee={class:"text-page-title"},te={class:"p-[20px]"},se={class:"panel-title !text-sm"},ae={class:"text-[14px] font-[700]"},ne={class:"text-[#999]"},oe={class:"mt-[20px] mb-[40px] h-[32px]"},le={class:"text-[14px] font-[700]"},pe={class:"text-[#999]"},ie={class:"mt-[20px] mb-[40px] h-[32px]"},ce={class:"text-[14px] font-[700]"},re={class:"text-[#999]"},_e={class:"mt-[20px] mb-[40px] h-[32px]"},de={class:"text-[14px] font-[700]"},ue={class:"text-[#999]"},me=a("div",{class:"mt-[20px] mb-[40px] h-[32px]"},null,-1),he={class:"flex justify-center"},fe={class:"w-[100%] h-[100%] flex items-center justify-center bg-[#f5f7fa]"},xe={class:"mt-[22px] text-center"},ve={class:"text-[12px]"},$e=W({__name:"access",setup(we){const k=T(),_=j(),E=k.meta.title,h=m("/channel/weapp"),d=m(""),f=m({}),x=m({}),g=async()=>{await O().then(({data:p})=>{f.value=p,d.value=p.qr_code})};F(async()=>{await g(),await U().then(({data:p})=>{x.value=p}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&g()})}),z(()=>{document.removeEventListener("visibilitychange",()=>{})});const A=p=>{window.open(p,"_blank")},B=p=>{_.push({path:h.value})},S=()=>{X().then(({data:p})=>{window.open(p)})};return(p,l)=>{const v=L,V=M,i=D,u=G,$=K,y=P,q=Q,N=H,R=J;return w(),b("div",Y,[n(R,{class:"card !border-none",shadow:"never"},{default:s(()=>[a("div",Z,[a("span",ee,o(e(E)),1)]),n(V,{modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=c=>h.value=c),class:"mt-[20px]",onTabChange:B},{default:s(()=>[n(v,{label:e(t)("weappAccessFlow"),name:"/channel/weapp"},null,8,["label"]),n(v,{label:e(t)("subscribeMessage"),name:"/channel/weapp/message"},null,8,["label"]),n(v,{label:e(t)("weappRelease"),name:"/channel/weapp/code"},null,8,["label"])]),_:1},8,["modelValue"]),a("div",te,[a("h3",se,o(e(t)("weappInlet")),1),n(N,null,{default:s(()=>[n(y,{span:20},{default:s(()=>[n($,{class:"!mt-[10px]",active:4,direction:"vertical"},{default:s(()=>[n(u,null,{title:s(()=>[a("p",ae,o(e(t)("weappAttestation")),1)]),description:s(()=>[a("span",ne,o(e(t)("weappAttest")),1),a("div",oe,[n(i,{type:"primary",onClick:l[1]||(l[1]=c=>A("https://mp.weixin.qq.com/"))},{default:s(()=>[r(o(e(t)("clickAccess")),1)]),_:1})])]),_:1}),n(u,null,{title:s(()=>[a("p",le,o(e(t)("weappSetting")),1)]),description:s(()=>[a("span",pe,o(e(t)("emplace")),1),a("div",ie,[x.value.app_id&&x.value.app_secret?(w(),b(C,{key:0},[n(i,{type:"primary",onClick:l[2]||(l[2]=c=>e(_).push("/channel/weapp/config"))},{default:s(()=>[r(o(f.value.app_id?e(t)("seeConfig"):e(t)("weappSettingBtn")),1)]),_:1}),n(i,{type:"primary",plain:"",onClick:S},{default:s(()=>[r(o(f.value.is_authorization?e(t)("refreshAuth"):e(t)("authWeapp")),1)]),_:1})],64)):(w(),b(C,{key:1},[n(i,{type:"primary",onClick:l[3]||(l[3]=c=>e(_).push("/channel/weapp/config"))},{default:s(()=>[r(o(e(t)("weappSettingBtn")),1)]),_:1}),n(i,{type:"primary",plain:"",onClick:l[4]||(l[4]=c=>e(_).push("/channel/weapp/course"))},{default:s(()=>[r("配置教程")]),_:1})],64))])]),_:1}),n(u,null,{title:s(()=>[a("p",ce,o(e(t)("uploadVersion")),1)]),description:s(()=>[a("span",re,o(e(t)("releaseCourse")),1),a("div",_e,[n(i,{type:"primary",plain:"",onClick:l[5]||(l[5]=c=>e(_).push("/channel/weapp/code"))},{default:s(()=>[r(o(e(t)("weappRelease")),1)]),_:1})])]),_:1}),n(u,null,{title:s(()=>[a("p",de,o(e(t)("completeAccess")),1)]),description:s(()=>[a("span",ue,o(e(t)("releaseCourse")),1),me]),_:1})]),_:1})]),_:1}),n(y,{span:4},{default:s(()=>[a("div",he,[n(q,{class:"w-[180px] h-[180px]",src:d.value?e(I)(d.value):""},{error:s(()=>[a("div",fe,[a("span",null,o(d.value?e(t)("fileErr"):e(t)("emptyQrCode")),1)])]),_:1},8,["src"])]),a("div",xe,[a("p",ve,o(e(t)("clickAccess2")),1)])]),_:1})]),_:1})])]),_:1})])}}});export{$e as default};
|
||||
@ -1 +1 @@
|
||||
import{d as W,y as R,f as $,r as u,aO as j,aY as F,o as U,h as w,c as b,e as a,w as s,a as n,t as o,u as e,q as t,i as r,F as z,s as I,B as L,ap as M,aq as P,E as Q,aP as D,aQ as G,aR as K,K as O,aS as Y,a9 as H}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{g as J}from"./wechat-bc63a74e.js";import{a as X}from"./wxoplatform-9d091425.js";const Z={class:"main-container"},ee={class:"flex justify-between items-center"},te={class:"text-page-title"},ae={class:"p-[20px]"},se={class:"panel-title !text-sm"},ne={class:"text-[14px] font-[700]"},oe={class:"text-[#999]"},le={class:"mt-[20px] mb-[40px] h-[32px]"},ce={class:"text-[14px] font-[700]"},ie={class:"text-[#999]"},pe={class:"mt-[20px] mb-[40px] h-[32px]"},re={class:"text-[14px] font-[700]"},_e={class:"text-[#999]"},de={class:"mt-[20px] mb-[40px] h-[32px]"},me={class:"flex justify-center"},ue={class:"w-[100%] h-[100%] flex items-center justify-center bg-[#f5f7fa]"},he={class:"mt-[22px] text-center"},fe={class:"text-[12px]"},Be=W({__name:"access",setup(ve){const C=R(),_=$(),k=C.meta.title,h=u("/channel/wechat"),d=u(""),f=u({}),v=u({}),g=async()=>{await J().then(({data:l})=>{f.value=l,d.value=l.qr_code})};j(async()=>{await g(),await F().then(({data:l})=>{v.value=l}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&g()})}),U(()=>{document.removeEventListener("visibilitychange",()=>{})});const E=l=>{window.open(l,"_blank")},S=l=>{_.push({path:h.value})},A=()=>{X().then(({data:l})=>{window.open(l)})};return(l,c)=>{const m=M,B=P,i=Q,x=D,q=G,y=K,V=O,N=Y,T=H;return w(),b("div",Z,[a(T,{class:"card !border-none",shadow:"never"},{default:s(()=>[n("div",ee,[n("span",te,o(e(k)),1)]),a(B,{modelValue:h.value,"onUpdate:modelValue":c[0]||(c[0]=p=>h.value=p),class:"my-[20px]",onTabChange:S},{default:s(()=>[a(m,{label:e(t)("wechatAccessFlow"),name:"/channel/wechat"},null,8,["label"]),a(m,{label:e(t)("customMenu"),name:"/channel/wechat/menu"},null,8,["label"]),a(m,{label:e(t)("wechatTemplate"),name:"/channel/wechat/message"},null,8,["label"]),a(m,{label:e(t)("reply"),name:"/channel/wechat/reply"},null,8,["label"])]),_:1},8,["modelValue"]),n("div",ae,[n("h3",se,o(e(t)("wechatInlet")),1),a(N,null,{default:s(()=>[a(y,{span:20},{default:s(()=>[a(q,{class:"!mt-[10px]",active:3,direction:"vertical"},{default:s(()=>[a(x,null,{title:s(()=>[n("p",ne,o(e(t)("wechatAttestation")),1)]),description:s(()=>[n("span",oe,o(e(t)("wechatAttestation1")),1),n("div",le,[a(i,{type:"primary",onClick:c[1]||(c[1]=p=>E("https://mp.weixin.qq.com/"))},{default:s(()=>[r(o(e(t)("clickAccess")),1)]),_:1})])]),_:1}),a(x,null,{title:s(()=>[n("p",ce,o(e(t)("wechatSetting")),1)]),description:s(()=>[n("span",ie,o(e(t)("wechatSetting1")),1),n("div",pe,[v.value.app_id&&v.value.app_secret?(w(),b(z,{key:0},[a(i,{type:"primary",onClick:c[2]||(c[2]=p=>e(_).push("/channel/wechat/config"))},{default:s(()=>[r(o(f.value.app_id?e(t)("seeConfig"):e(t)("clickSetting")),1)]),_:1}),a(i,{type:"primary",plain:"",onClick:A},{default:s(()=>[r(o(f.value.is_authorization?e(t)("refreshAuth"):e(t)("authWechat")),1)]),_:1})],64)):(w(),I(i,{key:1,type:"primary",onClick:c[3]||(c[3]=p=>e(_).push("/channel/wechat/config"))},{default:s(()=>[r(o(e(t)("clickSetting")),1)]),_:1}))])]),_:1}),a(x,null,{title:s(()=>[n("p",re,o(e(t)("wechatAccess")),1)]),description:s(()=>[n("span",_e,o(e(t)("wechatAccess")),1),n("div",de,[a(i,{type:"primary",plain:"",onClick:c[4]||(c[4]=p=>e(_).push("/channel/wechat/course"))},{default:s(()=>[r(o(e(t)("releaseCourse")),1)]),_:1})])]),_:1})]),_:1})]),_:1}),a(y,{span:4},{default:s(()=>[n("div",me,[a(V,{class:"w-[180px] h-[180px]",src:d.value?e(L)(d.value):""},{error:s(()=>[n("div",ue,[n("span",null,o(d.value?e(t)("fileErr"):e(t)("emptyQrCode")),1)])]),_:1},8,["src"])]),n("div",he,[n("p",fe,o(e(t)("clickAccess2")),1)])]),_:1})]),_:1})])]),_:1})])}}});export{Be as default};
|
||||
import{d as W,y as $,f as j,r as m,a_ as F,b8 as R,o as U,h as w,c as y,e as a,w as s,a as n,t as o,u as e,q as t,i as r,F as z,s as I,B as L,au as M,av as D,E as G,a$ as K,b0 as P,b1 as Q,K as H,b2 as J,a9 as O}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{g as X}from"./wechat-4ff761e7.js";import{a as Y}from"./wxoplatform-ddac1110.js";const Z={class:"main-container"},ee={class:"flex justify-between items-center"},te={class:"text-page-title"},ae={class:"p-[20px]"},se={class:"panel-title !text-sm"},ne={class:"text-[14px] font-[700]"},oe={class:"text-[#999]"},le={class:"mt-[20px] mb-[40px] h-[32px]"},ce={class:"text-[14px] font-[700]"},ie={class:"text-[#999]"},pe={class:"mt-[20px] mb-[40px] h-[32px]"},re={class:"text-[14px] font-[700]"},_e={class:"text-[#999]"},ue={class:"mt-[20px] mb-[40px] h-[32px]"},de={class:"flex justify-center"},me={class:"w-[100%] h-[100%] flex items-center justify-center bg-[#f5f7fa]"},he={class:"mt-[22px] text-center"},fe={class:"text-[12px]"},Be=W({__name:"access",setup(ve){const C=$(),_=j(),k=C.meta.title,h=m("/channel/wechat"),u=m(""),f=m({}),v=m({}),b=async()=>{await X().then(({data:l})=>{f.value=l,u.value=l.qr_code})};F(async()=>{await b(),await R().then(({data:l})=>{v.value=l}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&b()})}),U(()=>{document.removeEventListener("visibilitychange",()=>{})});const E=l=>{window.open(l,"_blank")},A=l=>{_.push({path:h.value})},S=()=>{Y().then(({data:l})=>{window.open(l)})};return(l,c)=>{const d=M,B=D,i=G,x=K,V=P,g=Q,q=H,N=J,T=O;return w(),y("div",Z,[a(T,{class:"card !border-none",shadow:"never"},{default:s(()=>[n("div",ee,[n("span",te,o(e(k)),1)]),a(B,{modelValue:h.value,"onUpdate:modelValue":c[0]||(c[0]=p=>h.value=p),class:"my-[20px]",onTabChange:A},{default:s(()=>[a(d,{label:e(t)("wechatAccessFlow"),name:"/channel/wechat"},null,8,["label"]),a(d,{label:e(t)("customMenu"),name:"/channel/wechat/menu"},null,8,["label"]),a(d,{label:e(t)("wechatTemplate"),name:"/channel/wechat/message"},null,8,["label"]),a(d,{label:e(t)("reply"),name:"/channel/wechat/reply"},null,8,["label"])]),_:1},8,["modelValue"]),n("div",ae,[n("h3",se,o(e(t)("wechatInlet")),1),a(N,null,{default:s(()=>[a(g,{span:20},{default:s(()=>[a(V,{class:"!mt-[10px]",active:3,direction:"vertical"},{default:s(()=>[a(x,null,{title:s(()=>[n("p",ne,o(e(t)("wechatAttestation")),1)]),description:s(()=>[n("span",oe,o(e(t)("wechatAttestation1")),1),n("div",le,[a(i,{type:"primary",onClick:c[1]||(c[1]=p=>E("https://mp.weixin.qq.com/"))},{default:s(()=>[r(o(e(t)("clickAccess")),1)]),_:1})])]),_:1}),a(x,null,{title:s(()=>[n("p",ce,o(e(t)("wechatSetting")),1)]),description:s(()=>[n("span",ie,o(e(t)("wechatSetting1")),1),n("div",pe,[v.value.app_id&&v.value.app_secret?(w(),y(z,{key:0},[a(i,{type:"primary",onClick:c[2]||(c[2]=p=>e(_).push("/channel/wechat/config"))},{default:s(()=>[r(o(f.value.app_id?e(t)("seeConfig"):e(t)("clickSetting")),1)]),_:1}),a(i,{type:"primary",plain:"",onClick:S},{default:s(()=>[r(o(f.value.is_authorization?e(t)("refreshAuth"):e(t)("authWechat")),1)]),_:1})],64)):(w(),I(i,{key:1,type:"primary",onClick:c[3]||(c[3]=p=>e(_).push("/channel/wechat/config"))},{default:s(()=>[r(o(e(t)("clickSetting")),1)]),_:1}))])]),_:1}),a(x,null,{title:s(()=>[n("p",re,o(e(t)("wechatAccess")),1)]),description:s(()=>[n("span",_e,o(e(t)("wechatAccess")),1),n("div",ue,[a(i,{type:"primary",plain:"",onClick:c[4]||(c[4]=p=>e(_).push("/channel/wechat/course"))},{default:s(()=>[r(o(e(t)("releaseCourse")),1)]),_:1})])]),_:1})]),_:1})]),_:1}),a(g,{span:4},{default:s(()=>[n("div",de,[a(q,{class:"w-[180px] h-[180px]",src:u.value?e(L)(u.value):""},{error:s(()=>[n("div",me,[n("span",null,o(u.value?e(t)("fileErr"):e(t)("emptyQrCode")),1)])]),_:1},8,["src"])]),n("div",he,[n("p",fe,o(e(t)("clickAccess2")),1)])]),_:1})]),_:1})])]),_:1})])}}});export{Be as default};
|
||||
File diff suppressed because one or more lines are too long
1
niucloud/public/admin/assets/account-b09d008b.js
Normal file
1
niucloud/public/admin/assets/account-b09d008b.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as o}from"./add-member.vue_vue_type_script_setup_true_lang-1da5bf6d.js";import"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import"./member-a91f9bf8.js";export{o as default};
|
||||
import{_ as o}from"./add-member.vue_vue_type_script_setup_true_lang-349a6a19.js";import"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import"./member-aeb24aff.js";export{o as default};
|
||||
@ -1 +1 @@
|
||||
import{d as I,r as m,n as L,l as R,q as o,h as N,s as M,w as d,a as j,e as s,i as k,t as C,u as t,Z as z,bN as A,L as O,M as T,N as Z,E as K,V as S,a3 as G}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{p as J,z as Q,A as W}from"./member-a91f9bf8.js";const X={class:"dialog-footer"},me=I({__name:"add-member",emits:["complete"],setup(Y,{expose:$,emit:x}){const p=m(!1),i=m(!1),b=m(!1);let f="",c="";const w=m(!0),v=m(!0),g=m(!0),_={member_id:"",nickname:"",member_no:"",init_member_no:"",mobile:"",password:"",password_copy:""},r=L({..._}),y=m(),P=R(()=>({member_no:[{required:!0,message:o("memberNoPlaceholder"),trigger:"blur"},{validator:B,trigger:"blur"}],mobile:[{required:!0,message:o("mobilePlaceholder"),trigger:"blur"},{validator:D,trigger:"blur"}],password:[{required:!0,message:o("passwordPlaceholder"),trigger:"blur"}],password_copy:[{required:!0,message:o("passwordPlaceholder"),trigger:"blur"},{validator:E,trigger:"blur"}]})),D=(n,e,a)=>{e&&!/^1[3-9]\d{9}$/.test(e)?a(new Error(o("mobileHint"))):a()},E=(n,e,a)=>{e!=r.password?a(o("doubleCipherHint")):a()},B=(n,e,a)=>{e&&!/^[0-9a-zA-Z]*$/g.test(e)?a(new Error(o("memberNoHint"))):a()},U=async()=>{await Q().then(n=>{c=n.data}).catch(()=>{})},q=async n=>{if(i.value||!n)return;const e=W;await n.validate(async a=>{if(a){if(i.value=!0,b.value)return;b.value=!0,e(r).then(V=>{i.value=!1,b.value=!1,p.value=!1,x("complete")}).catch(()=>{i.value=!1,b.value=!1})}})};return $({showDialog:p,setFormData:async(n=null)=>{if(i.value=!0,Object.assign(r,_),f=o("addMember"),n){f=o("updateMember");const e=await(await J(n.member_id)).data;e&&Object.keys(r).forEach(a=>{e[a]!=null&&(r[a]=e[a])})}else await U(),r.member_no=c,r.init_member_no=c;i.value=!1}}),(n,e)=>{const a=O,u=T,V=Z,h=K,F=S,H=G;return N(),M(F,{modelValue:p.value,"onUpdate:modelValue":e[14]||(e[14]=l=>p.value=l),title:t(f),width:"500px","destroy-on-close":!0},{footer:d(()=>[j("span",X,[s(h,{onClick:e[12]||(e[12]=l=>p.value=!1)},{default:d(()=>[k(C(t(o)("cancel")),1)]),_:1}),s(h,{type:"primary",loading:i.value,onClick:e[13]||(e[13]=l=>q(y.value))},{default:d(()=>[k(C(t(o)("confirm")),1)]),_:1},8,["loading"])])]),default:d(()=>[z((N(),M(V,{model:r,"label-width":"90px",ref_key:"formRef",ref:y,rules:t(P),class:"page-form"},{default:d(()=>[s(u,{label:t(o)("memberNo"),prop:"member_no"},{default:d(()=>[s(a,{modelValue:r.member_no,"onUpdate:modelValue":e[0]||(e[0]=l=>r.member_no=l),modelModifiers:{trim:!0},clearable:"",maxlength:"20",placeholder:t(o)("memberNoPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(u,{label:t(o)("mobile"),prop:"mobile"},{default:d(()=>[s(a,{modelValue:r.mobile,"onUpdate:modelValue":e[1]||(e[1]=l=>r.mobile=l),modelModifiers:{trim:!0},clearable:"",placeholder:t(o)("mobilePlaceholder"),maxlength:"11",onKeyup:e[2]||(e[2]=l=>t(A)(l)),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(u,{label:t(o)("nickname")},{default:d(()=>[s(a,{modelValue:r.nickname,"onUpdate:modelValue":e[3]||(e[3]=l=>r.nickname=l),modelModifiers:{trim:!0},clearable:"",placeholder:t(o)("nickNamePlaceholder"),class:"input-width",maxlength:"10","show-word-limit":"",readonly:w.value,onClick:e[4]||(e[4]=l=>w.value=!1),onBlur:e[5]||(e[5]=l=>w.value=!0)},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"]),s(u,{label:t(o)("password"),prop:"password"},{default:d(()=>[s(a,{modelValue:r.password,"onUpdate:modelValue":e[6]||(e[6]=l=>r.password=l),modelModifiers:{trim:!0},type:"password",placeholder:t(o)("passwordPlaceholder"),clearable:"",class:"input-width","show-password":!0,readonly:v.value,onClick:e[7]||(e[7]=l=>v.value=!1),onBlur:e[8]||(e[8]=l=>v.value=!0)},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"]),s(u,{label:t(o)("passwordCopy"),prop:"password_copy"},{default:d(()=>[s(a,{modelValue:r.password_copy,"onUpdate:modelValue":e[9]||(e[9]=l=>r.password_copy=l),modelModifiers:{trim:!0},type:"password",placeholder:t(o)("passwordPlaceholder"),clearable:"",class:"input-width","show-password":!0,readonly:g.value,onClick:e[10]||(e[10]=l=>g.value=!1),onBlur:e[11]||(e[11]=l=>g.value=!0)},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"])]),_:1},8,["model","rules"])),[[H,i.value]])]),_:1},8,["modelValue","title"])}}});export{me as _};
|
||||
import{d as I,r as m,n as L,l as R,q as o,h as N,s as M,w as d,a as Z,e as s,i as k,t as C,u as t,Z as j,bZ as z,L as A,M as O,N as T,E as K,V as S,a3 as G}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{p as J,z as Q,A as W}from"./member-aeb24aff.js";const X={class:"dialog-footer"},me=I({__name:"add-member",emits:["complete"],setup(Y,{expose:$,emit:x}){const p=m(!1),i=m(!1),b=m(!1);let f="",c="";const w=m(!0),v=m(!0),g=m(!0),_={member_id:"",nickname:"",member_no:"",init_member_no:"",mobile:"",password:"",password_copy:""},r=L({..._}),y=m(),P=R(()=>({member_no:[{required:!0,message:o("memberNoPlaceholder"),trigger:"blur"},{validator:B,trigger:"blur"}],mobile:[{required:!0,message:o("mobilePlaceholder"),trigger:"blur"},{validator:D,trigger:"blur"}],password:[{required:!0,message:o("passwordPlaceholder"),trigger:"blur"}],password_copy:[{required:!0,message:o("passwordPlaceholder"),trigger:"blur"},{validator:E,trigger:"blur"}]})),D=(n,e,a)=>{e&&!/^1[3-9]\d{9}$/.test(e)?a(new Error(o("mobileHint"))):a()},E=(n,e,a)=>{e!=r.password?a(o("doubleCipherHint")):a()},B=(n,e,a)=>{e&&!/^[0-9a-zA-Z]*$/g.test(e)?a(new Error(o("memberNoHint"))):a()},U=async()=>{await Q().then(n=>{c=n.data}).catch(()=>{})},q=async n=>{if(i.value||!n)return;const e=W;await n.validate(async a=>{if(a){if(i.value=!0,b.value)return;b.value=!0,e(r).then(V=>{i.value=!1,b.value=!1,p.value=!1,x("complete")}).catch(()=>{i.value=!1,b.value=!1})}})};return $({showDialog:p,setFormData:async(n=null)=>{if(i.value=!0,Object.assign(r,_),f=o("addMember"),n){f=o("updateMember");const e=await(await J(n.member_id)).data;e&&Object.keys(r).forEach(a=>{e[a]!=null&&(r[a]=e[a])})}else await U(),r.member_no=c,r.init_member_no=c;i.value=!1}}),(n,e)=>{const a=A,u=O,V=T,h=K,F=S,H=G;return N(),M(F,{modelValue:p.value,"onUpdate:modelValue":e[14]||(e[14]=l=>p.value=l),title:t(f),width:"500px","destroy-on-close":!0},{footer:d(()=>[Z("span",X,[s(h,{onClick:e[12]||(e[12]=l=>p.value=!1)},{default:d(()=>[k(C(t(o)("cancel")),1)]),_:1}),s(h,{type:"primary",loading:i.value,onClick:e[13]||(e[13]=l=>q(y.value))},{default:d(()=>[k(C(t(o)("confirm")),1)]),_:1},8,["loading"])])]),default:d(()=>[j((N(),M(V,{model:r,"label-width":"90px",ref_key:"formRef",ref:y,rules:t(P),class:"page-form"},{default:d(()=>[s(u,{label:t(o)("memberNo"),prop:"member_no"},{default:d(()=>[s(a,{modelValue:r.member_no,"onUpdate:modelValue":e[0]||(e[0]=l=>r.member_no=l),modelModifiers:{trim:!0},clearable:"",maxlength:"20",placeholder:t(o)("memberNoPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(u,{label:t(o)("mobile"),prop:"mobile"},{default:d(()=>[s(a,{modelValue:r.mobile,"onUpdate:modelValue":e[1]||(e[1]=l=>r.mobile=l),modelModifiers:{trim:!0},clearable:"",placeholder:t(o)("mobilePlaceholder"),maxlength:"11",onKeyup:e[2]||(e[2]=l=>t(z)(l)),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(u,{label:t(o)("nickname")},{default:d(()=>[s(a,{modelValue:r.nickname,"onUpdate:modelValue":e[3]||(e[3]=l=>r.nickname=l),modelModifiers:{trim:!0},clearable:"",placeholder:t(o)("nickNamePlaceholder"),class:"input-width",maxlength:"10","show-word-limit":"",readonly:w.value,onClick:e[4]||(e[4]=l=>w.value=!1),onBlur:e[5]||(e[5]=l=>w.value=!0)},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"]),s(u,{label:t(o)("password"),prop:"password"},{default:d(()=>[s(a,{modelValue:r.password,"onUpdate:modelValue":e[6]||(e[6]=l=>r.password=l),modelModifiers:{trim:!0},type:"password",placeholder:t(o)("passwordPlaceholder"),clearable:"",class:"input-width","show-password":!0,readonly:v.value,onClick:e[7]||(e[7]=l=>v.value=!1),onBlur:e[8]||(e[8]=l=>v.value=!0)},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"]),s(u,{label:t(o)("passwordCopy"),prop:"password_copy"},{default:d(()=>[s(a,{modelValue:r.password_copy,"onUpdate:modelValue":e[9]||(e[9]=l=>r.password_copy=l),modelModifiers:{trim:!0},type:"password",placeholder:t(o)("passwordPlaceholder"),clearable:"",class:"input-width","show-password":!0,readonly:g.value,onClick:e[10]||(e[10]=l=>g.value=!1),onBlur:e[11]||(e[11]=l=>g.value=!0)},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"])]),_:1},8,["model","rules"])),[[H,i.value]])]),_:1},8,["modelValue","title"])}}});export{me as _};
|
||||
@ -1 +1 @@
|
||||
import{_ as o}from"./add-table.vue_vue_type_script_setup_true_lang-de0d6269.js";import"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./tools-1119a5b9.js";export{o as default};
|
||||
import{_ as o}from"./add-table.vue_vue_type_script_setup_true_lang-8c85d16b.js";import"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./tools-3d3666ce.js";export{o as default};
|
||||
@ -1 +1 @@
|
||||
import{d as L,f as N,r as c,n as E,l as k,h as p,s as _,w as o,a as h,Z as x,u as t,t as b,q as n,e as d,i as B,ag as z,L as q,E as F,ah as P,V as U,a3 as G}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{k as I,l as M}from"./tools-1119a5b9.js";const le=L({__name:"add-table",setup(R,{expose:f}){const g=N(),m=c(!1),s=c(""),e=E({loading:!0,data:[],searchParam:{table_name:"",table_content:""}}),v=k(()=>e.data.filter(a=>!s.value||a.Name.toLowerCase().includes(s.value.toLowerCase())||a.Comment.toLowerCase().includes(s.value.toLowerCase()))),u=()=>{e.loading=!0,I().then(a=>{e.loading=!1,e.data=a.data}).catch(()=>{e.loading=!1})};u();const w=a=>{const l=a.Name;e.loading=!0,M({table_name:l}).then(i=>{e.loading=!1,m.value=!1,g.push({path:"/tools/code/edit",query:{id:i.data.id}})}).catch(()=>{e.loading=!1})};return f({showDialog:m,setFormData:async(a=null)=>{u()}}),(a,l)=>{const i=z,C=q,V=F,D=P,y=U,T=G;return p(),_(y,{modelValue:m.value,"onUpdate:modelValue":l[1]||(l[1]=r=>m.value=r),title:t(n)("addCode"),width:"800px","destroy-on-close":!0},{default:o(()=>[h("div",null,[x((p(),_(D,{data:t(v),size:"large",height:"400"},{empty:o(()=>[h("span",null,b(e.loading?"":t(n)("emptyData")),1)]),default:o(()=>[d(i,{prop:"Name",label:t(n)("tableName"),"min-width":"150"},null,8,["label"]),d(i,{prop:"Comment",label:t(n)("tableComment"),"min-width":"120"},null,8,["label"]),d(i,{align:"right","min-width":"150"},{header:o(()=>[d(C,{modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=r=>s.value=r),modelModifiers:{trim:!0},size:"small",placeholder:t(n)("searchPlaceholder")},null,8,["modelValue","placeholder"])]),default:o(r=>[d(V,{size:"small",type:"primary",onClick:Z=>w(r.row)},{default:o(()=>[B(b(t(n)("addBtn")),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[T,e.loading]])])]),_:1},8,["modelValue","title"])}}});export{le as _};
|
||||
import{d as L,f as N,r as c,n as k,l as E,h as p,s as _,w as o,a as b,Z as x,u as t,t as f,q as n,e as d,i as B,ak as z,L as q,E as F,al as P,V as U,a3 as G}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{k as I,l as M}from"./tools-3d3666ce.js";const le=L({__name:"add-table",setup(R,{expose:h}){const g=N(),m=c(!1),s=c(""),e=k({loading:!0,data:[],searchParam:{table_name:"",table_content:""}}),v=E(()=>e.data.filter(a=>!s.value||a.Name.toLowerCase().includes(s.value.toLowerCase())||a.Comment.toLowerCase().includes(s.value.toLowerCase()))),u=()=>{e.loading=!0,I().then(a=>{e.loading=!1,e.data=a.data}).catch(()=>{e.loading=!1})};u();const w=a=>{const l=a.Name;e.loading=!0,M({table_name:l}).then(i=>{e.loading=!1,m.value=!1,g.push({path:"/tools/code/edit",query:{id:i.data.id}})}).catch(()=>{e.loading=!1})};return h({showDialog:m,setFormData:async(a=null)=>{u()}}),(a,l)=>{const i=z,C=q,V=F,D=P,y=U,T=G;return p(),_(y,{modelValue:m.value,"onUpdate:modelValue":l[1]||(l[1]=r=>m.value=r),title:t(n)("addCode"),width:"800px","destroy-on-close":!0},{default:o(()=>[b("div",null,[x((p(),_(D,{data:t(v),size:"large",height:"400"},{empty:o(()=>[b("span",null,f(e.loading?"":t(n)("emptyData")),1)]),default:o(()=>[d(i,{prop:"Name",label:t(n)("tableName"),"min-width":"150"},null,8,["label"]),d(i,{prop:"Comment",label:t(n)("tableComment"),"min-width":"120"},null,8,["label"]),d(i,{align:"right","min-width":"150"},{header:o(()=>[d(C,{modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=r=>s.value=r),modelModifiers:{trim:!0},size:"small",placeholder:t(n)("searchPlaceholder")},null,8,["modelValue","placeholder"])]),default:o(r=>[d(V,{size:"small",type:"primary",onClick:Z=>w(r.row)},{default:o(()=>[B(f(t(n)("addBtn")),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[T,e.loading]])])]),_:1},8,["modelValue","title"])}}});export{le as _};
|
||||
@ -1 +1 @@
|
||||
import{_ as e}from"./add-theme.vue_vue_type_script_setup_true_lang-de121cc0.js";const o=Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));export{o as _};
|
||||
import{_ as e}from"./add-theme.vue_vue_type_script_setup_true_lang-9c73f288.js";const o=Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));export{o as _};
|
||||
@ -1 +1 @@
|
||||
import{d as U,r as d,n as h,l as B,h as N,s as R,w as n,a as q,e as o,i as v,u as _,a6 as F,L as O,M as $,bx as j,N as A,E as I,V as S}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{u as T}from"./diy-7b2b673b.js";const z={class:"dialog-footer"},X=U({__name:"add-theme",emits:["confirm"],setup(L,{expose:g,emit:V}){const y=T(),s=d(!1),i=d(!1),b={title:"",label:"",value:"",tip:""};let f=[];const m=d(""),l=h({...b}),k=r=>{f=r.key,m.value="";for(const e in l)l[e]="";r.data&&Object.keys(r.data).length&&(m.value="edit",Object.keys(l).forEach((e,t)=>{l[e]=r.data[e]?r.data[e]:""})),s.value=!0},p=d(),x=B(()=>({title:[{required:!0,message:"请输入颜色名称",trigger:"blur"}],value:[{required:!0,validator:(r,e,t)=>{e?t():t("请输入颜色value值")},trigger:["blur","change"]}],label:[{required:!0,message:"请输入颜色key值",trigger:"blur"},{validator:(r,e,t)=>{const u=/^[a-zA-Z0-9-]+$/;f.indexOf(e)!=-1&&t("新增颜色key值与已存在颜色key值命名重复,请修改命名"),u.test(e)?t():t("颜色key值只能输入字母、数字和连字符")},trigger:"blur"}]})),w=async r=>{var e;i.value||await((e=p.value)==null?void 0:e.validate(async t=>{i.value||(i.value=!0,t&&(i.value=!1,V("confirm",F(l)),s.value=!1))}))};return g({dialogThemeVisible:s,open:k}),(r,e)=>{const t=O,u=$,E=j,C=A,c=I,D=S;return N(),R(D,{modelValue:s.value,"onUpdate:modelValue":e[6]||(e[6]=a=>s.value=a),title:"新增颜色",width:"550px","align-center":""},{footer:n(()=>[q("div",z,[o(c,{onClick:e[4]||(e[4]=a=>s.value=!1)},{default:n(()=>[v("取消")]),_:1}),o(c,{type:"primary",onClick:e[5]||(e[5]=a=>w(p.value))},{default:n(()=>[v("保存")]),_:1})])]),default:n(()=>[o(C,{model:l,"label-width":"120px",ref_key:"formRef",ref:p,rules:_(x)},{default:n(()=>[o(u,{label:"名字",prop:"title"},{default:n(()=>[o(t,{modelValue:l.title,"onUpdate:modelValue":e[0]||(e[0]=a=>l.title=a),class:"!w-[250px]",maxlength:"7",placeholder:"请输入颜色名称"},null,8,["modelValue"])]),_:1}),o(u,{label:"颜色key值",prop:"label"},{default:n(()=>[o(t,{modelValue:l.label,"onUpdate:modelValue":e[1]||(e[1]=a=>l.label=a),class:"!w-[250px]",maxlength:"20",disabled:m.value=="edit",placeholder:"请输入颜色key值"},null,8,["modelValue","disabled"])]),_:1}),o(u,{label:"颜色value值",prop:"value"},{default:n(()=>[o(E,{modelValue:l.value,"onUpdate:modelValue":e[2]||(e[2]=a=>l.value=a),"show-alpha":"",predefine:_(y).predefineColors},null,8,["modelValue","predefine"])]),_:1}),o(u,{label:"颜色提示"},{default:n(()=>[o(t,{modelValue:l.tip,"onUpdate:modelValue":e[3]||(e[3]=a=>l.tip=a),class:"!w-[250px]",placeholder:"请输入颜色提示"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});export{X as _};
|
||||
import{d as U,r as d,n as h,l as B,h as N,s as R,w as n,a as q,e as o,i as v,u as _,a6 as F,L as O,M as $,bJ as j,N as A,E as I,V as S}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{u as T}from"./diy-03fb37e8.js";const z={class:"dialog-footer"},X=U({__name:"add-theme",emits:["confirm"],setup(J,{expose:g,emit:V}){const y=T(),s=d(!1),i=d(!1),b={title:"",label:"",value:"",tip:""};let f=[];const m=d(""),l=h({...b}),k=r=>{f=r.key,m.value="";for(const e in l)l[e]="";r.data&&Object.keys(r.data).length&&(m.value="edit",Object.keys(l).forEach((e,t)=>{l[e]=r.data[e]?r.data[e]:""})),s.value=!0},p=d(),x=B(()=>({title:[{required:!0,message:"请输入颜色名称",trigger:"blur"}],value:[{required:!0,validator:(r,e,t)=>{e?t():t("请输入颜色value值")},trigger:["blur","change"]}],label:[{required:!0,message:"请输入颜色key值",trigger:"blur"},{validator:(r,e,t)=>{const u=/^[a-zA-Z0-9-]+$/;f.indexOf(e)!=-1&&t("新增颜色key值与已存在颜色key值命名重复,请修改命名"),u.test(e)?t():t("颜色key值只能输入字母、数字和连字符")},trigger:"blur"}]})),w=async r=>{var e;i.value||await((e=p.value)==null?void 0:e.validate(async t=>{i.value||(i.value=!0,t&&(i.value=!1,V("confirm",F(l)),s.value=!1))}))};return g({dialogThemeVisible:s,open:k}),(r,e)=>{const t=O,u=$,E=j,C=A,c=I,D=S;return N(),R(D,{modelValue:s.value,"onUpdate:modelValue":e[6]||(e[6]=a=>s.value=a),title:"新增颜色",width:"550px","align-center":""},{footer:n(()=>[q("div",z,[o(c,{onClick:e[4]||(e[4]=a=>s.value=!1)},{default:n(()=>[v("取消")]),_:1}),o(c,{type:"primary",onClick:e[5]||(e[5]=a=>w(p.value))},{default:n(()=>[v("保存")]),_:1})])]),default:n(()=>[o(C,{model:l,"label-width":"120px",ref_key:"formRef",ref:p,rules:_(x)},{default:n(()=>[o(u,{label:"名字",prop:"title"},{default:n(()=>[o(t,{modelValue:l.title,"onUpdate:modelValue":e[0]||(e[0]=a=>l.title=a),class:"!w-[250px]",maxlength:"7",placeholder:"请输入颜色名称"},null,8,["modelValue"])]),_:1}),o(u,{label:"颜色key值",prop:"label"},{default:n(()=>[o(t,{modelValue:l.label,"onUpdate:modelValue":e[1]||(e[1]=a=>l.label=a),class:"!w-[250px]",maxlength:"20",disabled:m.value=="edit",placeholder:"请输入颜色key值"},null,8,["modelValue","disabled"])]),_:1}),o(u,{label:"颜色value值",prop:"value"},{default:n(()=>[o(E,{modelValue:l.value,"onUpdate:modelValue":e[2]||(e[2]=a=>l.value=a),"show-alpha":"",predefine:_(y).predefineColors},null,8,["modelValue","predefine"])]),_:1}),o(u,{label:"颜色提示"},{default:n(()=>[o(t,{modelValue:l.tip,"onUpdate:modelValue":e[3]||(e[3]=a=>l.tip=a),class:"!w-[250px]",placeholder:"请输入颜色提示"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});export{X as _};
|
||||
@ -1 +1 @@
|
||||
import{P as t}from"./index-d3b02fcc.js";function e(n){return t.get("addon/local",n)}function a(n){return t.post(`addon/install/${n.addon}`,n)}function d(n){return t.post(`addon/cloudinstall/${n.addon}`,n)}function s(n){return t.post(`addon/uninstall/${n.addon}`,n,{showSuccessMessage:!0})}function l(n){return t.get(`addon/install/check/${n}`)}function u(){return t.get("addon/installtask")}function i(n){return t.get(`addon/cloudinstall/${n}`)}function r(n){return t.get(`addon/uninstall/check/${n}`)}function c(n){return t.put(`addon/install/cancel/${n}`,{},{showErrorMessage:!1})}function g(){return t.get("addon/list/install")}function f(){return t.get("home/site/group/app_list")}function p(){return t.get("addon/init")}function A(){return t.get("app/index")}export{g as a,A as b,p as c,e as d,u as e,d as f,f as g,i as h,a as i,r as j,c as k,l as p,s as u};
|
||||
import{P as t}from"./index-c66fcffe.js";function d(n){return t.get("addon/local",n)}function o(n){return t.post(`addon/install/${n.addon}`,n)}function a(n){return t.post(`addon/cloudinstall/${n.addon}`,n)}function s(n){return t.post(`addon/uninstall/${n.addon}`,n,{showSuccessMessage:!0})}function l(n){return t.get(`addon/install/check/${n}`)}function u(){return t.get("addon/installtask")}function i(n){return t.get(`addon/cloudinstall/${n}`)}function r(n){return t.get(`addon/uninstall/check/${n}`)}function c(n){return t.put(`addon/install/cancel/${n}`,{},{showErrorMessage:!1})}function g(){return t.get("addon/list/install")}function f(){return t.get("home/site/group/app_list")}function p(){return t.get("addon/init")}function A(){return t.get("app/index")}function h(){return t.get("index/adv_list")}export{g as a,A as b,h as c,p as d,d as e,u as f,f as g,a as h,o as i,i as j,r as k,c as l,l as p,s as u};
|
||||
@ -1 +1 @@
|
||||
import{d as F,y as w,r as f,n as C,h as b,c as y,Z as B,s as D,w as r,e as o,a as l,t as n,u as a,q as i,i as k,c1 as I,a6 as N,c2 as U,aX as L,M as R,a9 as S,N as T,E as j,a3 as q}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css */import A from"./index-3e1976e6.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import"./index.vue_vue_type_style_index_0_lang-00b4d9d7.js";/* empty css *//* empty css */import"./attachment-038885aa.js";import"./index.vue_vue_type_script_setup_true_lang-112a845c.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-2d1a05f1.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-ad49599f.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./sortable.esm-be94e56d.js";const M={class:"main-container"},O={class:"text-[16px] text-[#1D1F3A] font-bold mb-4"},X={class:"panel-title !text-[14px] bg-[#F4F5F7] p-3 border-[#E6E6E6] border-solid border-b-[1px]"},Z={class:"form-tip"},$={class:"box-card mt-[20px] !border-none"},z={class:"panel-title !text-[14px] bg-[#F4F5F7] p-3 border-[#E6E6E6] border-solid border-b-[1px]"},G={class:"form-tip"},H={class:"fixed-footer-wrap"},J={class:"fixed-footer"},Nt=F({__name:"adminlogin",setup(K){const g=w().meta.title,m=f(!0),_=f(),e=C({is_captcha:0,is_site_captcha:0,bg:"",site_bg:""});(async()=>{const p=await(await I()).data;Object.keys(e).forEach(t=>{e[t]=p[t]}),m.value=!1})();const v=async p=>{m.value||!p||await p.validate(t=>{if(t){const d=N(e);U(d).then(()=>{m.value=!1}).catch(()=>{m.value=!1})}})};return(p,t)=>{const d=L,c=R,u=A,h=S,x=T,V=j,E=q;return b(),y("div",M,[B((b(),D(x,{class:"page-form",model:e,"label-width":"150px",ref_key:"ruleFormRef",ref:_},{default:r(()=>[o(h,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[l("h3",O,n(a(g)),1),l("h3",X,n(a(i)("admin")),1),o(c,{label:a(i)("isCaptcha")},{default:r(()=>[o(d,{modelValue:e.is_captcha,"onUpdate:modelValue":t[0]||(t[0]=s=>e.is_captcha=s),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:a(i)("bgImg")},{default:r(()=>[o(u,{modelValue:e.bg,"onUpdate:modelValue":t[1]||(t[1]=s=>e.bg=s)},null,8,["modelValue"]),l("div",Z,n(a(i)("adminBgImgTip")),1)]),_:1},8,["label"]),l("div",$,[l("h3",z,n(a(i)("site")),1),o(c,{label:a(i)("isCaptcha")},{default:r(()=>[o(d,{modelValue:e.is_site_captcha,"onUpdate:modelValue":t[2]||(t[2]=s=>e.is_site_captcha=s),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:a(i)("bgImg")},{default:r(()=>[o(u,{modelValue:e.site_bg,"onUpdate:modelValue":t[3]||(t[3]=s=>e.site_bg=s)},null,8,["modelValue"]),l("div",G,n(a(i)("siteBgImgTip")),1)]),_:1},8,["label"])])]),_:1})]),_:1},8,["model"])),[[E,m.value]]),l("div",H,[l("div",J,[o(V,{type:"primary",onClick:t[4]||(t[4]=s=>v(_.value))},{default:r(()=>[k(n(a(i)("save")),1)]),_:1})])])])}}});export{Nt as default};
|
||||
import{d as F,y as w,r as b,n as C,h as f,c as y,Z as B,s as D,w as r,e as o,a as l,t as n,u as a,q as i,i as k,cg as I,a6 as N,ch as U,b7 as L,M as R,a9 as S,N as T,E as j,a3 as q}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css */import A from"./index-a354a9b3.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import"./index.vue_vue_type_style_index_0_lang-9d9f5669.js";/* empty css *//* empty css */import"./attachment-a43e49d9.js";import"./index.vue_vue_type_script_setup_true_lang-01f18274.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-e310b195.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-4c45033b.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./sortable.esm-be94e56d.js";const M={class:"main-container"},O={class:"text-[16px] text-[#1D1F3A] font-bold mb-4"},Z={class:"panel-title !text-[14px] bg-[#F4F5F7] p-3 border-[#E6E6E6] border-solid border-b-[1px]"},$={class:"form-tip"},z={class:"box-card mt-[20px] !border-none"},G={class:"panel-title !text-[14px] bg-[#F4F5F7] p-3 border-[#E6E6E6] border-solid border-b-[1px]"},H={class:"form-tip"},J={class:"fixed-footer-wrap"},K={class:"fixed-footer"},Nt=F({__name:"adminlogin",setup(P){const g=w().meta.title,m=b(!0),_=b(),e=C({is_captcha:0,is_site_captcha:0,bg:"",site_bg:""});(async()=>{const p=await(await I()).data;Object.keys(e).forEach(t=>{e[t]=p[t]}),m.value=!1})();const v=async p=>{m.value||!p||await p.validate(t=>{if(t){const d=N(e);U(d).then(()=>{m.value=!1}).catch(()=>{m.value=!1})}})};return(p,t)=>{const d=L,c=R,u=A,h=S,x=T,V=j,E=q;return f(),y("div",M,[B((f(),D(x,{class:"page-form",model:e,"label-width":"150px",ref_key:"ruleFormRef",ref:_},{default:r(()=>[o(h,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[l("h3",O,n(a(g)),1),l("h3",Z,n(a(i)("admin")),1),o(c,{label:a(i)("isCaptcha")},{default:r(()=>[o(d,{modelValue:e.is_captcha,"onUpdate:modelValue":t[0]||(t[0]=s=>e.is_captcha=s),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:a(i)("bgImg")},{default:r(()=>[o(u,{modelValue:e.bg,"onUpdate:modelValue":t[1]||(t[1]=s=>e.bg=s)},null,8,["modelValue"]),l("div",$,n(a(i)("adminBgImgTip")),1)]),_:1},8,["label"]),l("div",z,[l("h3",G,n(a(i)("site")),1),o(c,{label:a(i)("isCaptcha")},{default:r(()=>[o(d,{modelValue:e.is_site_captcha,"onUpdate:modelValue":t[2]||(t[2]=s=>e.is_site_captcha=s),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1},8,["label"]),o(c,{label:a(i)("bgImg")},{default:r(()=>[o(u,{modelValue:e.site_bg,"onUpdate:modelValue":t[3]||(t[3]=s=>e.site_bg=s)},null,8,["modelValue"]),l("div",H,n(a(i)("siteBgImgTip")),1)]),_:1},8,["label"])])]),_:1})]),_:1},8,["model"])),[[E,m.value]]),l("div",J,[l("div",K,[o(V,{type:"primary",onClick:t[4]||(t[4]=s=>v(_.value))},{default:r(()=>[k(n(a(i)("save")),1)]),_:1})])])])}}});export{Nt as default};
|
||||
@ -1 +1 @@
|
||||
import{d as v,y,n as k,f as x,h as m,c as E,e as a,w as o,a as i,t as r,u as t,Z as C,s as B,q as n,i as p,c3 as N,ag as T,E as D,ah as L,a9 as A,a3 as V}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */const j={class:"main-container"},R={class:"flex justify-between items-center"},$={class:"text-page-title"},q={class:"mt-[20px]"},X=v({__name:"agreement",setup(z){const _=y().meta.title,e=k({loading:!0,data:[]});(()=>{e.loading=!0,e.data=[],N().then(l=>{Object.keys(l.data).forEach(d=>e.data.push(l.data[d])),e.loading=!1}).catch(()=>{e.loading=!1})})();const u=x(),g=l=>{u.push(`/setting/agreement/edit?key=${l.agreement_key}`)};return(l,d)=>{const s=T,h=D,f=L,b=A,w=V;return m(),E("div",j,[a(b,{class:"box-card !border-none",shadow:"never"},{default:o(()=>[i("div",R,[i("span",$,r(t(_)),1)]),i("div",q,[C((m(),B(f,{data:e.data,size:"large"},{empty:o(()=>[i("span",null,r(e.loading?"":t(n)("emptyData")),1)]),default:o(()=>[a(s,{prop:"type_name",label:t(n)("typeName"),"min-width":"100","show-overflow-tooltip":!0},null,8,["label"]),a(s,{prop:"title",label:t(n)("title"),"min-width":"100","show-overflow-tooltip":!0},null,8,["label"]),a(s,{label:t(n)("updateTime"),"min-width":"180",align:"center"},{default:o(({row:c})=>[p(r(c.update_time||""),1)]),_:1},8,["label"]),a(s,{label:t(n)("operation"),align:"right",fixed:"right",width:"100"},{default:o(({row:c})=>[a(h,{type:"primary",link:"",onClick:Z=>g(c)},{default:o(()=>[p(r(t(n)("config")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[w,e.loading]])])]),_:1})])}}});export{X as default};
|
||||
import{d as v,y,n as k,f as x,h as m,c as E,e as a,w as o,a as i,t as r,u as t,Z as C,s as B,q as n,i as p,ci as N,ak as T,E as D,al as L,a9 as A,a3 as V}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */const j={class:"main-container"},R={class:"flex justify-between items-center"},$={class:"text-page-title"},q={class:"mt-[20px]"},X=v({__name:"agreement",setup(z){const _=y().meta.title,e=k({loading:!0,data:[]});(()=>{e.loading=!0,e.data=[],N().then(l=>{Object.keys(l.data).forEach(d=>e.data.push(l.data[d])),e.loading=!1}).catch(()=>{e.loading=!1})})();const u=x(),g=l=>{u.push(`/setting/agreement/edit?key=${l.agreement_key}`)};return(l,d)=>{const s=T,h=D,f=L,b=A,w=V;return m(),E("div",j,[a(b,{class:"box-card !border-none",shadow:"never"},{default:o(()=>[i("div",R,[i("span",$,r(t(_)),1)]),i("div",q,[C((m(),B(f,{data:e.data,size:"large"},{empty:o(()=>[i("span",null,r(e.loading?"":t(n)("emptyData")),1)]),default:o(()=>[a(s,{prop:"type_name",label:t(n)("typeName"),"min-width":"100","show-overflow-tooltip":!0},null,8,["label"]),a(s,{prop:"title",label:t(n)("title"),"min-width":"100","show-overflow-tooltip":!0},null,8,["label"]),a(s,{label:t(n)("updateTime"),"min-width":"180",align:"center"},{default:o(({row:c})=>[p(r(c.update_time||""),1)]),_:1},8,["label"]),a(s,{label:t(n)("operation"),align:"right",fixed:"right",width:"100"},{default:o(({row:c})=>[a(h,{type:"primary",link:"",onClick:Z=>g(c)},{default:o(()=>[p(r(t(n)("config")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[w,e.loading]])])]),_:1})])}}});export{X as default};
|
||||
@ -1 +1 @@
|
||||
import{d as q,y as M,f as P,r as y,c4 as S,n as T,l as U,q as r,h,c as $,e as a,w as s,u as n,aU as I,Z as j,s as A,a as w,i as k,t as V,c5 as L,c6 as O,aV as H,a9 as Z,L as z,M as G,N as J,E as K,a3 as Q}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css */import{_ as W}from"./index.vue_vue_type_script_setup_true_lang-5640ae91.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_style_index_0_lang-00b4d9d7.js";/* empty css *//* empty css */import"./attachment-038885aa.js";import"./index.vue_vue_type_script_setup_true_lang-112a845c.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-2d1a05f1.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-ad49599f.js";import"./_plugin-vue_export-helper-c27b6911.js";const X={class:"main-container"},Y={class:"fixed-footer-wrap"},ee={class:"fixed-footer"},Se=q({__name:"agreement_edit",setup(te){const d=M(),x=P(),_=d.query.key||"",i=y(!1),E=S(),B=d.meta.title,f={agreement_key:"",content:"",title:"",agreement_key_name:""},t=T({...f});i.value=!0,_&&(async(m="")=>{Object.assign(t,f);const e=await(await L(m)).data;Object.keys(t).forEach(o=>{e[o]!=null&&(t[o]=e[o])}),i.value=!1})(_);const g=y(),D=U(()=>({title:[{required:!0,message:r("titlePlaceholder"),trigger:"blur"}],content:[{required:!0,trigger:["blur","change"],validator:(m,e,o)=>{if(e==="")o(new Error(r("contentPlaceholder")));else{if(e.length<5||e.length>1e5)return o(new Error(r("contentMaxTips"))),!1;o()}}}]})),C=async m=>{i.value||!m||await m.validate(async e=>{if(e){i.value=!0;const o=t;o.key=t.agreement_key,O(o).then(c=>{i.value=!1,p()}).catch(()=>{i.value=!1})}})},p=()=>{E.removeTab(d.path),x.push({path:"/setting/agreement"})};return(m,e)=>{const o=H,c=Z,v=z,u=G,F=W,N=J,b=K,R=Q;return h(),$("div",X,[a(c,{class:"card !border-none",shadow:"never"},{default:s(()=>[a(o,{content:n(B),icon:n(I),onBack:e[0]||(e[0]=l=>p())},null,8,["content","icon"])]),_:1}),j((h(),A(c,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:s(()=>[a(N,{model:t,"label-width":"90px",ref_key:"formRef",ref:g,rules:n(D),class:"page-form"},{default:s(()=>[a(u,{label:n(r)("type")},{default:s(()=>[a(v,{modelValue:t.agreement_key_name,"onUpdate:modelValue":e[1]||(e[1]=l=>t.agreement_key_name=l),modelModifiers:{trim:!0},readonly:"",class:"input-width"},null,8,["modelValue"])]),_:1},8,["label"]),a(u,{label:n(r)("title"),prop:"title"},{default:s(()=>[a(v,{modelValue:t.title,"onUpdate:modelValue":e[2]||(e[2]=l=>t.title=l),modelModifiers:{trim:!0},clearable:"",placeholder:n(r)("titlePlaceholder"),class:"input-width",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(u,{label:n(r)("content"),prop:"content"},{default:s(()=>[a(F,{modelValue:t.content,"onUpdate:modelValue":e[3]||(e[3]=l=>t.content=l)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1})),[[R,i.value]]),w("div",Y,[w("div",ee,[a(b,{type:"primary",onClick:e[4]||(e[4]=l=>C(g.value))},{default:s(()=>[k(V(n(r)("save")),1)]),_:1}),a(b,{onClick:e[5]||(e[5]=l=>p())},{default:s(()=>[k(V(n(r)("cancel")),1)]),_:1})])])])}}});export{Se as default};
|
||||
import{d as q,y as M,f as P,r as y,cj as S,n as T,l as $,q as r,h,c as j,e as a,w as s,u as n,b4 as I,Z as U,s as A,a as w,i as k,t as x,ck as L,cl as O,b5 as H,a9 as Z,L as z,M as G,N as J,E as K,a3 as Q}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css */import{_ as W}from"./index.vue_vue_type_script_setup_true_lang-7252c378.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_style_index_0_lang-9d9f5669.js";/* empty css *//* empty css */import"./attachment-a43e49d9.js";import"./index.vue_vue_type_script_setup_true_lang-01f18274.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-e310b195.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-4c45033b.js";import"./_plugin-vue_export-helper-c27b6911.js";const X={class:"main-container"},Y={class:"fixed-footer-wrap"},ee={class:"fixed-footer"},Se=q({__name:"agreement_edit",setup(te){const d=M(),V=P(),_=d.query.key||"",i=y(!1),E=S(),B=d.meta.title,f={agreement_key:"",content:"",title:"",agreement_key_name:""},t=T({...f});i.value=!0,_&&(async(m="")=>{Object.assign(t,f);const e=await(await L(m)).data;Object.keys(t).forEach(o=>{e[o]!=null&&(t[o]=e[o])}),i.value=!1})(_);const g=y(),D=$(()=>({title:[{required:!0,message:r("titlePlaceholder"),trigger:"blur"}],content:[{required:!0,trigger:["blur","change"],validator:(m,e,o)=>{if(e==="")o(new Error(r("contentPlaceholder")));else{if(e.length<5||e.length>1e5)return o(new Error(r("contentMaxTips"))),!1;o()}}}]})),C=async m=>{i.value||!m||await m.validate(async e=>{if(e){i.value=!0;const o=t;o.key=t.agreement_key,O(o).then(c=>{i.value=!1,p()}).catch(()=>{i.value=!1})}})},p=()=>{E.removeTab(d.path),V.push({path:"/setting/agreement"})};return(m,e)=>{const o=H,c=Z,v=z,u=G,F=W,N=J,b=K,R=Q;return h(),j("div",X,[a(c,{class:"card !border-none",shadow:"never"},{default:s(()=>[a(o,{content:n(B),icon:n(I),onBack:e[0]||(e[0]=l=>p())},null,8,["content","icon"])]),_:1}),U((h(),A(c,{class:"box-card mt-[15px] !border-none",shadow:"never"},{default:s(()=>[a(N,{model:t,"label-width":"90px",ref_key:"formRef",ref:g,rules:n(D),class:"page-form"},{default:s(()=>[a(u,{label:n(r)("type")},{default:s(()=>[a(v,{modelValue:t.agreement_key_name,"onUpdate:modelValue":e[1]||(e[1]=l=>t.agreement_key_name=l),modelModifiers:{trim:!0},readonly:"",class:"input-width"},null,8,["modelValue"])]),_:1},8,["label"]),a(u,{label:n(r)("title"),prop:"title"},{default:s(()=>[a(v,{modelValue:t.title,"onUpdate:modelValue":e[2]||(e[2]=l=>t.title=l),modelModifiers:{trim:!0},clearable:"",placeholder:n(r)("titlePlaceholder"),class:"input-width",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(u,{label:n(r)("content"),prop:"content"},{default:s(()=>[a(F,{modelValue:t.content,"onUpdate:modelValue":e[3]||(e[3]=l=>t.content=l)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1})),[[R,i.value]]),w("div",Y,[w("div",ee,[a(b,{type:"primary",onClick:e[4]||(e[4]=l=>C(g.value))},{default:s(()=>[k(x(n(r)("save")),1)]),_:1}),a(b,{onClick:e[5]||(e[5]=l=>p())},{default:s(()=>[k(x(n(r)("cancel")),1)]),_:1})])])])}}});export{Se as default};
|
||||
@ -1 +1 @@
|
||||
import{P as t}from"./index-d3b02fcc.js";function e(){return t.get("aliapp/config")}function p(a){return t.put("aliapp/config",a,{showSuccessMessage:!0})}function n(){return t.get("aliapp/static")}export{n as a,e as g,p as s};
|
||||
import{P as t}from"./index-c66fcffe.js";function e(){return t.get("aliapp/config")}function p(a){return t.put("aliapp/config",a,{showSuccessMessage:!0})}function n(){return t.get("aliapp/static")}export{n as a,e as g,p as s};
|
||||
@ -1 +1 @@
|
||||
import{d as I,f as V,j as M,r as y,n as N,Z as R,h as l,c as x,a as e,t as s,u as a,q as o,e as u,w as i,F as j,W as D,B as T,s as Z,i as $,C as k,bY as b,H as w,E as q,K as z,aZ as H,bZ as K,aa as O,a3 as P,p as U,g as W}from"./index-d3b02fcc.js";/* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as Y}from"./apply_empty-cdca3e85.js";import{a as G}from"./addon-ffae6a93.js";import{_ as J}from"./_plugin-vue_export-helper-c27b6911.js";const Q=""+new URL("app_store_default-c0531792.png",import.meta.url).href,h=_=>(U("data-v-8a156fb4"),_=_(),W(),_),X={class:"box-border pt-[68px] px-[76px] overview-top"},ee={key:0},te={class:"flex justify-between items-center"},se={class:"font-[600] text-[26px] text-[#222] leading-[37px]"},ae={class:"font-[500] text-[14px] text-[#222] leading-[20px] mt-[12px]"},oe=h(()=>e("div",{class:"mr-[9px] text-[#3F3F3F] iconfont iconxiazai01"},null,-1)),ne={class:"font-[600] text-[14px] text-[#222] leading-[20px]"},pe={class:"flex flex-wrap mt-[40px]"},ie=["onClick"],ce={class:"bg-[#F7FAFB] py-[18px] px-[24px] flex items-center app-item-head"},re=h(()=>e("div",{class:"image-slot"},[e("img",{class:"w-[40px] h-[40px] rounded-[8px]",src:Q})],-1)),le={class:"py-[18px] px-[24px]"},_e={class:"font-[600] leading-[1] text-[14px] text-[#222]"},de={class:"text-[13px] text-[#6D7278] leading-[18px] mt-[6px] truncate"},xe=h(()=>e("div",{class:"w-[230px] mx-auto"},[e("img",{src:Y,class:"max-w-full",alt:""})],-1)),ue={class:"flex items-center"},me=I({__name:"app_manage",setup(_){const v=V(),m=M(),n=y(!0),d=N({appList:[]}),f=y({});(()=>{n.value=!0,G().then(p=>{Object.values(p.data).forEach((t,c)=>{t.type=="app"&&d.appList.push(t)}),m.routers.forEach((t,c)=>{t.children&&t.children.length?(t.name=b(t.children),f.value[t.meta.app]=b(t.children)):f.value[t.meta.app]=t.name}),n.value=!1}).catch(()=>{n.value=!1})})();const L=p=>{w.set({key:"menuAppStorage",data:p.key}),w.set({key:"plugMenuTypeStorage",data:""});const t=m.appMenuList;t.push(p.key),m.setAppMenuList(t);const c=f.value[p.key];v.push({name:c})},g=()=>{v.push("/app_manage/app_store")};return(p,t)=>{const c=q,F=z,E=H,S=K,C=O,A=P;return R((l(),x("div",X,[d.appList&&!n.value?(l(),x("div",ee,[e("div",te,[e("div",null,[e("div",se,s(a(o)("app")),1),e("div",ae,s(a(o)("versionInfo"))+" "+s(a(o)("currentVersion")),1)]),u(c,{onClick:g,class:"px-[15px]"},{default:i(()=>[oe,e("span",ne,s(a(o)("appStore")),1)]),_:1})]),e("div",pe,[(l(!0),x(j,null,D(d.appList,(r,B)=>(l(),x("div",{key:B,class:"app-item w-[280px] box-border !bg-[#fff] rounded-[6px] cursor-pointer mr-[20px] mb-[20px] overflow-hidden",onClick:he=>L(r)},[e("div",ce,[u(F,{class:"w-[44px] h-[44px] rounded-[8px]",src:a(T)(r.icon),fit:"contain"},{error:i(()=>[re]),_:2},1032,["src"])]),e("div",le,[e("div",_e,s(r.title),1),u(E,{class:"box-item",effect:"light",content:r.desc,placement:"bottom-start"},{default:i(()=>[e("div",de,s(r.desc),1)]),_:2},1032,["content"])])],8,ie))),128)),!d.appList.length&&!n.value?(l(),Z(C,{key:0,class:"mx-auto overview-empty"},{image:i(()=>[xe]),description:i(()=>[e("p",ue,[e("span",null,s(a(o)("descriptionLeft")),1),u(S,{type:"primary",onClick:g,class:"mx-[5px]"},{default:i(()=>[$(s(a(o)("link")),1)]),_:1}),e("span",null,s(a(o)("descriptionRight")),1)])]),_:1})):k("",!0)])])):k("",!0)])),[[A,n.value]])}}});const Be=J(me,[["__scopeId","data-v-8a156fb4"]]);export{Be as default};
|
||||
import{d as I,f as V,j as M,r as y,n as N,Z as R,h as l,c as x,a as e,t as s,u as a,q as o,e as u,w as c,F as j,W as D,B as T,s as $,i as q,C as k,cb as b,H as w,E as z,K as H,b9 as K,cc as O,ab as P,a3 as U,p as W,g as Z}from"./index-c66fcffe.js";/* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as G}from"./apply_empty-cdca3e85.js";import{a as J}from"./addon-7b618bcb.js";import{_ as Q}from"./_plugin-vue_export-helper-c27b6911.js";const X=""+new URL("app_store_default-c0531792.png",import.meta.url).href,h=_=>(W("data-v-8a156fb4"),_=_(),Z(),_),Y={class:"box-border pt-[68px] px-[76px] overview-top"},ee={key:0},te={class:"flex justify-between items-center"},se={class:"font-[600] text-[26px] text-[#222] leading-[37px]"},ae={class:"font-[500] text-[14px] text-[#222] leading-[20px] mt-[12px]"},oe=h(()=>e("div",{class:"mr-[9px] text-[#3F3F3F] iconfont iconxiazai01"},null,-1)),ne={class:"font-[600] text-[14px] text-[#222] leading-[20px]"},pe={class:"flex flex-wrap mt-[40px]"},ce=["onClick"],ie={class:"bg-[#F7FAFB] py-[18px] px-[24px] flex items-center app-item-head"},re=h(()=>e("div",{class:"image-slot"},[e("img",{class:"w-[40px] h-[40px] rounded-[8px]",src:X})],-1)),le={class:"py-[18px] px-[24px]"},_e={class:"font-[600] leading-[1] text-[14px] text-[#222]"},de={class:"text-[13px] text-[#6D7278] leading-[18px] mt-[6px] truncate"},xe=h(()=>e("div",{class:"w-[230px] mx-auto"},[e("img",{src:G,class:"max-w-full",alt:""})],-1)),ue={class:"flex items-center"},me=I({__name:"app_manage",setup(_){const v=V(),m=M(),n=y(!0),d=N({appList:[]}),f=y({});(()=>{n.value=!0,J().then(p=>{Object.values(p.data).forEach((t,i)=>{t.type=="app"&&d.appList.push(t)}),m.routers.forEach((t,i)=>{t.children&&t.children.length?(t.name=b(t.children),f.value[t.meta.app]=b(t.children)):f.value[t.meta.app]=t.name}),n.value=!1}).catch(()=>{n.value=!1})})();const L=p=>{w.set({key:"menuAppStorage",data:p.key}),w.set({key:"plugMenuTypeStorage",data:""});const t=m.appMenuList;t.push(p.key),m.setAppMenuList(t);const i=f.value[p.key];v.push({name:i})},g=()=>{v.push("/app_manage/app_store")};return(p,t)=>{const i=z,F=H,E=K,S=O,C=P,A=U;return R((l(),x("div",Y,[d.appList&&!n.value?(l(),x("div",ee,[e("div",te,[e("div",null,[e("div",se,s(a(o)("app")),1),e("div",ae,s(a(o)("versionInfo"))+" "+s(a(o)("currentVersion")),1)]),u(i,{onClick:g,class:"px-[15px]"},{default:c(()=>[oe,e("span",ne,s(a(o)("appStore")),1)]),_:1})]),e("div",pe,[(l(!0),x(j,null,D(d.appList,(r,B)=>(l(),x("div",{key:B,class:"app-item w-[280px] box-border !bg-[#fff] rounded-[6px] cursor-pointer mr-[20px] mb-[20px] overflow-hidden",onClick:he=>L(r)},[e("div",ie,[u(F,{class:"w-[44px] h-[44px] rounded-[8px]",src:a(T)(r.icon),fit:"contain"},{error:c(()=>[re]),_:2},1032,["src"])]),e("div",le,[e("div",_e,s(r.title),1),u(E,{class:"box-item",effect:"light",content:r.desc,placement:"bottom-start"},{default:c(()=>[e("div",de,s(r.desc),1)]),_:2},1032,["content"])])],8,ce))),128)),!d.appList.length&&!n.value?(l(),$(C,{key:0,class:"mx-auto overview-empty"},{image:c(()=>[xe]),description:c(()=>[e("p",ue,[e("span",null,s(a(o)("descriptionLeft")),1),u(S,{type:"primary",onClick:g,class:"mx-[5px]"},{default:c(()=>[q(s(a(o)("link")),1)]),_:1}),e("span",null,s(a(o)("descriptionRight")),1)])]),_:1})):k("",!0)])])):k("",!0)])),[[A,n.value]])}}});const Be=Q(me,[["__scopeId","data-v-8a156fb4"]]);export{Be as default};
|
||||
@ -1 +1 @@
|
||||
.group-list .group-item[data-v-30261b0b]{height:32px;margin-top:3px}.group-list .group-item .operate[data-v-30261b0b]{display:none}.group-list .group-item.active[data-v-30261b0b]{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.group-list .group-item[data-v-30261b0b]:hover{background-color:var(--el-color-primary-light-9)}.group-list .group-item:hover .operate[data-v-30261b0b],.attachment-item:hover .attachment-action[data-v-30261b0b]{display:block}.attachment-list-wrap .attachment-wrap[data-v-30261b0b]{background:var(--el-border-color-extra-light)}.file-box-active[data-v-30261b0b]:after{content:"";display:block;position:absolute;border:15px solid transparent;border-right-color:var(--el-color-primary);border-bottom-color:var(--el-color-primary);bottom:0;right:0}.file-box-active span[data-v-30261b0b]{font-style:normal}.video-preview{background:none!important;box-shadow:none!important}.video-preview .el-dialog__headerbtn .el-dialog__close{border-radius:50%;width:34px;height:34px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-upload-list{position:absolute!important;z-index:10}.el-upload-list .el-upload-list__item{background:#fff!important;box-shadow:var(--el-box-shadow-light)}.attachment-wrap .el-upload-list__item .el-upload-list__item-info{width:150px!important}
|
||||
.group-list .group-item[data-v-bc550d06]{height:32px;margin-top:3px}.group-list .group-item .operate[data-v-bc550d06]{display:none}.group-list .group-item.active[data-v-bc550d06]{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.group-list .group-item[data-v-bc550d06]:hover{background-color:var(--el-color-primary-light-9)}.group-list .group-item:hover .operate[data-v-bc550d06],.attachment-item:hover .attachment-action[data-v-bc550d06]{display:block}.attachment-list-wrap .attachment-wrap[data-v-bc550d06]{background:var(--el-border-color-extra-light)}.file-box-active[data-v-bc550d06]:after{content:"";display:block;position:absolute;border:15px solid transparent;border-right-color:var(--el-color-primary);border-bottom-color:var(--el-color-primary);bottom:0;right:0}.file-box-active span[data-v-bc550d06]{font-style:normal}.video-preview{background:none!important;box-shadow:none!important}.video-preview .el-dialog__headerbtn .el-dialog__close{border-radius:50%;width:34px;height:34px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-upload-list{position:absolute!important;z-index:10}.el-upload-list .el-upload-list__item{background:#fff!important;box-shadow:var(--el-box-shadow-light)}.attachment-wrap .el-upload-list__item .el-upload-list__item-info{width:150px!important}
|
||||
@ -1 +1 @@
|
||||
import{d as f,y as h,r as y,h as m,c as s,e,w as o,a as i,t as b,u as p,F as v,W as x,q as g,ap as V,aq as w,a9 as E}from"./index-d3b02fcc.js";/* empty css *//* empty css */import k from"./attachment-038885aa.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-112a845c.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-2d1a05f1.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-ad49599f.js";import"./_plugin-vue_export-helper-c27b6911.js";const B={class:"main-container attachment-container"},C={class:"flex justify-between items-center mb-[20px]"},N={class:"text-page-title"},it=f({__name:"attachment",setup(T){const l=h().meta.title,a=["image","video","icon"],n=y(a[0]);return(F,r)=>{const c=V,_=w,d=E;return m(),s("div",B,[e(d,{class:"box-card !border-none full-container",shadow:"never"},{default:o(()=>[i("div",C,[i("span",N,b(p(l)),1)]),e(_,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=t=>n.value=t),"tab-position":"top"},{default:o(()=>[(m(),s(v,null,x(a,(t,u)=>e(c,{label:p(g)(t),name:t,key:u},{default:o(()=>[e(k,{scene:"attachment",type:t},null,8,["type"])]),_:2},1032,["label","name"])),64))]),_:1},8,["modelValue"])]),_:1})])}}});export{it as default};
|
||||
import{d as f,y as h,r as y,h as m,c as s,e,w as o,a as i,t as b,u as p,F as v,W as x,q as g,au as V,av as w,a9 as E}from"./index-c66fcffe.js";/* empty css *//* empty css */import k from"./attachment-a43e49d9.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-01f18274.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-e310b195.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-4c45033b.js";import"./_plugin-vue_export-helper-c27b6911.js";const B={class:"main-container attachment-container"},C={class:"flex justify-between items-center mb-[20px]"},N={class:"text-page-title"},it=f({__name:"attachment",setup(T){const l=h().meta.title,a=["image","video","icon"],n=y(a[0]);return(j,r)=>{const c=V,_=w,u=E;return m(),s("div",B,[e(u,{class:"box-card !border-none full-container",shadow:"never"},{default:o(()=>[i("div",C,[i("span",N,b(p(l)),1)]),e(_,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=t=>n.value=t),"tab-position":"top"},{default:o(()=>[(m(),s(v,null,x(a,(t,d)=>e(c,{label:p(g)(t),name:t,key:d},{default:o(()=>[e(k,{scene:"attachment",type:t},null,8,["type"])]),_:2},1032,["label","name"])),64))]),_:1},8,["modelValue"])]),_:1})])}}});export{it as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{d as b,r as d,n as w,I as m,l as g,R as c,h as E,s as F,w as i,e as n,a,Z as N,i as R,_ as j,aM as B,L as C,M as I,N as M}from"./index-d3b02fcc.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */const O={class:"flex items-center"},k=a("span",{class:"ml-[10px] el-form-item__label"},"消费折扣",-1),D={class:"w-[120px]"},U=a("div",{class:"text-sm text-gray-400 mb-[5px]"},"会员购买产品默认折扣,需要商品设置参与会员折扣有效",-1),A=b({__name:"benefits-discount",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(p,{expose:_,emit:f}){const v=p,e=d({is_use:0,discount:""}),r=d(null),x=w({discount:[{validator:(l,t,s)=>{e.value.is_use&&(m.empty(e.value.discount)&&s("请输入折扣"),m.decimal(e.value.discount,1)||s("折扣格式错误"),(parseFloat(e.value.discount)<0||parseFloat(e.value.discount)>9.9)&&s("折扣只能输入0~9.9之间的值"),e.value.discount<0&&s("折扣不能小于0")),s()}}]}),o=g({get(){return v.modelValue},set(l){f("update:modelValue",l)}});return c(()=>o.value,(l,t)=>{(!t||!Object.keys(t).length)&&Object.keys(l).length&&(e.value=o.value)},{immediate:!0}),c(()=>e.value,()=>{o.value=e.value},{deep:!0}),_({verify:async()=>{var t;let l=!0;return await((t=r.value)==null?void 0:t.validate(s=>{l=s})),l}}),(l,t)=>{const s=B,V=C,h=I,y=M;return E(),F(y,{ref_key:"formRef",ref:r,model:e.value,rules:x},{default:i(()=>[n(h,{label:"",prop:"discount",class:"!mb-[10px]"},{default:i(()=>[a("div",null,[a("div",O,[n(s,{modelValue:e.value.is_use,"onUpdate:modelValue":t[0]||(t[0]=u=>e.value.is_use=u),"true-label":1,"false-label":0,label:"",size:"large"},null,8,["modelValue"]),k,N(a("div",D,[n(V,{modelValue:e.value.discount,"onUpdate:modelValue":t[1]||(t[1]=u=>e.value.discount=u),modelModifiers:{trim:!0},clearable:""},{append:i(()=>[R("折")]),_:1},8,["modelValue"])],512),[[j,e.value.is_use]])]),U])]),_:1})]),_:1},8,["model","rules"])}}});export{A as default};
|
||||
import{d as b,r as d,n as w,I as m,l as g,R as c,h as E,s as F,w as i,e as n,a,Z as N,i as R,_ as j,aY as B,L as C,M as I,N as O}from"./index-c66fcffe.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */const k={class:"flex items-center"},D=a("span",{class:"ml-[10px] el-form-item__label"},"消费折扣",-1),M={class:"w-[120px]"},U=a("div",{class:"text-sm text-gray-400 mb-[5px]"},"会员购买产品默认折扣,需要商品设置参与会员折扣有效",-1),q=b({__name:"benefits-discount",props:{modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(p,{expose:_,emit:f}){const v=p,e=d({is_use:0,discount:""}),r=d(null),x=w({discount:[{validator:(l,t,s)=>{e.value.is_use&&(m.empty(e.value.discount)&&s("请输入折扣"),m.decimal(e.value.discount,1)||s("折扣格式错误"),(parseFloat(e.value.discount)<0||parseFloat(e.value.discount)>9.9)&&s("折扣只能输入0~9.9之间的值"),e.value.discount<0&&s("折扣不能小于0")),s()}}]}),o=g({get(){return v.modelValue},set(l){f("update:modelValue",l)}});return c(()=>o.value,(l,t)=>{(!t||!Object.keys(t).length)&&Object.keys(l).length&&(e.value=o.value)},{immediate:!0}),c(()=>e.value,()=>{o.value=e.value},{deep:!0}),_({verify:async()=>{var t;let l=!0;return await((t=r.value)==null?void 0:t.validate(s=>{l=s})),l}}),(l,t)=>{const s=B,V=C,h=I,y=O;return E(),F(y,{ref_key:"formRef",ref:r,model:e.value,rules:x},{default:i(()=>[n(h,{label:"",prop:"discount",class:"!mb-[10px]"},{default:i(()=>[a("div",null,[a("div",k,[n(s,{modelValue:e.value.is_use,"onUpdate:modelValue":t[0]||(t[0]=u=>e.value.is_use=u),"true-label":1,"false-label":0,label:"",size:"large"},null,8,["modelValue"]),D,N(a("div",M,[n(V,{modelValue:e.value.discount,"onUpdate:modelValue":t[1]||(t[1]=u=>e.value.discount=u),modelModifiers:{trim:!0},clearable:""},{append:i(()=>[R("折")]),_:1},8,["modelValue"])],512),[[j,e.value.is_use]])]),U])]),_:1})]),_:1},8,["model","rules"])}}});export{q as default};
|
||||
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