Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
fd675b70
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fd675b70
编写于
11月 14, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
基础缓存配置+细节优化
上级
0c3dba5a
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
349 addition
and
139 deletion
+349
-139
application/admin/form/Appcenternav.php
application/admin/form/Appcenternav.php
+1
-1
application/admin/form/Apphomenav.php
application/admin/form/Apphomenav.php
+1
-1
application/admin/form/Customview.php
application/admin/form/Customview.php
+1
-1
application/admin/form/Goodsbrowse.php
application/admin/form/Goodsbrowse.php
+1
-1
application/admin/form/Goodscomments.php
application/admin/form/Goodscomments.php
+1
-1
application/admin/form/Goodsfavor.php
application/admin/form/Goodsfavor.php
+1
-1
application/admin/form/Integrallog.php
application/admin/form/Integrallog.php
+1
-1
application/admin/form/Orderaftersale.php
application/admin/form/Orderaftersale.php
+1
-1
application/admin/form/Paylog.php
application/admin/form/Paylog.php
+1
-1
application/admin/form/Quicknav.php
application/admin/form/Quicknav.php
+1
-1
application/admin/form/Refundlog.php
application/admin/form/Refundlog.php
+1
-1
application/admin/form/Warehousegoods.php
application/admin/form/Warehousegoods.php
+1
-1
application/admin/lang/zh-cn.php
application/admin/lang/zh-cn.php
+1
-1
application/common.php
application/common.php
+61
-0
application/index/config/app.php
application/index/config/app.php
+1
-1
application/index/config/template.php
application/index/config/template.php
+1
-1
application/index/controller/Goods.php
application/index/controller/Goods.php
+40
-0
application/index/form/Orderaftersale.php
application/index/form/Orderaftersale.php
+1
-1
application/index/form/Userintegral.php
application/index/form/Userintegral.php
+1
-1
application/index/view/default/goods/index.html
application/index/view/default/goods/index.html
+68
-3
application/service/BaseService.php
application/service/BaseService.php
+0
-4
application/service/ConfigService.php
application/service/ConfigService.php
+4
-1
application/tags.php
application/tags.php
+33
-1
config/app.php
config/app.php
+1
-1
config/shopxo.php
config/shopxo.php
+2
-2
config/ueditor.php
config/ueditor.php
+5
-5
public/core.php
public/core.php
+5
-0
public/static/common/js/common.js
public/static/common/js/common.js
+70
-60
public/static/index/default/css/goods.css
public/static/index/default/css/goods.css
+3
-0
public/static/index/default/js/goods.js
public/static/index/default/js/goods.js
+40
-45
未找到文件。
application/admin/form/Appcenternav.php
浏览文件 @
fd675b70
...
...
@@ -18,7 +18,7 @@ namespace app\admin\form;
* @date 2020-06-20
* @desc description
*/
class
App
centern
av
class
App
CenterN
av
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Apphomenav.php
浏览文件 @
fd675b70
...
...
@@ -18,7 +18,7 @@ namespace app\admin\form;
* @date 2020-06-20
* @desc description
*/
class
App
homen
av
class
App
HomeN
av
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Customview.php
浏览文件 @
fd675b70
...
...
@@ -18,7 +18,7 @@ namespace app\admin\form;
* @date 2020-06-16
* @desc description
*/
class
Custom
v
iew
class
Custom
V
iew
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Goodsbrowse.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-30
* @desc description
*/
class
Goods
b
rowse
class
Goods
B
rowse
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Goodscomments.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-08
* @desc description
*/
class
Goods
c
omments
class
Goods
C
omments
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Goodsfavor.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-30
* @desc description
*/
class
Goods
f
avor
class
Goods
F
avor
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Integrallog.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-27
* @desc description
*/
class
Integral
l
og
class
Integral
L
og
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Orderaftersale.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-08
* @desc description
*/
class
Order
a
ftersale
class
Order
A
ftersale
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Paylog.php
浏览文件 @
fd675b70
...
...
@@ -21,7 +21,7 @@ use app\service\PayLogService;
* @date 2020-06-26
* @desc description
*/
class
Pay
l
og
class
Pay
L
og
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Quicknav.php
浏览文件 @
fd675b70
...
...
@@ -18,7 +18,7 @@ namespace app\admin\form;
* @date 2020-06-20
* @desc description
*/
class
Quick
n
av
class
Quick
N
av
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Refundlog.php
浏览文件 @
fd675b70
...
...
@@ -21,7 +21,7 @@ use app\service\RefundLogService;
* @date 2020-06-27
* @desc description
*/
class
Refund
l
og
class
Refund
L
og
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/form/Warehousegoods.php
浏览文件 @
fd675b70
...
...
@@ -22,7 +22,7 @@ use app\service\RegionService;
* @date 2020-07-12
* @desc description
*/
class
Warehouse
g
oods
class
Warehouse
G
oods
{
// 基础条件
public
$condition_base
=
[];
...
...
application/admin/lang/zh-cn.php
浏览文件 @
fd675b70
...
...
@@ -64,7 +64,7 @@ return array(
'Asia/Kolkata'
=>
'(标准时+5:00) 叶卡捷琳堡、伊斯兰堡、卡拉奇'
,
'Asia/Dhaka'
=>
'(标准时+6:00) 阿拉木图、 达卡、新亚伯利亚'
,
'Indian/Christmas'
=>
'(标准时+7:00) 曼谷、河内、雅加达'
,
'A
ustralia/Eucla
'
=>
'(标准时+8:00)北京、重庆、香港、新加坡'
,
'A
sia/Shanghai
'
=>
'(标准时+8:00)北京、重庆、香港、新加坡'
,
'Australia/Darwin'
=>
'(标准时+9:00) 东京、汉城、大阪、雅库茨克'
,
'Australia/Adelaide'
=>
'(标准时+10:00) 悉尼、关岛'
,
'Australia/Currie'
=>
'(标准时+11:00) 马加丹、索罗门群岛'
,
...
...
application/common.php
浏览文件 @
fd675b70
...
...
@@ -11,6 +11,67 @@
// 应用公共文件
/**
* 文件配置数据读写
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-11-13
* @desc description
* @param [string] $key [数据缓存可以]
* @param [mixed] $value [数据值(空字符串:读, null:删除, 其他:写)]
* @param [mixed] $default [默认值]
* @param [boolean] $mandatory[是否强制判断数据值(空字符串|null|0)视为空]
* @return [mixed] [缓存不存在:null, 则缓存数据]
*/
function
MyFileConfig
(
$key
,
$value
=
''
,
$default
=
null
,
$mandatory
=
false
)
{
// 目录不存在则创建
$config_dir
=
ROOT
.
'runtime'
.
DS
.
'data'
.
DS
.
'config_data'
.
DS
;
\
base\FileUtil
::
CreateDir
(
$config_dir
);
// 数据文件
$file
=
$config_dir
.
md5
(
$key
)
.
'.php'
;
// 删除
if
(
$value
===
null
)
{
return
\
base\FileUtil
::
UnlinkFile
(
$aim_url
);
}
else
{
// 读内容
if
(
$value
===
''
)
{
$value
=
file_exists
(
$file
)
?
require
$file
:
$default
;
if
(
$mandatory
===
true
)
{
if
(
empty
(
$value
))
{
$value
=
$default
;
}
}
return
$value
;
// 写内容
}
else
{
// 目录是否有可写权限
if
(
!
is_writable
(
$config_dir
))
{
return
false
;
}
// 存在则校验写权限
if
(
file_exists
(
$file
)
&&
!
is_writable
(
$file
))
{
return
false
;
}
// 存储内容
$content
=
"<?php
\n
return "
.
var_export
(
$value
,
true
)
.
";
\n
?>"
;
return
(
file_put_contents
(
$file
,
$content
)
!==
false
);
}
}
}
/**
* 获取参数数据
* @author Devil
...
...
application/index/config/app.php
浏览文件 @
fd675b70
...
...
@@ -27,6 +27,6 @@ return [
'default_jsonp_handler'
=>
'jsonpReturn'
,
// 伪静态后缀
'url_html_suffix'
=>
My
C
(
'home_seo_url_html_suffix
'
,
'html'
,
true
),
'url_html_suffix'
=>
My
FileConfig
(
'home_seo_url_html_suffix'
,
'
'
,
'html'
,
true
),
];
?>
\ No newline at end of file
application/index/config/template.php
浏览文件 @
fd675b70
...
...
@@ -22,7 +22,7 @@ return [
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule'
=>
1
,
// 模板路径
'view_path'
=>
APP_PATH
.
'index'
.
DS
.
'view'
.
DS
.
strtolower
(
My
C
(
'common_default_theme
'
,
'default'
,
true
))
.
DS
,
'view_path'
=>
APP_PATH
.
'index'
.
DS
.
'view'
.
DS
.
strtolower
(
My
FileConfig
(
'common_default_theme'
,
'
'
,
'default'
,
true
))
.
DS
,
// 模板后缀
'view_suffix'
=>
'html'
,
// 模板文件名分隔符
...
...
application/index/controller/Goods.php
浏览文件 @
fd675b70
...
...
@@ -207,6 +207,46 @@ class Goods extends Common
'goods'
=>
&
$goods
,
]));
// 商品页面规格顶部钩子
$hook_name
=
'plugins_view_goods_detail_base_sku_top'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
$goods_id
,
'goods'
=>
&
$goods
,
]));
// 商品页面库存数量顶部钩子
$hook_name
=
'plugins_view_goods_detail_base_inventory_top'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
$goods_id
,
'goods'
=>
&
$goods
,
]));
// 商品页面库存数量底部钩子
$hook_name
=
'plugins_view_goods_detail_base_inventory_bottom'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
$goods_id
,
'goods'
=>
&
$goods
,
]));
// 商品页面购买导航顶部钩子
$hook_name
=
'plugins_view_goods_detail_buy_nav_top'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
false
,
'goods_id'
=>
$goods_id
,
'goods'
=>
&
$goods
,
]));
// 商品页面基础信息面板底部钩子
$hook_name
=
'plugins_view_goods_detail_base_bottom'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
...
...
application/index/form/Orderaftersale.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-30
* @desc description
*/
class
Order
a
ftersale
class
Order
A
ftersale
{
// 基础条件
public
$condition_base
=
[];
...
...
application/index/form/Userintegral.php
浏览文件 @
fd675b70
...
...
@@ -20,7 +20,7 @@ use think\Db;
* @date 2020-06-28
* @desc description
*/
class
User
i
ntegral
class
User
I
ntegral
{
// 基础条件
public
$condition_base
=
[];
...
...
application/index/view/default/goods/index.html
浏览文件 @
fd675b70
...
...
@@ -271,6 +271,19 @@
<div
class=
"theme-popbod dform"
>
<form
class=
"theme-signin am-padding-sm"
action=
"javascript:;"
>
<div
class=
"theme-signin-left"
>
<!-- 商品页面规格顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_goods_detail_base_sku_top
</span>
</div>
{{/if}}
{{if !empty($plugins_view_goods_detail_base_sku_top_data) and is_array($plugins_view_goods_detail_base_sku_top_data)}}
{{foreach $plugins_view_goods_detail_base_sku_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
{{if !empty($goods['specifications']['choose'])}}
{{foreach $goods.specifications.choose as $key=>$spec}}
{{if !empty($spec['value'])}}
...
...
@@ -290,6 +303,22 @@
{{/if}}
{{/foreach}}
{{/if}}
<!-- 商品页面库存数量顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_goods_detail_base_inventory_top
</span>
</div>
{{/if}}
{{if !empty($plugins_view_goods_detail_base_inventory_top_data) and is_array($plugins_view_goods_detail_base_inventory_top_data)}}
{{foreach $plugins_view_goods_detail_base_inventory_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<!-- 库存数量 -->
<div
class=
"theme-options"
>
<div
class=
"cart-title number"
>
数量
</div>
<dd>
...
...
@@ -302,8 +331,22 @@
</dd>
</div>
<!-- 商品页面库存数量底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_goods_detail_base_inventory_bottom
</span>
</div>
{{/if}}
{{if !empty($plugins_view_goods_detail_base_inventory_bottom_data) and is_array($plugins_view_goods_detail_base_inventory_bottom_data)}}
{{foreach $plugins_view_goods_detail_base_inventory_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<div
class=
"btn-op"
>
<span
class=
"btn am-btn am-btn-default confirm login-event"
data-type=
"cart"
data-ajax-url=
"{{:MyUrl('index/Cart/Save')}}"
>
确认
</span>
<span
class=
"btn am-btn am-btn-default confirm login-event"
data-type=
"cart"
>
确认
</span>
<span
class=
"btn close am-btn am-btn-danger cancel"
>
取消
</span>
</div>
</div>
...
...
@@ -323,6 +366,20 @@
{{/if}}
</div>
<!-- 商品页面购买导航顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
<div
class=
"plugins-tag"
>
<span>
plugins_view_goods_detail_buy_nav_top
</span>
</div>
{{/if}}
{{if !empty($plugins_view_goods_detail_buy_nav_top_data) and is_array($plugins_view_goods_detail_buy_nav_top_data)}}
{{foreach $plugins_view_goods_detail_buy_nav_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<!-- 购买导航 -->
<div
class=
"buy-nav {{if $common_site_type eq 1}}exhibition-nav{{else /}}{{if isset($is_goods_site_type_consistent) and $is_goods_site_type_consistent neq 1}}site-type-not-consistent-nav{{/if}}{{/if}}"
>
{{if !empty($goods.is_shelves)}}
...
...
@@ -367,7 +424,7 @@
{{if $common_site_type eq 1}}
<!-- 站点模式 1 展示型 -->
<div
class=
"submit"
>
<div
class=
"clearfix tb-btn tb-btn-basket"
data-type=
"cart"
data-ajax-url=
"{{:MyUrl('index/Cart/Save')}}"
>
<div
class=
"clearfix tb-btn tb-btn-basket"
data-type=
"cart"
>
<a
href=
"{{if empty($common_customer_store_tel)}}javascript:;{{else /}}tel:{{$common_customer_store_tel}}{{/if}}"
>
<button
title=
"{{$common_is_exhibition_mode_btn_text}}"
href=
"javascript:;"
type=
"button"
><i
class=
"am-icon-phone"
></i>
{{$common_is_exhibition_mode_btn_text}}
</button>
</a>
...
...
@@ -385,7 +442,7 @@
{{if isset($is_goods_site_type_consistent) and $is_goods_site_type_consistent eq 1}}
<!-- 商品类型是否与系统类型一致 -->
<div
class=
"submit"
>
<div
class=
"clearfix tb-btn tb-btn-basket buy-event login-event cart-submit"
data-type=
"cart"
data-ajax-url=
"{{:MyUrl('index/Cart/Save')}}"
>
<div
class=
"clearfix tb-btn tb-btn-basket buy-event login-event cart-submit"
data-type=
"cart"
>
<button
title=
"加入购物车"
href=
"javascript:;"
type=
"button"
><i></i>
加入购物车
</button>
</div>
</div>
...
...
@@ -399,6 +456,14 @@
<input
type=
"hidden"
name=
"spec"
value=
""
/>
<button
type=
"submit"
></button>
</form>
<!-- 加入购物车表单 -->
<form
action=
"{{:MyUrl('index/cart/save')}}"
method=
"post"
class=
"cart-form"
request-type=
"ajax-view"
>
<input
type=
"hidden"
name=
"goods_id"
value=
"{{$goods.id}}"
/>
<input
type=
"hidden"
name=
"stock"
value=
"1"
/>
<input
type=
"hidden"
name=
"spec"
value=
""
/>
<button
type=
"submit"
data-am-loading=
"{loadingText:''}"
></button>
</form>
{{/if}}
{{else /}}
<p
class=
"goods-not-buy-tips"
>
商品卖光了
</p>
...
...
application/service/BaseService.php
浏览文件 @
fd675b70
...
...
@@ -25,10 +25,6 @@ use app\service\QuickNavService;
*/
class
BaseService
{
public
static
function
sss
()
{
return
MyC
(
'common_timezone'
,
'Asia/Shanghai'
,
true
);
}
/**
* 公共配置信息
* @author Devil
...
...
application/service/ConfigService.php
浏览文件 @
fd675b70
...
...
@@ -213,8 +213,11 @@ class ConfigService
$v
=
ResourcesService
::
ContentStaticReplace
(
$v
,
'get'
);
}
//
单个
缓存
//
公共内置数据
缓存
cache
(
$k
,
$v
);
// 数据文件缓存
MyFileConfig
(
$k
,
$v
);
}
// 所有配置缓存集合
...
...
application/tags.php
浏览文件 @
fd675b70
...
...
@@ -34,7 +34,18 @@ return array (
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
1
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
2
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_view_goods_detail_base_inventory_top'
=>
array
(
0
=>
'app\\plugins\\ordergoodsform\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
...
...
@@ -95,6 +106,27 @@ return array (
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\membershiplevelvip\\Hook'
,
1
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_common_page_bottom'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_service_quick_navigation_pc'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_service_quick_navigation_h5'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_view_common_top'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
),
'plugins_view_common_bottom'
=>
array
(
0
=>
'app\\plugins\\multilingual\\Hook'
,
),
);
?>
\ No newline at end of file
config/app.php
浏览文件 @
fd675b70
...
...
@@ -37,7 +37,7 @@ return [
// 默认JSONP处理方法
'var_jsonp_handler'
=>
'callback'
,
// 默认时区
'default_timezone'
=>
My
C
(
'common_timezone
'
,
'Asia/Shanghai'
,
true
),
'default_timezone'
=>
My
FileConfig
(
'common_timezone'
,
'
'
,
'Asia/Shanghai'
,
true
),
// 是否开启多语言
'lang_switch_on'
=>
false
,
// 默认全局过滤方法 用逗号分隔多个
...
...
config/shopxo.php
浏览文件 @
fd675b70
...
...
@@ -14,8 +14,8 @@
// +----------------------------------------------------------------------
// cdn地址
$cdn_attachment_host
=
My
C
(
'common_cdn_attachment_host
'
,
__MY_PUBLIC_URL__
,
true
);
$cdn_public_host
=
My
C
(
'common_cdn_public_host
'
,
__MY_PUBLIC_URL__
,
true
);
$cdn_attachment_host
=
My
FileConfig
(
'common_cdn_attachment_host'
,
'
'
,
__MY_PUBLIC_URL__
,
true
);
$cdn_public_host
=
My
FileConfig
(
'common_cdn_public_host'
,
'
'
,
__MY_PUBLIC_URL__
,
true
);
if
(
substr
(
$cdn_attachment_host
,
-
1
)
==
DS
)
{
$cdn_attachment_host
=
substr
(
$cdn_attachment_host
,
0
,
-
1
);
...
...
config/ueditor.php
浏览文件 @
fd675b70
...
...
@@ -27,7 +27,7 @@ return [
'imageFieldName'
=>
'upfile'
,
// 上传大小限制,单位B
'imageMaxSize'
=>
My
C
(
'home_max_limit_image
'
,
2048000
,
true
),
'imageMaxSize'
=>
My
FileConfig
(
'home_max_limit_image'
,
'
'
,
2048000
,
true
),
// 上传图片格式显示
'imageAllowFiles'
=>
[
'.png'
,
'.jpg'
,
'.jpeg'
,
'.gif'
,
'.bmp'
],
...
...
@@ -59,7 +59,7 @@ return [
'scrawlPathFormat'
=>
__MY_ROOT_PUBLIC__
.
'static/upload/images/'
.
$upload_path
.
'/{yyyy}/{mm}/{dd}/{time}{rand:6}'
,
// 上传大小限制,单位B
'scrawlMaxSize'
=>
My
C
(
'home_max_limit_image
'
,
2048000
,
true
),
'scrawlMaxSize'
=>
My
FileConfig
(
'home_max_limit_image'
,
'
'
,
2048000
,
true
),
// 上传图片格式显示
'scrawlAllowFiles'
=>
[
'.png'
,
'.jpg'
,
'.jpeg'
,
'.gif'
,
'.bmp'
],
...
...
@@ -102,7 +102,7 @@ return [
'catcherUrlPrefix'
=>
''
,
// 上传大小限制,单位B
'catcherMaxSize'
=>
My
C
(
'home_max_limit_image
'
,
2048000
,
true
),
'catcherMaxSize'
=>
My
FileConfig
(
'home_max_limit_image'
,
'
'
,
2048000
,
true
),
// 抓取图片格式显示
'catcherAllowFiles'
=>
[
'.png'
,
'.jpg'
,
'.jpeg'
,
'.gif'
,
'.bmp'
],
...
...
@@ -122,7 +122,7 @@ return [
'videoUrlPrefix'
=>
''
,
// 上传大小限制,单位B,默认100MB
'videoMaxSize'
=>
My
C
(
'home_max_limit_video
'
,
102400000
,
true
),
'videoMaxSize'
=>
My
FileConfig
(
'home_max_limit_video'
,
'
'
,
102400000
,
true
),
// 上传视频格式显示
'videoAllowFiles'
=>
[
'.swf'
,
'.ogg'
,
'.ogv'
,
'.mp4'
,
'.webm'
,
'.mp3'
],
...
...
@@ -142,7 +142,7 @@ return [
'fileUrlPrefix'
=>
''
,
// 上传大小限制,单位B,默认50MB
'fileMaxSize'
=>
My
C
(
'home_max_limit_file
'
,
51200000
,
true
),
'fileMaxSize'
=>
My
FileConfig
(
'home_max_limit_file'
,
'
'
,
51200000
,
true
),
// 上传文件格式显示
'fileAllowFiles'
=>
[
'.png'
,
'.jpg'
,
'.jpeg'
,
'.gif'
,
'.bmp'
,
'.flv'
,
'.swf'
,
'.mkv'
,
'.avi'
,
'.rm'
,
'.rmvb'
,
'.mpeg'
,
'.mpg'
,
'.ogg'
,
'.ogv'
,
'.mov'
,
'.wmv'
,
'.mp4'
,
'.webm'
,
'.mp3'
,
'.wav'
,
'.mid'
,
'.rar'
,
'.zip'
,
'.tar'
,
'.gz'
,
'.7z'
,
'.bz2'
,
'.cab'
,
'.iso'
,
'.doc'
,
'.docx'
,
'.xls'
,
'.xlsx'
,
'.ppt'
,
'.pptx'
,
'.pdf'
,
'.txt'
,
'.md'
,
'.xml'
],
...
...
public/core.php
浏览文件 @
fd675b70
...
...
@@ -37,6 +37,11 @@ define('__MY_PUBLIC_URL__', empty($_SERVER['HTTP_HOST']) ? '' : __MY_HTTP__.':/
// 当前页面url地址
$request_url
=
isset
(
$_SERVER
[
'REQUEST_URI'
])
?
$_SERVER
[
'REQUEST_URI'
]
:
''
;
if
(
!
empty
(
$request_url
)
&&
!
empty
(
$my_root
))
{
// 去除多余的子目录路径
$request_url
=
str_replace
(
$my_root
,
''
,
$request_url
);
}
define
(
'__MY_VIEW_URL__'
,
substr
(
__MY_URL__
,
0
,
-
1
)
.
$request_url
);
// 系统根目录,强制转换win反斜杠
...
...
public/static/common/js/common.js
浏览文件 @
fd675b70
...
...
@@ -369,15 +369,10 @@ function FromInit(form_name)
// ajax-reload 请求完成后刷新页面
// ajax-url 请求完成后调整到指定的请求值
// ajax-fun 请求完成后调用指定方法
// ajax-view 请求完成后仅提示文本信息
// sync 不发起请求、直接同步调用指定的方法
// jump 不发起请求、拼接数据参数跳转到指定 url 地址
var
request_handle
=
[
'
ajax-reload
'
,
'
ajax-url
'
,
'
ajax-fun
'
,
'
sync
'
,
'
jump
'
];
// 是form表单直接通过
if
(
request_type
==
'
form
'
)
{
return
true
;
}
var
request_handle
=
[
'
ajax-reload
'
,
'
ajax-url
'
,
'
ajax-fun
'
,
'
ajax-view
'
,
'
sync
'
,
'
jump
'
,
'
form
'
];
// 参数校验
if
(
request_handle
.
indexOf
(
request_type
)
==
-
1
)
...
...
@@ -387,37 +382,46 @@ function FromInit(form_name)
return
false
;
}
// 类型不等于刷新的时候,类型值必须填写
if
(
request_type
!=
'
ajax-reload
'
&&
request_value
==
null
)
// 类型值必须配置校验
var
request_type_value
=
[
'
ajax-url
'
,
'
ajax-fun
'
,
'
sync
'
,
'
jump
'
]
if
(
request_type_value
.
indexOf
(
request_type
)
!=
-
1
&&
request_value
==
null
)
{
$button
.
button
(
'
reset
'
);
Prompt
(
'
表单[类型值]参数配置有误
'
);
return
false
;
}
//
同步调用方法
if
(
request_type
==
'
sync
'
)
//
请求类型
switch
(
request_type
)
{
$button
.
button
(
'
reset
'
);
if
(
IsExitsFunction
(
request_value
))
{
window
[
request_value
](
GetFormVal
(
form_name
,
true
));
}
else
{
Prompt
(
'
[
'
+
request_value
+
'
]表单定义的方法未定义
'
);
}
return
false
;
}
// 是form表单直接通过
case
'
form
'
:
return
true
;
break
;
// 同步调用方法
case
'
sync
'
:
$button
.
button
(
'
reset
'
);
if
(
IsExitsFunction
(
request_value
))
{
window
[
request_value
](
GetFormVal
(
form_name
,
true
));
}
else
{
Prompt
(
'
[
'
+
request_value
+
'
]表单定义的方法未定义
'
);
}
return
false
;
break
;
// 拼接参数跳转
case
'
jump
'
:
var
params
=
GetFormVal
(
form_name
,
true
);
for
(
var
i
in
params
)
{
request_value
=
UrlFieldReplace
(
i
,
encodeURIComponent
(
params
[
i
]),
request_value
)
}
window
.
location
.
href
=
request_value
;
return
false
;
break
;
// 拼接参数跳转
if
(
request_type
==
'
jump
'
)
{
var
params
=
GetFormVal
(
form_name
,
true
);
for
(
var
i
in
params
)
{
request_value
=
UrlFieldReplace
(
i
,
encodeURIComponent
(
params
[
i
]),
request_value
)
}
window
.
location
.
href
=
request_value
;
return
false
;
}
// 请求 url http类型
...
...
@@ -433,15 +437,16 @@ function FromInit(form_name)
// ajax请求
$
.
ajax
({
url
:
action
,
type
:
method
,
dataType
:
"
json
"
,
timeout
:
$form
.
attr
(
'
timeout
'
)
||
30000
,
data
:
GetFormVal
(
form_name
),
processData
:
false
,
contentType
:
false
,
success
:
function
(
result
)
url
:
action
,
type
:
method
,
dataType
:
"
json
"
,
timeout
:
$form
.
attr
(
'
timeout
'
)
||
30000
,
data
:
GetFormVal
(
form_name
),
processData
:
false
,
contentType
:
false
,
success
:
function
(
result
)
{
$
.
AMUI
.
progress
.
done
();
// 调用自定义回调方法
if
(
request_type
==
'
ajax-fun
'
)
{
...
...
@@ -449,40 +454,45 @@ function FromInit(form_name)
{
window
[
request_value
](
result
);
}
else
{
$
.
AMUI
.
progress
.
done
();
$button
.
button
(
'
reset
'
);
Prompt
(
'
[
'
+
request_value
+
'
]表单定义的方法未定义
'
);
}
}
else
if
(
request_type
==
'
ajax-url
'
||
request_type
==
'
ajax-reload
'
)
{
$
.
AMUI
.
progress
.
done
();
}
else
{
// 统一处理
if
(
result
.
code
==
0
)
{
// url跳转
if
(
request_type
==
'
ajax-url
'
)
switch
(
request_type
)
{
Prompt
(
result
.
msg
,
'
success
'
);
setTimeout
(
function
()
{
window
.
location
.
href
=
request_value
;
},
1500
);
// 页面刷新
}
else
if
(
request_type
==
'
ajax-reload
'
)
{
Prompt
(
result
.
msg
,
'
success
'
);
setTimeout
(
function
()
{
window
.
location
.
reload
();
},
1500
);
}
// url跳转
case
'
ajax-url
'
:
Prompt
(
result
.
msg
,
'
success
'
);
setTimeout
(
function
()
{
window
.
location
.
href
=
request_value
;
},
1500
);
break
;
// 页面刷新
case
'
ajax-reload
'
:
Prompt
(
result
.
msg
,
'
success
'
);
setTimeout
(
function
()
{
window
.
location
.
reload
();
},
1500
);
break
;
// 默认仅提示
default
:
$button
.
button
(
'
reset
'
);
Prompt
(
result
.
msg
,
'
success
'
);
}
}
else
{
Prompt
(
result
.
msg
);
$button
.
button
(
'
reset
'
);
}
}
},
error
:
function
(
xhr
,
type
)
error
:
function
(
xhr
,
type
)
{
$
.
AMUI
.
progress
.
done
();
$button
.
button
(
'
reset
'
);
...
...
public/static/index/default/css/goods.css
浏览文件 @
fd675b70
...
...
@@ -221,6 +221,9 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;}
#min
,
#add
{
width
:
35px
;
height
:
25px
;
outline
:
none
;
line-height
:
23px
;
padding
:
0
;
cursor
:
pointer
;
}
#text_box
{
width
:
60px
;
height
:
25px
;
text-align
:
center
;
font-size
:
12px
!important
;
}
.theme-popover
.am-input-group
{
display
:
inline-flex
;
}
@media
only
screen
and
(
min-width
:
641px
)
{
.theme-popover
.am-input-group
{
margin-left
:
5px
;
}
}
/*购物车*/
...
...
public/static/index/default/js/goods.js
浏览文件 @
fd675b70
...
...
@@ -66,7 +66,7 @@ function GoodsCommentsHtml(page)
}
/**
* 购买/加入购物车
* 购买/加入购物车
校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -74,10 +74,9 @@ function GoodsCommentsHtml(page)
* @desc description
* @param {[object]} e [当前标签对象]
*/
function
CartAdd
(
e
)
function
BuyCartCheck
(
e
)
{
// 参数
var
type
=
e
.
attr
(
'
data-type
'
);
var
stock
=
parseInt
(
$
(
'
#text_box
'
).
val
())
||
1
;
var
inventory
=
parseInt
(
$
(
'
.stock-tips .stock
'
).
text
());
var
min
=
$
(
'
.stock-tips .stock
'
).
data
(
'
min-limit
'
)
||
1
;
...
...
@@ -124,55 +123,48 @@ function CartAdd(e)
});
}
}
return
{
"
stock
"
:
stock
,
"
spec
"
:
spec
,
"
type
"
:
e
.
attr
(
'
data-type
'
)
};
}
/**
* 购买/加入购物车处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-13
* @desc description
* @param {[object]} e [当前标签对象]
*/
function
BuyCartHandle
(
e
)
{
// 参数
var
params
=
BuyCartCheck
(
e
);
if
(
params
===
false
)
{
return
false
;
}
// 操作类型
switch
(
type
)
switch
(
params
.
type
)
{
// 立即购买
case
'
buy
'
:
var
$form
_buy
=
$
(
'
form.buy-form
'
);
$form
_buy
.
find
(
'
input[name="spec"]
'
).
val
(
JSON
.
stringify
(
spec
));
$form
_buy
.
find
(
'
input[name="stock"]
'
).
val
(
stock
);
$form
_buy
.
find
(
'
button[type="submit"]
'
).
trigger
(
'
click
'
);
var
$form
=
$
(
'
form.buy-form
'
);
$form
.
find
(
'
input[name="spec"]
'
).
val
(
JSON
.
stringify
(
params
.
spec
));
$form
.
find
(
'
input[name="stock"]
'
).
val
(
params
.
stock
);
$form
.
find
(
'
button[type="submit"]
'
).
trigger
(
'
click
'
);
break
;
// 加入购物车
case
'
cart
'
:
// 开启进度条
$
.
AMUI
.
progress
.
start
();
var
$button
=
e
;
$button
.
attr
(
'
disabled
'
,
true
);
// ajax请求
$
.
ajax
({
url
:
e
.
data
(
'
ajax-url
'
),
type
:
'
post
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:
{
"
goods_id
"
:
$
(
'
.goods-detail
'
).
data
(
'
id
'
),
"
stock
"
:
stock
,
"
spec
"
:
spec
},
success
:
function
(
result
)
{
PoptitClose
();
$
.
AMUI
.
progress
.
done
();
$button
.
attr
(
'
disabled
'
,
false
);
if
(
result
.
code
==
0
)
{
HomeCartNumberTotalUpdate
(
parseInt
(
result
.
data
));
Prompt
(
result
.
msg
,
'
success
'
);
}
else
{
Prompt
(
result
.
msg
);
}
},
error
:
function
(
xhr
,
type
)
{
PoptitClose
();
$
.
AMUI
.
progress
.
done
();
$button
.
attr
(
'
disabled
'
,
false
);
Prompt
(
'
服务器错误
'
);
}
});
var
$form
=
$
(
'
form.cart-form
'
);
$form
.
find
(
'
input[name="spec"]
'
).
val
(
JSON
.
stringify
(
params
.
spec
));
$form
.
find
(
'
input[name="stock"]
'
).
val
(
params
.
stock
);
$form
.
find
(
'
button[type="submit"]
'
).
trigger
(
'
click
'
);
break
;
// 默认
...
...
@@ -385,6 +377,9 @@ function SpecPopupShow(e)
}
$
(
function
()
{
// 购物车表单初始化
FromInit
(
'
form.cart-form
'
);
// 商品规格选择
$
(
'
.theme-options
'
).
each
(
function
()
{
...
...
@@ -498,7 +493,7 @@ $(function() {
{
if
(
$
(
window
).
width
()
>=
1025
)
{
CartAdd
(
$
(
this
));
BuyCartHandle
(
$
(
this
));
}
}
});
...
...
@@ -509,7 +504,7 @@ $(function() {
{
if
(
$
(
window
).
width
()
<
1025
)
{
CartAdd
(
$
(
this
));
BuyCartHandle
(
$
(
this
));
}
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录