提交 4220eace 编写于 作者: D Devil

细节优化

上级 fbaed9b8
......@@ -69,7 +69,7 @@ class Order extends Common
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
'order_by' => $this->form_order_by['data'],
'is_public' => 0,
'user_type' => 'admin',
];
......
......@@ -86,7 +86,6 @@ class Plugins extends Common
$pluginsname = $params['data_request']['pluginsname'];
$pluginscontrol = strtolower($params['data_request']['pluginscontrol']);
$pluginsaction = strtolower($params['data_request']['pluginsaction']);
unset($params['data_request']['pluginsname'], $params['data_request']['pluginscontrol'], $params['data_request']['pluginsaction']);
// 视图初始化
$this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction);
......
......@@ -469,7 +469,7 @@
<!-- 相册 -->
<div id="goods-nav-photo" class="division-block">
<label class="block nav-detail-title">商品相册<span class="am-form-group-label-tips">可拖拽图片进行排序,建议图片尺寸一致</span></label>
<label class="block nav-detail-title">商品相册<span class="am-form-group-label-tips">可拖拽图片进行排序,建议图片尺寸一致、最多30张</span></label>
<ul class="plug-file-upload-view goods-photo-view" data-form-name="photo[]" data-max-number="30" data-dialog-type="images">
{{if !empty($data['photo'])}}
{{foreach $data.photo as $v}}
......
......@@ -111,9 +111,10 @@ class Order extends Common
// 获取列表
$data_params = array(
'm' => 0,
'n' => 1,
'where' => $where,
'm' => 0,
'n' => 1,
'where' => $where,
'is_orderaftersale' => 1,
);
$data = OrderService::OrderList($data_params);
if(!empty($data['data'][0]))
......
......@@ -67,14 +67,13 @@ class Plugins extends Common
}
// 控制器/方法默认值
$pluginscontrol = empty($params['data_request']['pluginscontrol']) ? 'index' : $params['data_request']['pluginscontrol'];
$pluginsaction = empty($params['data_request']['pluginsaction']) ? 'index' : $params['data_request']['pluginsaction'];
$params['data_request']['pluginscontrol'] = empty($params['data_request']['pluginscontrol']) ? 'index' : $params['data_request']['pluginscontrol'];
$params['data_request']['pluginsaction'] = empty($params['data_request']['pluginsaction']) ? 'index' : $params['data_request']['pluginsaction'];
// 应用名称/控制器/方法
$pluginsname = $params['data_request']['pluginsname'];
$pluginscontrol = strtolower($pluginscontrol);
$pluginsaction = strtolower($pluginsaction);
unset($params['data_request']['pluginsname'], $params['data_request']['pluginscontrol'], $params['data_request']['pluginsaction']);
$pluginscontrol = strtolower($params['data_request']['pluginscontrol']);
$pluginsaction = strtolower($params['data_request']['pluginsaction']);
// 视图初始化
$this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction);
......
......@@ -53,7 +53,7 @@ class User extends Common
private function GetrefererUrl()
{
// 上一个页面, 空则用户中心
$referer_url = empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/user/index') : $_SERVER['HTTP_REFERER'];
$referer_url = empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/user/index') : htmlentities($_SERVER['HTTP_REFERER']);
if(!empty($_SERVER['HTTP_REFERER']))
{
$all = ['login', 'regster', 'forget', 'logininfo', 'reginfo', 'smsreginfo', 'emailreginfo', 'forgetpwdinfo'];
......
<!-- content top start -->
<div class="content-top">
{{block name="form_content_top"}}{{/block}}
</div>
<!-- content top end -->
<div class="form-table-content">
<!-- form -->
{{if !empty($form_table) and !empty($form_table['base']) and !empty($form_table['form']) and is_array($form_table['base']) and is_array($form_table['form'])}}
......
......@@ -34,6 +34,12 @@
}
{{/php}}
<!-- content top start -->
<div class="content-top">
{{block name="form_content_top"}}{{/block}}
</div>
<!-- content top end -->
<!-- content start -->
<div class="form-table-content">
<!-- content inside top hook -->
......
......@@ -42,6 +42,12 @@
}
{{/php}}
<!-- content top start -->
<div class="content-top">
{{block name="form_content_top"}}{{/block}}
</div>
<!-- content top end -->
<!-- content start -->
<div class="form-table-content">
<!-- content inside top hook -->
......
......@@ -181,7 +181,7 @@ class AppHomeNavService
{
return DataReturn('编辑成功', 0);
}
return DataReturn('编辑失败', -100);
return DataReturn('编辑失败', -100);
}
}
......
......@@ -53,6 +53,8 @@ class BaseService
'home_navigation_main_quick_status' => (int) MyC('home_navigation_main_quick_status', 0),
'home_user_address_map_status' => (int) MyC('home_user_address_map_status', 0),
'home_user_address_idcard_status' => (int) MyC('home_user_address_idcard_status', 0),
'common_order_close_limit_time' => (int) MyC('common_order_close_limit_time', 30, true),
'common_order_success_limit_time' => (int) MyC('common_order_success_limit_time', 21600, true),
// 订单相关
'home_is_enable_order_bulk_pay' => (int) MyC('home_is_enable_order_bulk_pay', 0),
......
......@@ -313,6 +313,7 @@ class IntegralService
self::UserIntegralLogAdd($user['id'], $user['integral'], $give_integral, '订单商品发生售后收回', 0);
}
}
return DataReturn('操作成功', 0);
}
/**
......
......@@ -1007,8 +1007,8 @@ class OrderService
* @version 1.0.0
* @date 2020-07-05
* @desc description
* @param [array] $data [订单数据]
* @param [array] $params [输入参数]
* @param [array] $data [订单数据]
* @param [array] $params [输入参数]
*/
public static function OrderDataHandle($data, $params = [])
{
......
......@@ -23,7 +23,7 @@ use think\facade\Hook;
class ResourcesService
{
/**
* [ContentStaticReplace 编辑器中内容的静态资源替换]
* 编辑器中内容的静态资源替换
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
......
......@@ -593,6 +593,18 @@ class UserService
*/
public static function Login($params = [])
{
// 用户登录前校验钩子
$hook_name = 'plugins_service_user_login_begin_check';
$ret = HookReturnHandle(Hook::listen($hook_name, [
'hook_name' => $hook_name,
'is_backend' => true,
'params' => &$params,
]));
if(isset($ret['code']) && $ret['code'] != 0)
{
return $ret;
}
// 是否开启用户登录
if(MyC('home_user_login_state') != 1)
{
......@@ -760,6 +772,18 @@ class UserService
return DataReturn($ret, -1);
}
// 用户注册前校验钩子
$hook_name = 'plugins_service_user_register_begin_check';
$ret = HookReturnHandle(Hook::listen($hook_name, [
'hook_name' => $hook_name,
'is_backend' => true,
'params' => &$params,
]));
if(isset($ret['code']) && $ret['code'] != 0)
{
return $ret;
}
// 是否开启用户注册
if(!in_array($params['type'], MyC('home_user_reg_state')))
{
......@@ -1683,6 +1707,18 @@ class UserService
return DataReturn($ret, -1);
}
// 用户注册前校验钩子
$hook_name = 'plugins_service_user_app_register_begin_check';
$ret = HookReturnHandle(Hook::listen($hook_name, [
'hook_name' => $hook_name,
'is_backend' => true,
'params' => &$params,
]));
if(isset($ret['code']) && $ret['code'] != 0)
{
return $ret;
}
// 手机号码格式
if(!CheckMobile($params['mobile']))
{
......
......@@ -132,6 +132,7 @@ return array (
0 => 'app\\plugins\\membershiplevelvip\\Hook',
1 => 'app\\plugins\\coupon\\Hook',
2 => 'app\\plugins\\distribution\\Hook',
3 => 'app\\plugins\\invoice\\Hook',
),
'plugins_service_header_navigation_top_right_handle' =>
array (
......@@ -139,6 +140,7 @@ return array (
1 => 'app\\plugins\\multilingual\\Hook',
2 => 'app\\plugins\\coupon\\Hook',
3 => 'app\\plugins\\distribution\\Hook',
4 => 'app\\plugins\\invoice\\Hook',
),
'plugins_common_page_bottom' =>
array (
......@@ -147,10 +149,12 @@ return array (
'plugins_service_quick_navigation_pc' =>
array (
0 => 'app\\plugins\\multilingual\\Hook',
1 => 'app\\plugins\\invoice\\Hook',
),
'plugins_service_quick_navigation_h5' =>
array (
0 => 'app\\plugins\\multilingual\\Hook',
1 => 'app\\plugins\\invoice\\Hook',
),
'plugins_view_common_top' =>
array (
......@@ -197,5 +201,25 @@ return array (
array (
0 => 'app\\plugins\\goodsalledit\\Hook',
),
'plugins_service_quick_navigation_weixin' =>
array (
0 => 'app\\plugins\\invoice\\Hook',
),
'plugins_service_quick_navigation_alipay' =>
array (
0 => 'app\\plugins\\invoice\\Hook',
),
'plugins_service_quick_navigation_baidu' =>
array (
0 => 'app\\plugins\\invoice\\Hook',
),
'plugins_service_quick_navigation_qq' =>
array (
0 => 'app\\plugins\\invoice\\Hook',
),
'plugins_service_quick_navigation_toutiao' =>
array (
0 => 'app\\plugins\\invoice\\Hook',
),
);
?>
\ No newline at end of file
......@@ -229,27 +229,52 @@ class Uploader
}
// 存储图片、使用GD存储图片、防止图片包含木马
// 如未安装相应的gd库则直接存储文件
$is_move = false;
switch($this->fileType)
{
case '.png':
$image = imagecreatefrompng($file["tmp_name"]); //PNG
imagesavealpha($image, true); //这里很重要 意思是不要丢了$sourePic图像的透明色;
$width = imagesx($image); //图宽度
$heigh = imagesy($image); //图高度
$thumb = imagecreatetruecolor($width, $heigh);
imagealphablending($thumb, false); //这里很重要,意思是不合并颜色,直接用$img图像颜色替换,包括透明色;
imagesavealpha($thumb, true); //这里很重要,意思是不要丢了$thumb图像的透明色;
if(imagecopyresampled($thumb, $image, 0, 0, 0, 0, $width, $heigh, $width, $heigh))
if(function_exists('imagecreatefrompng'))
{
imagepng($thumb, $this->filePath);
$image = imagecreatefrompng($file["tmp_name"]); //PNG
imagesavealpha($image, true); //这里很重要 意思是不要丢了$sourePic图像的透明色;
$width = imagesx($image); //图宽度
$heigh = imagesy($image); //图高度
$thumb = imagecreatetruecolor($width, $heigh);
imagealphablending($thumb, false); //这里很重要,意思是不合并颜色,直接用$img图像颜色替换,包括透明色;
imagesavealpha($thumb, true); //这里很重要,意思是不要丢了$thumb图像的透明色;
if(imagecopyresampled($thumb, $image, 0, 0, 0, 0, $width, $heigh, $width, $heigh))
{
imagepng($thumb, $this->filePath);
}
} else {
$is_move = true;
}
break;
case '.gif':
@imagegif(@imagecreatefromgif($file["tmp_name"]), $this->filePath);
if(function_exists('imagecreatefromgif'))
{
@imagegif(@imagecreatefromgif($file["tmp_name"]), $this->filePath);
} else {
$is_move = true;
}
break;
default:
@imagejpeg(@imagecreatefromjpeg($file["tmp_name"]), $this->filePath, 100);
if(function_exists('imagecreatefromjpeg'))
{
@imagejpeg(@imagecreatefromjpeg($file["tmp_name"]), $this->filePath, 100);
} else {
$is_move = true;
}
}
// 是否需要直接存储文件
if($is_move && !move_uploaded_file($file["tmp_name"], $this->filePath))
{
$this->stateInfo = $this->getStateInfo("ERROR_FILE_MOVE");
}
// 图片是否存储成功
if(!file_exists($this->filePath))
{
$this->stateInfo = $this->getStateInfo("ERROR_IMAGE_SAVE");
......
......@@ -414,7 +414,7 @@ class QQ
'mch_id' => $this->config['mch_id'],
'nonce_str' => md5(time().rand().$params['order_no']),
'transaction_id' => $params['trade_no'],
'out_refund_no' => $params['order_no'].GetNumberCode(6),
'out_refund_no' => $params['order_no'],
'refund_fee' => (int) (($params['refund_price']*1000)/10),
'op_user_id' => $this->config['op_user_id'],
'op_user_passwd' => md5($this->config['op_user_passwd']),
......
......@@ -540,7 +540,7 @@ class Weixin
'nonce_str' => md5(time().rand().$params['order_no']),
'sign_type' => 'MD5',
'transaction_id' => $params['trade_no'],
'out_refund_no' => $params['order_no'].GetNumberCode(6),
'out_refund_no' => $params['order_no'],
'total_fee' => (int) (($params['pay_price']*1000)/10),
'refund_fee' => (int) (($params['refund_price']*1000)/10),
'refund_desc' => $refund_reason,
......
......@@ -277,6 +277,11 @@ ul.plug-file-upload-view-video li {
width: 300px;
height: 200px;
}
ul.plug-file-upload-view-file li {
width: auto;
height: auto;
padding-right: 28px;
}
......
......@@ -422,6 +422,16 @@ function FromInit(form_name)
return false;
break;
// 调用自定义回调方法
case 'ajax-fun' :
if(!IsExitsFunction(request_value))
{
$button.button('reset');
Prompt('['+request_value+']表单定义的方法未定义');
return false;
}
break;
}
// 请求 url http类型
......@@ -2536,7 +2546,6 @@ $(function()
break;
}
var $tag = $($('body').attr('view-tag'));
var html = '<li>';
html += '<input type="text" name="'+form_name+'" value="'+result[i].src+'" />';
html += '<video src="'+result[i].src+'" controls>your browser does not support the video tag</video>';
......@@ -2553,12 +2562,6 @@ $(function()
// 文件上传
upload_editor.addListener("beforeInsertFile", function(t, result)
{
var fileHtml = '';
for(var i in result){
fileHtml += '<li><a href="'+result[i].url+'" target="_blank">'+result[i].url+'</a></li>';
}
document.getElementById('upload_video_wrap').innerHTML = fileHtml;
if(result.length > 0)
{
var $tag = $($('body').attr('view-tag'));
......@@ -2579,8 +2582,8 @@ $(function()
// 是否直接赋值属性
if(i == 0 && is_attr != null)
{
$('form [name="'+form_name+'"]').val(result[i].src);
$tag.attr(is_attr, result[i].src);
$('form [name="'+form_name+'"]').val(result[i].url);
$tag.attr(is_attr, result[i].url);
break;
}
......@@ -2591,10 +2594,11 @@ $(function()
break;
}
var $tag = $($('body').attr('view-tag'));
var index = parseInt($tag.find('li').length) || 0;
var html = '<li>';
html += '<input type="text" name="'+form_name+'" value="'+result[i].src+'" />';
html += '<a href="'+result[i].src+'">'+result[i].src+'</a>';
html += '<input type="text" name="'+form_name+'['+index+'][title]" value="'+result[i].title+'" />';
html += '<input type="text" name="'+form_name+'['+index+'][url]" value="'+result[i].url+'" />';
html += '<a href="'+result[i].url+'" title="'+result[i].title+'" target="_blank">'+result[i].title+'</a>';
if(is_delete == 1)
{
html += '<i>×</i>';
......
......@@ -74,7 +74,7 @@ App({
// 请求地址
request_url: "{{request_url}}",
request_url: 'http://shopxo.com/',
request_url: 'https://dev.shopxo.net/',
request_url: 'https://demo.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册