Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
a4b658c9
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a4b658c9
编写于
7月 08, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
仓库管理
上级
ce879745
变更
40
展开全部
隐藏空白更改
内联
并排
Showing
40 changed file
with
985 addition
and
176 deletion
+985
-176
application/admin/controller/Article.php
application/admin/controller/Article.php
+0
-3
application/admin/controller/Warehouse.php
application/admin/controller/Warehouse.php
+213
-0
application/admin/form/Warehouse.php
application/admin/form/Warehouse.php
+223
-0
application/admin/view/default/admin/save_info.html
application/admin/view/default/admin/save_info.html
+1
-7
application/admin/view/default/answer/save_info.html
application/admin/view/default/answer/save_info.html
+1
-7
application/admin/view/default/appcenternav/save_info.html
application/admin/view/default/appcenternav/save_info.html
+1
-7
application/admin/view/default/apphomenav/save_info.html
application/admin/view/default/apphomenav/save_info.html
+1
-7
application/admin/view/default/article/save_info.html
application/admin/view/default/article/save_info.html
+1
-7
application/admin/view/default/brand/save_info.html
application/admin/view/default/brand/save_info.html
+1
-7
application/admin/view/default/customview/save_info.html
application/admin/view/default/customview/save_info.html
+1
-7
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+1
-7
application/admin/view/default/goodscomments/save_info.html
application/admin/view/default/goodscomments/save_info.html
+1
-1
application/admin/view/default/lib/region_linkage.html
application/admin/view/default/lib/region_linkage.html
+1
-1
application/admin/view/default/payment/save_info.html
application/admin/view/default/payment/save_info.html
+1
-1
application/admin/view/default/public/module/detail.html
application/admin/view/default/public/module/detail.html
+4
-1
application/admin/view/default/public/module/form.html
application/admin/view/default/public/module/form.html
+4
-1
application/admin/view/default/role/save_info.html
application/admin/view/default/role/save_info.html
+1
-7
application/admin/view/default/site/sitetype.html
application/admin/view/default/site/sitetype.html
+2
-2
application/admin/view/default/slide/module/images.html
application/admin/view/default/slide/module/images.html
+1
-1
application/admin/view/default/slide/save_info.html
application/admin/view/default/slide/save_info.html
+1
-7
application/admin/view/default/user/save_info.html
application/admin/view/default/user/save_info.html
+1
-7
application/admin/view/default/warehouse/detail.html
application/admin/view/default/warehouse/detail.html
+31
-0
application/admin/view/default/warehouse/index.html
application/admin/view/default/warehouse/index.html
+9
-0
application/admin/view/default/warehouse/module/info.html
application/admin/view/default/warehouse/module/info.html
+9
-0
application/admin/view/default/warehouse/module/operate.html
application/admin/view/default/warehouse/module/operate.html
+13
-0
application/admin/view/default/warehouse/module/position.html
...ication/admin/view/default/warehouse/module/position.html
+7
-0
application/admin/view/default/warehouse/save_info.html
application/admin/view/default/warehouse/save_info.html
+79
-0
application/index/controller/Useraddress.php
application/index/controller/Useraddress.php
+9
-6
application/index/view/default/answer/index.html
application/index/view/default/answer/index.html
+4
-8
application/index/view/default/lib/region_linkage.html
application/index/view/default/lib/region_linkage.html
+1
-1
application/index/view/default/public/module/detail.html
application/index/view/default/public/module/detail.html
+4
-1
application/index/view/default/public/module/form.html
application/index/view/default/public/module/form.html
+4
-1
application/index/view/default/useraddress/save_info.html
application/index/view/default/useraddress/save_info.html
+8
-8
application/service/ArticleService.php
application/service/ArticleService.php
+4
-4
application/service/RegionService.php
application/service/RegionService.php
+5
-2
application/service/WarehouseService.php
application/service/WarehouseService.php
+259
-0
config/shopxo.sql
config/shopxo.sql
+59
-24
public/static/admin/default/css/site.css
public/static/admin/default/css/site.css
+0
-19
public/static/common/css/common.css
public/static/common/css/common.css
+19
-0
public/static/index/default/css/useraddress.css
public/static/index/default/css/useraddress.css
+0
-14
未找到文件。
application/admin/controller/Article.php
浏览文件 @
a4b658c9
...
...
@@ -133,9 +133,6 @@ class Article extends Common
$data
=
empty
(
$ret
[
'data'
][
0
])
?
[]
:
$ret
[
'data'
][
0
];
}
// 是否启用
$this
->
assign
(
'common_is_enable_list'
,
lang
(
'common_is_enable_list'
));
// 文章分类
$article_category
=
ArticleService
::
ArticleCategoryList
([
'field'
=>
'id,name'
]);
$this
->
assign
(
'article_category_list'
,
$article_category
[
'data'
]);
...
...
application/admin/controller/Warehouse.php
0 → 100644
浏览文件 @
a4b658c9
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\controller
;
use
think\facade\Hook
;
use
app\service\WarehouseService
;
/**
* 仓库管理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
class
Warehouse
extends
Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
public
function
__construct
()
{
// 调用父类前置方法
parent
::
__construct
();
// 登录校验
$this
->
IsLogin
();
// 权限校验
$this
->
IsPower
();
}
/**
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
public
function
Index
()
{
// 获取列表
$data_params
=
[
'where'
=>
$this
->
form_where
,
];
$ret
=
WarehouseService
::
WarehouseList
(
$data_params
);
// 基础参数赋值
$this
->
assign
(
'params'
,
$this
->
data_request
);
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
return
$this
->
fetch
();
}
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
*/
public
function
Detail
()
{
if
(
!
empty
(
$this
->
data_request
[
'id'
]))
{
// 条件
$where
=
[
[
'id'
,
'='
,
intval
(
$this
->
data_request
[
'id'
])],
];
// 获取列表
$data_params
=
[
'm'
=>
0
,
'n'
=>
1
,
'where'
=>
$where
,
];
$ret
=
WarehouseService
::
WarehouseList
(
$data_params
);
$data
=
(
empty
(
$ret
[
'data'
])
||
empty
(
$ret
[
'data'
][
0
]))
?
[]
:
$ret
[
'data'
][
0
];
$this
->
assign
(
'data'
,
$data
);
// 加载百度地图api
$this
->
assign
(
'is_load_baidu_map_api'
,
1
);
}
return
$this
->
fetch
();
}
/**
* 文章添加/编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
public
function
SaveInfo
()
{
// 参数
$params
=
$this
->
data_request
;
// 数据
$data
=
[];
if
(
!
empty
(
$params
[
'id'
]))
{
// 获取列表
$data_params
=
array
(
'where'
=>
[
'id'
=>
intval
(
$params
[
'id'
])],
);
$ret
=
WarehouseService
::
WarehouseList
(
$data_params
);
$data
=
empty
(
$ret
[
'data'
][
0
])
?
[]
:
$ret
[
'data'
][
0
];
}
// 文章编辑页面钩子
$hook_name
=
'plugins_view_admin_warehouse_save'
;
$this
->
assign
(
$hook_name
.
'_data'
,
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'warehouse_id'
=>
isset
(
$params
[
'id'
])
?
$params
[
'id'
]
:
0
,
'data'
=>
&
$data
,
'params'
=>
&
$params
,
]));
// 加载百度地图api
$this
->
assign
(
'is_load_baidu_map_api'
,
1
);
// 编辑器文件存放地址
$this
->
assign
(
'editor_path_type'
,
'warehouse'
);
// 数据
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
();
}
/**
* 文章添加/编辑
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
public
function
Save
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
=
$this
->
data_request
;
return
WarehouseService
::
WarehouseSave
(
$params
);
}
/**
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
public
function
Delete
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
=
$this
->
data_request
;
$params
[
'admin'
]
=
$this
->
admin
;
return
WarehouseService
::
WarehouseDelete
(
$params
);
}
/**
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
public
function
StatusUpdate
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始处理
$params
=
$this
->
data_request
;
$params
[
'admin'
]
=
$this
->
admin
;
return
WarehouseService
::
WarehouseStatusUpdate
(
$params
);
}
}
?>
\ No newline at end of file
application/admin/form/Warehouse.php
0 → 100644
浏览文件 @
a4b658c9
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
use
think\Db
;
use
app\service\WarehouseService
;
use
app\service\RegionService
;
/**
* 仓库动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
class
Warehouse
{
// 基础条件
public
$condition_base
=
[
[
'is_delete_time'
,
'='
,
0
],
];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-16
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'id'
,
'status_field'
=>
'is_enable'
,
'is_search'
=>
1
,
'search_url'
=>
MyUrl
(
'admin/warehouse/index'
),
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/warehouse/delete'
),
'delete_key'
=>
'ids'
,
'detail_title'
=>
'基础信息'
,
],
// 表单配置
'form'
=>
[
[
'view_type'
=>
'checkbox'
,
'is_checked'
=>
0
,
'checked_text'
=>
'反选'
,
'not_checked_text'
=>
'全选'
,
'align'
=>
'center'
,
'width'
=>
80
,
],
[
'label'
=>
'名称/别名'
,
'view_type'
=>
'module'
,
'view_key'
=>
'warehouse/module/info'
,
'grid_size'
=>
'sm'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'form_name'
=>
'name|alias'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'权重'
,
'view_type'
=>
'field'
,
'view_key'
=>
'level'
,
'search_config'
=>
[
'form_type'
=>
'section'
,
],
],
[
'label'
=>
'是否启用'
,
'view_type'
=>
'status'
,
'view_key'
=>
'is_enable'
,
'post_url'
=>
MyUrl
(
'admin/warehouse/statusupdate'
),
'is_form_su'
=>
1
,
'align'
=>
'center'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_is_enable_list'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'联系人'
,
'view_type'
=>
'field'
,
'view_key'
=>
'contacts_name'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'联系电话'
,
'view_type'
=>
'field'
,
'view_key'
=>
'contacts_tel'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'所在省'
,
'view_type'
=>
'field'
,
'view_key'
=>
'province_name'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'province'
,
'data'
=>
$this
->
RegionItems
(
'province'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'where_type'
=>
'in'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'所在市'
,
'view_type'
=>
'field'
,
'view_key'
=>
'city_name'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'city'
,
'data'
=>
$this
->
RegionItems
(
'city'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'where_type'
=>
'in'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'所在区/县'
,
'view_type'
=>
'field'
,
'view_key'
=>
'county_name'
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'county'
,
'data'
=>
$this
->
RegionItems
(
'county'
),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'where_type'
=>
'in'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'详细地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'address'
,
'grid_size'
=>
'sm'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
'经纬度'
,
'view_type'
=>
'module'
,
'view_key'
=>
'warehouse/module/position'
,
'grid_size'
=>
'sm'
,
],
[
'label'
=>
'创建时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'add_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'更新时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'upd_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'warehouse/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
/**
* 获取地区数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-08
* @desc description
* @param [string] $field [地区字段]
*/
public
function
RegionItems
(
$field
)
{
$result
=
[];
$ids
=
Db
::
name
(
'Warehouse'
)
->
where
(
$this
->
condition_base
)
->
column
(
$field
);
if
(
!
empty
(
$ids
))
{
$result
=
RegionService
::
RegionNode
([
'field'
=>
'id,name'
,
'where'
=>
[
'id'
=>
$ids
]]);
}
return
$result
;
}
}
?>
\ No newline at end of file
application/admin/view/default/admin/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/admin/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/admin/index')}}"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
管理员添加
{{else /}}
管理员编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
管理员{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/admin/index')}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/answer/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/answer/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/answer/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
问答添加
{{else /}}
问答编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
问答{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/answer/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-alert am-alert-secondary user-info"
data-am-alert
>
...
...
application/admin/view/default/appcenternav/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/appcenternav/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/appcenternav/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
用户中心导航添加
{{else /}}
用户中心导航编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
用户中心导航{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/appcenternav/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/apphomenav/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/apphomenav/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/apphomenav/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
导航添加
{{else /}}
导航编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
导航{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/apphomenav/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/article/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/article/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/article/index', $params)}}"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
文章添加
{{else /}}
文章编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
文章{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/article/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/brand/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/brand/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/brand/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
品牌添加
{{else /}}
品牌编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
品牌{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/brand/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/customview/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/customview/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/customview/index')}}"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
自定义页面添加
{{else /}}
自定义页面编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
自定义页面{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/customview/index')}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/goods/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/goods/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/goods/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
商品添加
{{else /}}
商品编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
商品{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/goods/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
...
...
application/admin/view/default/goodscomments/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,7 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/goodscomments/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/goodscomments/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
商品评论
编辑
</span>
<span
class=
"am-text-default"
>
商品评论
{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/goodscomments/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-alert am-alert-secondary goods-info"
data-am-alert
>
...
...
application/admin/view/default/lib/region_linkage.html
浏览文件 @
a4b658c9
<div
class=
"am-form-group region-linkage"
data-url=
"{{:MyUrl('admin/region/node')}}"
>
<label
class=
"block"
>
省市区
</label>
<label
class=
"block"
>
省市区
<
span
class=
"am-form-group-label-tips-must"
>
必选
</span><
/label>
<select
name=
"province"
data-next=
"city"
class=
"am-radius chosen-select"
data-placeholder=
"省份"
data-validation-message=
"请选择省份"
data-value=
"{{if isset($data['province'])}}{{$data.province}}{{else /}}0{{/if}}"
required
>
<option
value=
""
>
省份
</option>
</select>
...
...
application/admin/view/default/payment/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,7 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/payment/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/payment/index')}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
支付方式
编辑
</span>
<span
class=
"am-text-default"
>
支付方式
{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/payment/index')}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/public/module/detail.html
浏览文件 @
a4b658c9
...
...
@@ -180,4 +180,7 @@
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- footer end -->
<!-- page buttom -->
{{block name="form_page_bottom"}}{{/block}}
\ No newline at end of file
application/admin/view/default/public/module/form.html
浏览文件 @
a4b658c9
...
...
@@ -133,4 +133,7 @@
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- footer end -->
<!-- page buttom -->
{{block name="form_page_bottom"}}{{/block}}
\ No newline at end of file
application/admin/view/default/role/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/role/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/role/index')}}"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
角色添加
{{else /}}
角色编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
角色{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/role/index')}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/site/sitetype.html
浏览文件 @
a4b658c9
...
...
@@ -150,7 +150,7 @@
</div>
{{include file="lib/region_linkage" /}}
<div
class=
"am-form-group
address-detail
"
>
<div
class=
"am-form-group"
>
<label>
详细地址
</label>
<div
class=
"am-input-group am-input-group-sm"
>
<input
type=
"hidden"
name=
"lng"
id=
"form-lng"
/>
...
...
@@ -160,8 +160,8 @@
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-margin-top-xs"
></div>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-form-group"
></div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
确认
</button>
...
...
application/admin/view/default/slide/module/images.html
浏览文件 @
a4b658c9
<!--
商品基础
信息 -->
<!--
图片
信息 -->
{{if !empty($module_data)}}
<div
{{
if
!
empty
($
module_data
['
bg_color
'])}}
style=
"background-color:{{$module_data.bg_color}};"
{{/
if
}}
>
{{if !empty($module_data['images_url'])}}
...
...
application/admin/view/default/slide/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/slide/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/slide/index', $params)}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
轮播添加
{{else /}}
轮播编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
轮播{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/slide/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/user/save_info.html
浏览文件 @
a4b658c9
...
...
@@ -6,13 +6,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/user/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/user/index', $params)}}"
>
<legend>
<span
class=
"am-text-default"
>
{{if empty($data['id'])}}
成员添加
{{else /}}
成员编辑
{{/if}}
</span>
<span
class=
"am-text-default"
>
用户{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/user/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
...
...
application/admin/view/default/warehouse/detail.html
0 → 100644
浏览文件 @
a4b658c9
<!-- 继承公共的 form -->
{{extend name="public/module/detail" /}}
<!-- 重写数据模块 -->
{{block name="detail_data"}}
<!-- 父级内容 -->
{__block__}
<!-- 地图 -->
<div
class=
"am-panel am-panel-default"
>
<div
class=
"am-panel-hd"
>
地图
</div>
<div
class=
"am-panel-bd"
>
{{if !empty($data['lng']) and $data['lng'] gt 0 and !empty($data['lat']) and $data['lat']}}
<div
id=
"map"
data-level=
"17"
class=
"am-margin-top-xs"
></div>
{{else /}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
未配置
</div>
{{/if}}
</div>
</div>
{{/block}}
<!-- 底部内容重写 -->
{{block name="form_page_bottom"}}
<script
type=
"text/javascript"
>
$
(
function
()
{
// 百度地图初始化
MapInit
({{
if
!
empty
(
$data
[
'
lng
'
])}}{{
$data
[
'
lng
'
]}}{{
else
/}}116.400244{{/i
f
}},{{
if
!
empty
(
$data
[
'
lat
'
])}}{{
$data
[
'
lat
'
]}}{{
else
/}}39.92556{{/i
f
}},
null
,
null
,
false
);
});
</script>
{{/block}}
\ No newline at end of file
application/admin/view/default/warehouse/index.html
0 → 100644
浏览文件 @
a4b658c9
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
<a
href=
"{{:MyUrl('admin/warehouse/saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"
>
新增
</a>
<!-- 父级内容 -->
{__block__}
{{/block}}
\ No newline at end of file
application/admin/view/default/warehouse/module/info.html
0 → 100644
浏览文件 @
a4b658c9
<!-- 基础信息 -->
{{if !empty($module_data)}}
{{if !empty($module_data['name'])}}
<p>
{{$module_data.name}}{{if isset($module_data['is_default']) and $module_data['is_default'] eq 1}}
<span
class=
"am-badge am-badge-success am-round am-margin-left-xs"
>
默认
</span>
{{/if}}
</p>
{{/if}}
{{if !empty($module_data['alias'])}}
<p
class=
"am-badge am-badge-secondary am-radius"
>
{{$module_data.alias}}
</p>
{{/if}}
{{/if}}
\ No newline at end of file
application/admin/view/default/warehouse/module/operate.html
0 → 100644
浏览文件 @
a4b658c9
<!-- 操作栏 -->
<button
type=
"button"
class=
"am-btn am-btn-default am-btn-xs am-radius am-btn-block submit-popup"
data-url=
"{{:MyUrl('admin/warehouse/detail', ['id'=>$module_data['id']])}}"
>
<i
class=
"am-icon-eye"
></i>
<span>
详情
</span>
</button>
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/warehouse/saveinfo', array('id'=>$module_data['id']))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
<button
type=
"button"
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('admin/warehouse/delete')}}"
data-id=
"{{$module_data.id}}"
data-key=
"ids"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
\ No newline at end of file
application/admin/view/default/warehouse/module/position.html
0 → 100644
浏览文件 @
a4b658c9
<!-- 经纬度 -->
{{if !empty($module_data['lng']) and $module_data['lng'] gt 0}}
<p><span
class=
"am-badge am-radius"
>
经度
</span>
{{$module_data.lng}}
</p>
{{/if}}
{{if !empty($module_data['lat']) and $module_data['lat'] gt 0}}
<p
class=
"am-margin-top-xs"
><span
class=
"am-badge am-radius"
>
纬度
</span>
{{$module_data.lat}}
</p>
{{/if}}
\ No newline at end of file
application/admin/view/default/warehouse/save_info.html
0 → 100644
浏览文件 @
a4b658c9
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/warehouse/save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:MyUrl('admin/warehouse/index', $params)}}"
>
<legend>
<span
class=
"am-text-default"
>
仓库{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}
</span>
<a
href=
"{{:MyUrl('admin/warehouse/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
<label>
名称
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<input
type=
"text"
name=
"name"
placeholder=
"名称"
minlength=
"2"
maxlength=
"16"
data-validation-message=
"名称格式 2~16 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.name}}"
{{/
if
}}
required
/>
</div>
<div
class=
"am-form-group"
>
<label>
别名
<span
class=
"am-form-group-label-tips"
>
选填
</span></label>
<input
type=
"text"
name=
"alias"
placeholder=
"别名"
minlength=
"0"
maxlength=
"16"
data-validation-message=
"别名格式最多 16 个字符"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.alias}}"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label>
权重
<span
class=
"am-form-group-label-tips"
>
选填
</span></label>
<input
type=
"number"
name=
"level"
placeholder=
"权重"
minlength=
"0"
maxlength=
"16"
data-validation-message=
"请输入有效权重数值"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.level}}"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label>
联系人
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<input
type=
"text"
name=
"contacts_name"
placeholder=
"联系人"
minlength=
"2"
maxlength=
"16"
data-validation-message=
"联系人格式 2~16 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.contacts_name}}"
{{/
if
}}
required
/>
</div>
<div
class=
"am-form-group"
>
<label>
联系电话
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<input
type=
"text"
name=
"contacts_tel"
placeholder=
"电话"
minlength=
"6"
maxlength=
"30"
data-validation-message=
"电话格式有误"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.contacts_tel}}"
{{/
if
}}
required
/>
</div>
{{include file="lib/region_linkage" /}}
<div
class=
"am-form-group"
>
<label>
详细地址
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<div
class=
"am-input-group am-input-group-sm"
>
<input
type=
"hidden"
name=
"lng"
id=
"form-lng"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lng}}"
{{/
if
}}
/>
<input
type=
"hidden"
name=
"lat"
id=
"form-lat"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lat}}"
{{/
if
}}
/>
<input
type=
"text"
name=
"address"
id=
"form-address"
placeholder=
"详细地址"
minlength=
"2"
maxlength=
"80"
data-validation-message=
"详细地址格式 1~80 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.address}}"
{{/
if
}}
required
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-margin-top-xs"
></div>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
是否默认
</label>
<input
name=
"is_default"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"49"
data-am-switch
{{
if
isset
($
data
['
is_default
'])
and
$
data
['
is_default
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
是否启用
</label>
<input
name=
"is_enable"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"49"
data-am-switch
{{
if
isset
($
data
['
is_enable
'])
and
$
data
['
is_enable
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
)}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
<script
type=
"text/javascript"
>
$
(
function
()
{
// 百度地图初始化
MapInit
({{
if
!
empty
(
$data
[
'
lng
'
])}}{{
$data
[
'
lng
'
]}}{{
else
/}}116.400244{{/i
f
}},{{
if
!
empty
(
$data
[
'
lat
'
])}}{{
$data
[
'
lat
'
]}}{{
else
/}}39.92556{{/i
f
}});
});
</script>
\ No newline at end of file
application/index/controller/Useraddress.php
浏览文件 @
a4b658c9
...
...
@@ -69,15 +69,18 @@ class UserAddress extends Common
$this
->
assign
(
'is_header'
,
0
);
$this
->
assign
(
'is_footer'
,
0
);
if
(
input
())
$data
=
[];
if
(
!
empty
(
$this
->
data_request
))
{
$params
=
input
()
;
$params
=
$this
->
data_request
;
$params
[
'user'
]
=
$this
->
user
;
$data
=
UserService
::
UserAddressRow
(
$params
);
$this
->
assign
(
'data'
,
$data
[
'data'
]);
}
else
{
$this
->
assign
(
'data'
,
[]);
$ret
=
UserService
::
UserAddressRow
(
$params
);
$data
=
$ret
[
'data'
];
}
// 加载百度地图api
$this
->
assign
(
'is_load_baidu_map_api'
,
1
);
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
();
}
...
...
application/index/view/default/answer/index.html
浏览文件 @
a4b658c9
...
...
@@ -19,20 +19,16 @@
<div
class=
"am-popup-bd"
>
<form
class=
"am-form form-validation-plugins-answer-ask view-save"
action=
"{{:MyUrl('index/answer/save')}}"
method=
"POST"
request-type=
"ajax-reload"
>
<div
class=
"am-form-group"
>
<label>
昵称
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<label>
昵称
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<input
type=
"text"
name=
"name"
placeholder=
"昵称"
minlength=
"1"
maxlength=
"30"
data-validation-message=
"昵称格式 1~30 个字符之间"
class=
"am-radius"
required
/></div>
<div
class=
"am-form-group"
>
<label>
电话
<span
class=
"am-form-group-label-tips"
>
选填
</span></label>
<label>
电话
<span
class=
"am-form-group-label-tips"
>
选填
</span></label>
<input
type=
"text"
name=
"tel"
placeholder=
"电话"
data-validation-message=
"请填写电话"
class=
"am-radius"
/></div>
<div
class=
"am-form-group"
>
<label>
标题
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<label>
标题
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<input
type=
"text"
name=
"title"
placeholder=
"标题"
minlength=
"1"
maxlength=
"60"
data-validation-message=
"标题格式 1~60 个字符之间"
class=
"am-radius"
required
/></div>
<div
class=
"am-form-group"
>
<label>
内容
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<label>
内容
<span
class=
"am-form-group-label-tips-must"
>
必填
</span></label>
<textarea
class=
"am-radius am-validate"
name=
"content"
rows=
"5"
minlength=
"5"
maxlength=
"1000"
placeholder=
"内容至少5个字"
data-validation-message=
"内容格式 5~1000 个字符之间"
required
></textarea>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
...
...
application/index/view/default/lib/region_linkage.html
浏览文件 @
a4b658c9
<div
class=
"am-form-group region-linkage"
data-url=
"{{:MyUrl('index/region/index')}}"
>
<label
class=
"block"
>
省市区
</label>
<label
class=
"block"
>
省市区
<
span
class=
"am-form-group-label-tips-must"
>
必选
</span><
/label>
<select
name=
"province"
data-next=
"city"
class=
"am-radius chosen-select"
data-placeholder=
"省份"
data-validation-message=
"请选择省份"
data-value=
"{{if isset($data['province'])}}{{$data.province}}{{else /}}0{{/if}}"
required
>
<option
value=
""
>
省份
</option>
</select>
...
...
application/index/view/default/public/module/detail.html
浏览文件 @
a4b658c9
...
...
@@ -180,4 +180,7 @@
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- footer end -->
<!-- page buttom -->
{{block name="form_page_bottom"}}{{/block}}
\ No newline at end of file
application/index/view/default/public/module/form.html
浏览文件 @
a4b658c9
...
...
@@ -146,4 +146,7 @@
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
<!-- footer end -->
<!-- page buttom -->
{{block name="form_page_bottom"}}{{/block}}
\ No newline at end of file
application/index/view/default/useraddress/save_info.html
浏览文件 @
a4b658c9
{{include file="public/header" /}}
<!-- conntent start -->
<div
class=
"am-g
my-content
"
>
<div
class=
"am-g
am-padding-sm
"
>
<!-- form start -->
<form
class=
"am-form form-validation"
method=
"post"
action=
"{{:MyUrl('index/useraddress/save')}}"
request-type=
"ajax-fun"
request-value=
"ViewModalBack"
>
<div
class=
"am-form-group"
>
...
...
@@ -16,17 +16,17 @@
{{include file="lib/region_linkage" /}}
<div
class=
"am-form-group"
>
<label>
详细地址
</label>
<input
type=
"text"
name=
"address"
id=
"form-address"
placeholder=
"详细地址"
minlength=
"2"
maxlength=
"80"
data-validation-message=
"详细地址格式 1~80 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.address}}"
{{/
if
}}
required
/>
<!-- <div class="am-form-group am-input-group am-input-group-sm">
<div
class=
"am-input-group am-input-group-sm"
>
<input
type=
"hidden"
name=
"lng"
id=
"form-lng"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lng}}"
{{/
if
}}
/>
<input
type=
"hidden"
name=
"lat"
id=
"form-lat"
{{
if
!
empty
($
data
)}}
value=
"{{$data.lat}}"
{{/
if
}}
/>
<input
type=
"text"
name=
"address"
id=
"form-address"
placeholder=
"详细地址"
minlength=
"2"
maxlength=
"80"
data-validation-message=
"详细地址格式 1~80 个字符之间"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.address}}"
{{/
if
}}
required
/>
<span
class=
"am-input-group-btn"
>
<button
class=
"am-btn am-btn-default am-radius"
type=
"button"
id=
"map-location-submit"
><span
class=
"am-icon-map-marker"
></span>
定位
</button>
</span>
</div> -->
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-margin-top-xs"
></div>
</div>
<!-- <div id="map" data-level="17" class="am-form-group"></div> -->
<div
class=
"am-form-group"
>
<label>
别名
</label>
...
...
@@ -37,7 +37,7 @@
<input
name=
"is_default"
value=
"1"
type=
"checkbox"
data-off-text=
"否"
data-on-text=
"是"
data-size=
"xs"
data-on-color=
"success"
data-off-color=
"default"
data-handle-width=
"49"
data-am-switch
{{
if
isset
($
data
['
is_default
'])
and
$
data
['
is_default
']
eq
1}}
checked=
"true"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group
am-form-group-refreshing
"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
)}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
...
...
@@ -53,8 +53,8 @@
<script
type=
"text/javascript"
>
$
(
function
()
{
//
//
百度地图初始化
//
MapInit({{if !empty($data['lng'])}}{{$data['lng']}}{{else /}}116.400244{{/if}},{{if !empty($data['lat'])}}{{$data['lat']}}{{else /}}39.92556{{/if}});
// 百度地图初始化
MapInit
({{
if
!
empty
(
$data
[
'
lng
'
])}}{{
$data
[
'
lng
'
]}}{{
else
/}}116.400244{{/i
f
}},{{
if
!
empty
(
$data
[
'
lat
'
])}}{{
$data
[
'
lat
'
]}}{{
else
/}}39.92556{{/i
f
}});
});
// 返回处理
...
...
application/service/ArticleService.php
浏览文件 @
a4b658c9
...
...
@@ -36,14 +36,14 @@ class ArticleService
{
$where
=
empty
(
$params
[
'where'
])
?
[]
:
$params
[
'where'
];
$field
=
empty
(
$params
[
'field'
])
?
'*'
:
$params
[
'field'
];
$order_by
=
empty
(
$params
[
'order_by'
])
?
'id desc'
:
trim
(
$params
[
'order_by'
]);
$m
=
isset
(
$params
[
'm'
])
?
intval
(
$params
[
'm'
])
:
0
;
$n
=
isset
(
$params
[
'n'
])
?
intval
(
$params
[
'n'
])
:
10
;
$data
=
Db
::
name
(
'Article'
)
->
field
(
$field
)
->
where
(
$where
)
->
order
(
'id desc'
)
->
limit
(
$m
,
$n
)
->
select
();
$data
=
Db
::
name
(
'Article'
)
->
field
(
$field
)
->
where
(
$where
)
->
order
(
$order_by
)
->
limit
(
$m
,
$n
)
->
select
();
if
(
!
empty
(
$data
))
{
$names
=
Db
::
name
(
'ArticleCategory'
)
->
where
([
'id'
=>
array_column
(
$data
,
'article_category_id'
)])
->
column
(
'name'
,
'id'
);
$common_is_enable_tips
=
lang
(
'common_is_enable_tips'
);
$category_names
=
Db
::
name
(
'ArticleCategory'
)
->
where
([
'id'
=>
array_column
(
$data
,
'article_category_id'
)])
->
column
(
'name'
,
'id'
);
foreach
(
$data
as
&
$v
)
{
// url
...
...
@@ -52,7 +52,7 @@ class ArticleService
// 分类名称
if
(
isset
(
$v
[
'article_category_id'
]))
{
$v
[
'article_category_name'
]
=
isset
(
$
names
[
$v
[
'article_category_id'
]])
?
$
names
[
$v
[
'article_category_id'
]]
:
''
;
$v
[
'article_category_name'
]
=
isset
(
$
category_names
[
$v
[
'article_category_id'
]])
?
$category_
names
[
$v
[
'article_category_id'
]]
:
''
;
}
// 内容
...
...
application/service/RegionService.php
浏览文件 @
a4b658c9
...
...
@@ -61,11 +61,14 @@ class RegionService
*/
public
static
function
RegionNode
(
$params
=
[])
{
// 数据参数
$field
=
empty
(
$params
[
'field'
])
?
'id,name,level,letters'
:
$params
[
'field'
];
$where
=
empty
(
$params
[
'where'
])
?
[]
:
$params
[
'where'
];
$
where
[
'is_enable'
]
=
1
;
$
order_by
=
empty
(
$params
[
'order_by'
])
?
'sort asc,id asc'
:
trim
(
$params
[
'order_by'
])
;
return
Db
::
name
(
'Region'
)
->
where
(
$where
)
->
field
(
$field
)
->
order
(
'sort asc,id asc'
)
->
select
();
// 基础条件
$where
[
'is_enable'
]
=
1
;
return
Db
::
name
(
'Region'
)
->
where
(
$where
)
->
field
(
$field
)
->
order
(
$order_by
)
->
select
();
}
/**
...
...
application/service/WarehouseService.php
0 → 100644
浏览文件 @
a4b658c9
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\service
;
use
think\Db
;
use
think\facade\Hook
;
use
app\service\RegionService
;
/**
* 仓库服务层
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
*/
class
WarehouseService
{
/**
* 数据列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
WarehouseList
(
$params
=
[])
{
$where
=
empty
(
$params
[
'where'
])
?
[]
:
$params
[
'where'
];
$field
=
empty
(
$params
[
'field'
])
?
'*'
:
$params
[
'field'
];
$order_by
=
empty
(
$params
[
'order_by'
])
?
'level desc, id desc'
:
trim
(
$params
[
'order_by'
]);
$data
=
Db
::
name
(
'Warehouse'
)
->
field
(
$field
)
->
where
(
$where
)
->
order
(
$order_by
)
->
select
();
if
(
!
empty
(
$data
))
{
// 地区数据
$ids
=
array_unique
(
array_merge
(
array_column
(
$data
,
'province'
),
array_column
(
$data
,
'city'
),
array_column
(
$data
,
'county'
)));
$region
=
Db
::
name
(
'Region'
)
->
where
([
'id'
=>
$ids
])
->
column
(
'name'
,
'id'
);
// 循环处理数据
foreach
(
$data
as
&
$v
)
{
// 地区
if
(
isset
(
$v
[
'province'
]))
{
$v
[
'province_name'
]
=
isset
(
$region
[
$v
[
'province'
]])
?
$region
[
$v
[
'province'
]]
:
''
;
}
if
(
isset
(
$v
[
'city'
]))
{
$v
[
'city_name'
]
=
isset
(
$region
[
$v
[
'city'
]])
?
$region
[
$v
[
'city'
]]
:
''
;
}
if
(
isset
(
$v
[
'county'
]))
{
$v
[
'county_name'
]
=
isset
(
$region
[
$v
[
'county'
]])
?
$region
[
$v
[
'county'
]]
:
''
;
}
// 时间
if
(
isset
(
$v
[
'add_time'
]))
{
$v
[
'add_time'
]
=
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
}
if
(
isset
(
$v
[
'upd_time'
]))
{
$v
[
'upd_time'
]
=
empty
(
$v
[
'upd_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'upd_time'
]);
}
}
}
return
DataReturn
(
'success'
,
0
,
$data
);
}
/**
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
WarehouseSave
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'name'
,
'error_msg'
=>
'名称不能为空'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'contacts_name'
,
'error_msg'
=>
'联系人不能为空'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'contacts_tel'
,
'error_msg'
=>
'联系电话不能为空'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'province'
,
'error_msg'
=>
'省不能为空'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'city'
,
'error_msg'
=>
'城市不能为空'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'county'
,
'error_msg'
=>
'区/县不能为空'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'address'
,
'error_msg'
=>
'详细地址不能为空'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 操作数据
$is_default
=
isset
(
$params
[
'is_default'
])
?
intval
(
$params
[
'is_default'
])
:
0
;
$data
=
[
'name'
=>
$params
[
'name'
],
'alias'
=>
empty
(
$params
[
'alias'
])
?
''
:
trim
(
$params
[
'alias'
]),
'level'
=>
isset
(
$params
[
'level'
])
?
intval
(
$params
[
'level'
])
:
0
,
'contacts_name'
=>
$params
[
'contacts_name'
],
'contacts_tel'
=>
$params
[
'contacts_tel'
],
'province'
=>
$params
[
'province'
],
'city'
=>
$params
[
'city'
],
'county'
=>
$params
[
'county'
],
'address'
=>
$params
[
'address'
],
'lng'
=>
isset
(
$params
[
'lng'
])
?
floatval
(
$params
[
'lng'
])
:
0
,
'lat'
=>
isset
(
$params
[
'lat'
])
?
floatval
(
$params
[
'lat'
])
:
0
,
'is_default'
=>
$is_default
,
];
Db
::
startTrans
();
// 默认地址处理
if
(
$is_default
==
1
)
{
Db
::
name
(
'Warehouse'
)
->
where
([
'is_default'
=>
1
])
->
update
([
'is_default'
=>
0
]);
}
// 添加/更新数据
if
(
empty
(
$params
[
'id'
]))
{
$data
[
'add_time'
]
=
time
();
if
(
Db
::
name
(
'Warehouse'
)
->
insertGetId
(
$data
)
>
0
)
{
Db
::
commit
();
return
DataReturn
(
'新增成功'
,
0
);
}
else
{
Db
::
rollback
();
return
DataReturn
(
'新增失败'
);
}
}
else
{
$data
[
'upd_time'
]
=
time
();
if
(
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
(
$data
))
{
Db
::
commit
();
return
DataReturn
(
'更新成功'
,
0
);
}
else
{
Db
::
rollback
();
return
DataReturn
(
'更新失败'
);
}
}
}
/**
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
WarehouseDelete
(
$params
=
[])
{
// 参数是否有误
if
(
empty
(
$params
[
'ids'
]))
{
return
DataReturn
(
'商品id有误'
,
-
1
);
}
// 是否数组
if
(
!
is_array
(
$params
[
'ids'
]))
{
$params
[
'ids'
]
=
explode
(
','
,
$params
[
'ids'
]);
}
// 删除操作
if
(
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
$params
[
'ids'
]])
->
delete
())
{
return
DataReturn
(
'删除成功'
);
}
return
DataReturn
(
'删除失败'
,
-
100
);
}
/**
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-07
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
WarehouseStatusUpdate
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'field'
,
'error_msg'
=>
'操作字段有误'
,
],
[
'checked_type'
=>
'in'
,
'key_name'
=>
'state'
,
'checked_data'
=>
[
0
,
1
],
'error_msg'
=>
'状态有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 数据更新
if
(
Db
::
name
(
'Warehouse'
)
->
where
([
'id'
=>
intval
(
$params
[
'id'
])])
->
update
([
$params
[
'field'
]
=>
intval
(
$params
[
'state'
]),
'upd_time'
=>
time
()]))
{
return
DataReturn
(
'编辑成功'
);
}
return
DataReturn
(
'编辑失败'
,
-
100
);
}
}
?>
\ No newline at end of file
config/shopxo.sql
浏览文件 @
a4b658c9
此差异已折叠。
点击以展开。
public/static/admin/default/css/site.css
浏览文件 @
a4b658c9
...
...
@@ -29,25 +29,6 @@ ul.home_site_user_register_bg_images-images-view li {
/**
* 地址添加/编辑
*/
.region-linkage
.chosen-select
{
display
:
-webkit-inline-box
;
width
:
calc
(
33.3%
-
3px
)
!important
;
}
.region-linkage
.chosen-select
.chosen-single
{
width
:
100%
;
}
.address-detail
{
margin-bottom
:
0
;
}
#map
{
width
:
calc
(
100%
-
10px
);
height
:
250px
;
padding
:
0
!important
;
margin
:
0
5px
20px
5px
;
}
.address-detail
,
#map
{
border-bottom
:
0
!important
;
}
.address-list
.edit-submit
,
.address-list
.delete-submit
{
cursor
:
pointer
;
...
...
public/static/common/css/common.css
浏览文件 @
a4b658c9
...
...
@@ -569,4 +569,23 @@ button.colorpicker-submit img {
.form-table-operate-radio
.am-radio
,
.form-table-operate-checkbox
.am-checkbox
{
margin-top
:
0
;
}
/**
* 公共联动地区组件样式
*/
.region-linkage
.chosen-select
{
display
:
-webkit-inline-box
;
width
:
calc
(
33.3%
-
3px
)
!important
;
}
.region-linkage
.chosen-select
.chosen-single
{
width
:
100%
;
}
/**
* 默认地图宽高
*/
#map
{
width
:
100%
;
height
:
250px
;
}
\ No newline at end of file
public/static/index/default/css/useraddress.css
浏览文件 @
a4b658c9
...
...
@@ -99,18 +99,4 @@ ul.address-list li .user-base {
*/
.my-content
{
padding
:
15px
10px
;
}
.region-linkage
.chosen-select
{
display
:
-webkit-inline-box
;
width
:
calc
(
33.3%
-
3px
)
!important
;
}
.region-linkage
.chosen-select
.chosen-single
{
width
:
100%
;
}
#map
{
width
:
100%
;
height
:
250px
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录