细节优化
parent
dd67de65b1
commit
7229f836b7
|
|
@ -218,7 +218,7 @@ class Common extends Controller
|
|||
|
||||
// 分页信息
|
||||
$this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1);
|
||||
$this->page_size = MyC('admin_page_number', 10, true);
|
||||
$this->page_size = MyC('common_page_size', 10, true);
|
||||
$this->assign('page', $this->page);
|
||||
$this->assign('page_size', $this->page_size);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,9 @@ class Config extends Common
|
|||
*/
|
||||
public function Index()
|
||||
{
|
||||
// csv
|
||||
// 静态数据
|
||||
$this->assign('common_excel_charset_list', lang('common_excel_charset_list'));
|
||||
$this->assign('common_is_enable_list', lang('common_is_enable_list'));
|
||||
|
||||
// 配置信息
|
||||
$this->assign('data', ConfigService::ConfigList());
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="am-margin-top-lg admin-login">
|
||||
<div class="am-padding-sm">
|
||||
<form class="am-form form-validation" action="{{:MyUrl('admin/admin/login')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/index/index')}}">
|
||||
<div class="am-g">
|
||||
<div class="am-g am-padding-top-sm">
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="text" placeholder="用户名" name="username" pattern="{{:lang('common_regex_username')}}" data-validation-message="用户名格式 5~18 个字符(可以是字母数字下划线)" class="am-radius" required />
|
||||
</div>
|
||||
|
|
@ -32,11 +32,15 @@
|
|||
<!-- content end -->
|
||||
|
||||
<!-- 随机背景图片 -->
|
||||
<div class="bg-slides">
|
||||
{{for start="1" end="11"}}
|
||||
<div class="bg-slides-item" style="background-image:url('{{$attachment_host}}/static/admin/default/images/login/{{$i}}.jpg');{{if $i neq 1}}display:none;{{/if}}"></div>
|
||||
{{/for}}
|
||||
</div>
|
||||
{{if MyC('admin_login_info_bg_images_rand') eq 1}}
|
||||
<div class="bg-slides">
|
||||
{{for start="1" end="11"}}
|
||||
{{if file_exists(ROOT.'public/static/admin/default/images/login/'.$i.'.jpg')}}
|
||||
<div class="bg-slides-item" style="background-image:url('{{$attachment_host}}/static/admin/default/images/login/{{$i}}.jpg');{{if $i neq 1}}display:none;{{/if}}"></div>
|
||||
{{/if}}
|
||||
{{/for}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 插件扩展数据 start -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,22 @@
|
|||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.admin_page_number.name}}<span class="am-form-group-label-tips">{{$data.admin_page_number.describe}}</span></label>
|
||||
<input type="number" name="{{$data.admin_page_number.only_tag}}" placeholder="{{$data.admin_page_number.name}}" pattern="{{:lang('common_regex_page_number')}}" data-validation-message="{{$data.admin_page_number.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.admin_page_number.value}}"{{/if}} required />
|
||||
<label>{{$data.admin_login_info_bg_images_rand.name}}</label>
|
||||
<select name="{{$data.admin_login_info_bg_images_rand.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.admin_login_info_bg_images_rand.error_tips}}" required>
|
||||
{{foreach $common_is_enable_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['admin_login_info_bg_images_rand']['value']) and $data['admin_login_info_bg_images_rand']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
<div class="am-alert am-alert-warning" data-am-alert>
|
||||
<p>背景图片位置[ public/static/admin/default/images/login ]目录下</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_page_size.name}}<span class="am-form-group-label-tips">{{$data.common_page_size.describe}}</span></label>
|
||||
<input type="number" name="{{$data.common_page_size.only_tag}}" placeholder="{{$data.common_page_size.name}}" pattern="{{:lang('common_regex_page_number')}}" data-validation-message="{{$data.common_page_size.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_page_size.value}}"{{/if}} required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_spec_add_max_number.name}}<span class="am-form-group-label-tips">{{$data.common_spec_add_max_number.describe}}</span></label>
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@
|
|||
<span class="business-operations-submit quick-spec-title-add">+快捷操作</span>
|
||||
<span class="business-operations-submit am-margin-left-sm am-icon-gg quick-spec-created">生成规格</span>
|
||||
<div class="goods-specifications business-form-group" {{if empty($data['spec_base'])}}style="display: none;"{{/if}}>
|
||||
<table class="am-table am-table-bordered am-table-centered">
|
||||
<table class="am-table am-table-bordered am-table-centered am-table-striped am-table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="spec-quick-th-title">规格名</th>
|
||||
|
|
@ -282,7 +282,7 @@
|
|||
</div>
|
||||
|
||||
<!-- 规格列表 -->
|
||||
<table class="am-table am-table-bordered am-table-centered specifications-table am-margin-bottom-sm">
|
||||
<table class="am-table am-table-bordered am-table-centered specifications-table am-margin-bottom-sm am-table-striped am-table-hover">
|
||||
<thead class="title-nav">
|
||||
<tr>
|
||||
{{if !empty($specifications['type'])}}
|
||||
|
|
|
|||
|
|
@ -22,15 +22,16 @@
|
|||
<!-- win form start -->
|
||||
<form class="am-form form-validation" action="{{:MyUrl('admin/payment/upload')}}" method="POST" request-type="ajax-reload" enctype="multipart/form-data">
|
||||
<div class="am-alert am-radius am-alert-tips m-t-0" data-am-alert>
|
||||
<p class="am-margin-top-sm">
|
||||
1 类名必须于文件名一致(去除 .php ),如 Alipay.php 则取 Alipay<br />
|
||||
2 类必须定义三个方法<br />
|
||||
2.1 Config 配置方法<br />
|
||||
2.2 Pay 支付方法<br />
|
||||
2.3 Respond 回调方法<br />
|
||||
2.4 Refund 退款方法(可选)
|
||||
</p>
|
||||
<p class="cr-red">PS:以上条件不满足则无法查看插件,将插件放入.zip压缩包中、支持一个压缩中包含多个支付插件</p>
|
||||
<p>1 类名必须于文件名一致(去除 .php ),如 Alipay.php 则取 Alipay</p>
|
||||
<p>2 类必须定义的方法</p>
|
||||
<p class="am-margin-left-lg">2.1 Config 配置方法</p>
|
||||
<p class="am-margin-left-lg">2.2 Pay 支付方法</p>
|
||||
<p class="am-margin-left-lg">2.3 Respond 回调方法</p>
|
||||
<p class="am-margin-left-lg">2.4 Refund 退款方法(可选)</p>
|
||||
<p>3 可自定义输出内容方法</p>
|
||||
<p class="am-margin-left-lg">3.1 SuccessReturn 支付成功(可选)</p>
|
||||
<p class="am-margin-left-lg">3.2 ErrorReturn 支付失败(可选)</p>
|
||||
<p class="am-margin-top-xs cr-red">PS:以上条件不满足则无法查看插件,将插件放入.zip压缩包中上传、支持一个压缩中包含多个支付插件</p>
|
||||
</div>
|
||||
<div class="am-form-group am-form-file">
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius"><i class="am-icon-cloud-upload"></i> 选择文件</button>
|
||||
|
|
|
|||
|
|
@ -61,18 +61,11 @@ class OrderNotify extends Common
|
|||
*/
|
||||
private function SuccessReturn()
|
||||
{
|
||||
// 根据支付方式处理成功返回结果
|
||||
$content = 'success';
|
||||
switch(PAYMENT_TYPE)
|
||||
{
|
||||
// 百度
|
||||
case 'BaiduMini' :
|
||||
$content = '{"errno":0,"msg":"success","data":{"isConsumed":2}}';
|
||||
break;
|
||||
}
|
||||
// 支付插件是否自定义返回内容
|
||||
$this->ContentReturn('SuccessReturn');
|
||||
|
||||
// 默认success
|
||||
exit($content);
|
||||
// 结束输出
|
||||
die('success');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -85,18 +78,33 @@ class OrderNotify extends Common
|
|||
*/
|
||||
private function ErrorReturn()
|
||||
{
|
||||
// 根据支付方式处理异步返回结果
|
||||
$content = 'error';
|
||||
switch(PAYMENT_TYPE)
|
||||
{
|
||||
// 百度,当处理失败也处理成功消费,需管理员手工处理订单状态或者走其它方式进行处理退款操作
|
||||
case 'BaiduMini' :
|
||||
$content = '{"errno":0,"msg":"success","data":{"isConsumed":2}}';
|
||||
break;
|
||||
}
|
||||
// 支付插件是否自定义返回内容
|
||||
$this->ContentReturn('ErrorReturn');
|
||||
|
||||
// 默认error
|
||||
exit($content);
|
||||
// 结束输出
|
||||
die('error');
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出支付插件自定义内容
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-01
|
||||
* @desc description
|
||||
* @param [string] $action [操作方法]
|
||||
*/
|
||||
private function ContentReturn($action)
|
||||
{
|
||||
$payment = 'payment\\'.PAYMENT_TYPE;
|
||||
if(class_exists($payment))
|
||||
{
|
||||
$payment_obj = new $payment();
|
||||
if(method_exists($payment_obj, $action))
|
||||
{
|
||||
die($payment_obj->$action());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -297,7 +297,7 @@ class Common extends Controller
|
|||
|
||||
// 分页信息
|
||||
$this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1);
|
||||
$this->page_size = MyC('admin_page_number', 10, true);
|
||||
$this->page_size = MyC('common_page_size', 10, true);
|
||||
$this->assign('page', $this->page);
|
||||
$this->assign('page_size', $this->page_size);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use app\service\SeoService;
|
|||
use app\service\MessageService;
|
||||
use app\service\NavigationService;
|
||||
use app\service\GoodsBrowseService;
|
||||
use app\service\GoodsFavorService;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
|
|
@ -114,15 +115,15 @@ class User extends Common
|
|||
$this->assign('cart_list', $cart_list['data']);
|
||||
|
||||
// 收藏商品
|
||||
$params = array_merge($_POST, $_GET);
|
||||
$params['user'] = $this->user;
|
||||
$where = GoodsService::UserGoodsFavorListWhere($params);
|
||||
$favor_params = array(
|
||||
'm' => 0,
|
||||
'n' => 8,
|
||||
'where' => $where,
|
||||
'n' => 6,
|
||||
'where' => [
|
||||
['g.is_delete_time', '=', 0],
|
||||
['f.user_id', '=', $this->user['id']],
|
||||
],
|
||||
);
|
||||
$favor = GoodsService::GoodsFavorList($favor_params);
|
||||
$favor = GoodsFavorService::GoodsFavorList($favor_params);
|
||||
$this->assign('goods_favor_list', $favor['data']);
|
||||
|
||||
// 我的足迹
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ class UserIntegral extends Common
|
|||
];
|
||||
$ret = IntegralService::IntegralLogList($data_params);
|
||||
|
||||
// 用户积分
|
||||
$user_integral_data = IntegralService::UserIntegral($this->user['id']);
|
||||
$this->assign('user_integral_data', $user_integral_data['data']);
|
||||
|
||||
// 浏览器名称
|
||||
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('我的积分', 1));
|
||||
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@
|
|||
<div class="am-panel-hd">
|
||||
<i></i>商品收藏
|
||||
{{if !empty($goods_favor_list)}}
|
||||
<a class="am-fr more-tips" href="{{:MyUrl('index/userfavor/goods')}}" target="_blank">
|
||||
<a class="am-fr more-tips" href="{{:MyUrl('index/usergoodsfavor/index')}}" target="_blank">
|
||||
更多 <span class="am-icon-angle-double-right"></span>
|
||||
</a>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
<div class="am-alert am-alert-secondary" data-am-alert>
|
||||
<div class="available">
|
||||
<span>正常可用</span>
|
||||
<span class="panel-value">{{$user.integral}}</span>
|
||||
<span class="panel-value">{{$user_integral_data.integral}}</span>
|
||||
<em>积分</em>
|
||||
<span class="panel-tips">可以正常使用的积分</span>
|
||||
</div>
|
||||
<div class="locking">
|
||||
<span>当前锁定</span>
|
||||
<span class="panel-value">{{$user.locking_integral}}</span>
|
||||
<span class="panel-value">{{$user_integral_data.locking_integral}}</span>
|
||||
<em>积分</em>
|
||||
<span class="panel-tips">一般积分交易中,交易并未完成、锁定相应的积分</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -301,5 +301,20 @@ class IntegralService
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-01
|
||||
* @desc description
|
||||
* @param [int] $user_id [用户 id]
|
||||
*/
|
||||
public static function UserIntegral($user_id)
|
||||
{
|
||||
$data = Db::name('User')->where(['id'=>$user_id])->field('integral,locking_integral')->find();
|
||||
return DataReturn('success', 0, $data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -17,6 +17,8 @@ use app\service\MessageService;
|
|||
use app\service\OrderService;
|
||||
use app\service\GoodsService;
|
||||
use app\service\GoodsBrowseService;
|
||||
use app\service\GoodsFavorService;
|
||||
use app\service\IntegralService;
|
||||
|
||||
/**
|
||||
* 导航服务层
|
||||
|
|
@ -1013,27 +1015,24 @@ class NavigationService
|
|||
*/
|
||||
public static function UserCenterMiniNavigation($params = [])
|
||||
{
|
||||
if(empty($params['user']))
|
||||
$user_order_count = 0;
|
||||
$user_goods_favor_count = 0;
|
||||
$user_goods_browse_count = 0;
|
||||
$user_integral = 0;
|
||||
if(!empty($params['user']))
|
||||
{
|
||||
$user_order_count = 0;
|
||||
$user_goods_favor_count = 0;
|
||||
$user_goods_browse_count = 0;
|
||||
$user_integral = 0;
|
||||
} else {
|
||||
// 订单总数
|
||||
$where = ['user_id'=>$params['user']['id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0];
|
||||
$user_order_count = OrderService::OrderTotal($where);
|
||||
|
||||
// 商品收藏总数
|
||||
$where = ['user_id'=>$params['user']['id']];
|
||||
$user_goods_favor_count = GoodsService::GoodsFavorTotal($where);
|
||||
|
||||
// 我的足迹总数
|
||||
// 商品收藏/我的足迹总数
|
||||
$where = ['user_id'=>$params['user']['id']];
|
||||
$user_goods_favor_count = GoodsFavorService::GoodsFavorTotal($where);
|
||||
$user_goods_browse_count = GoodsBrowseService::GoodsBrowseTotal($where);
|
||||
|
||||
// 用户积分
|
||||
$user_integral = isset($params['user']['integral']) ? $params['user']['integral'] : 0;
|
||||
$user_integral_data = IntegralService::UserIntegral($params['user']['id']);
|
||||
$user_integral = (isset($user_integral_data['data']) && isset($user_integral_data['data']['integral'])) ? $user_integral_data['data']['integral'] : 0;
|
||||
}
|
||||
|
||||
// 列表
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@
|
|||
ShopXO 1.9.0 Release --- http://shopxo.net
|
||||
+=========================================================+
|
||||
全局
|
||||
1. 所有条件、列表、新增、编辑、删除 新增钩子(公共 form 表单封装)
|
||||
2. 积分支持按照订单商品总额比例发放,发生售后收回积分
|
||||
3. 微信小程序好物推荐和直播组件支持配置组件版本号
|
||||
4. 后台管理登录页面新增随机背景
|
||||
1. 积分支持按照订单商品总额比例发放,发生售后收回积分
|
||||
2. 微信小程序好物推荐和直播组件支持配置组件版本号
|
||||
|
||||
|
||||
web端
|
||||
|
||||
1. 所有条件、数据列表、新增、编辑、删除 新增钩子(公共 form 表单封装)
|
||||
2. 后台管理登录页面新增随机背景(支持关闭)
|
||||
3. 商品编辑规格新增选中光标,用于数据太多定位操作位置
|
||||
4. 后端新增用户商品浏览管理
|
||||
5. 后端新增用户商品收藏管理
|
||||
6. 支付插件支持自定义输出成功/失败内容
|
||||
7. 支付插件管理优化适配平台,编辑不可超出插件定义的适配平台
|
||||
8. 用户积分实时获取
|
||||
|
||||
小程序端
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -310,5 +310,31 @@ class BaiduMini
|
|||
openssl_free_key($pubkey);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义成功返回内容
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-01
|
||||
* @desc description
|
||||
*/
|
||||
public function SuccessReturn()
|
||||
{
|
||||
return '{"errno":0,"msg":"success","data":{"isConsumed":2}}';
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义失败返回内容
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-01
|
||||
* @desc description
|
||||
*/
|
||||
public function ErrorReturn()
|
||||
{
|
||||
return '{"errno": 0,"msg": "success","data": {"isErrorOrder": 1,"isConsumed": 2}';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -53,7 +53,7 @@ class Ipay88
|
|||
'version' => '1.0.0', // 插件版本
|
||||
'apply_version' => '不限', // 适用系统版本描述
|
||||
'apply_terminal'=> ['pc','h5'], // 适用终端 默认全部
|
||||
'desc' => '适用PC+H5, <a href="http://www.ipay88.com" target="_blank">立即申请</a>', // 插件描述(支持html)
|
||||
'desc' => '适用PC+H5,马来西亚用户量最大的在线支付服务商,可以处理多达26种货币,包括MYR,AUD,EUR,SGD,USD,THB,RMB。<a href="https://www.ipay88.com/" target="_blank">立即申请</a>', // 插件描述(支持html)
|
||||
'author' => 'Devil', // 开发者
|
||||
'author_url' => 'http://shopxo.net/', // 开发者主页
|
||||
];
|
||||
|
|
@ -228,5 +228,18 @@ class Ipay88
|
|||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义成功返回内容
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-01
|
||||
* @desc description
|
||||
*/
|
||||
public function SuccessReturn()
|
||||
{
|
||||
return 'RECEIVEOK';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -2,7 +2,7 @@ $(function()
|
|||
{
|
||||
// 登录页面背景切换
|
||||
var count = $('.bg-slides-item').length;
|
||||
if(count > 0)
|
||||
if(count > 1)
|
||||
{
|
||||
var temp_old = 0;
|
||||
var temp_new = 1;
|
||||
|
|
@ -19,5 +19,9 @@ $(function()
|
|||
temp_new = 0;
|
||||
}
|
||||
}, interval_time);
|
||||
} else if(count == 1)
|
||||
{
|
||||
// 只有一张图片则直接显示
|
||||
$('.bg-slides-item').show();
|
||||
}
|
||||
});
|
||||
|
|
@ -681,4 +681,11 @@ $(function()
|
|||
initialFrameHeight : 100
|
||||
});
|
||||
}
|
||||
|
||||
// 规格选中状态
|
||||
$(document).on('click', '.specifications-table tr', function()
|
||||
{
|
||||
$('.specifications-table tr').removeClass('am-primary');
|
||||
$(this).addClass('am-primary');
|
||||
});
|
||||
});
|
||||
|
|
@ -74,6 +74,7 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
|
|||
.various .line-price{color: #d2364c; font-weight: 700; font-family: Verdana,Tahoma,arial; }
|
||||
.various .goods-browse-list .am-gallery-item img {width: 80%;}
|
||||
.various .am-gallery-overlay .am-gallery-desc{display: block; position: absolute; right: 0; top: 0; background-color: #d2364c; color: #fff; padding: 0 5px;}
|
||||
.various .table-no { padding: 30px 0; }
|
||||
|
||||
/**
|
||||
* PC
|
||||
|
|
|
|||
Loading…
Reference in New Issue