运费设置应用
parent
dbab7d3282
commit
4c932eab13
|
|
@ -0,0 +1,85 @@
|
|||
<?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\plugins\freightfee;
|
||||
|
||||
use think\Controller;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 运费设置 - 管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('freightfee');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/freightfee/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
$ret = PluginsService::PluginsData('freightfee');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
0 => array('id' => 0, 'name' => '按件数', 'checked' => true),
|
||||
1 => array('id' => 1, 'name' => '按重量'),
|
||||
];
|
||||
|
||||
$this->assign('is_whether_list', $is_whether_list);
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/freightfee/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-02-07T08:21:54+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
{
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'freightfee', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
namespace app\plugins\freightfee;
|
||||
|
||||
use think\Controller;
|
||||
|
||||
/**
|
||||
* 运费设置 - 钩子入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Hook extends Controller
|
||||
{
|
||||
// 应用响应入口
|
||||
public function run($params = [])
|
||||
{
|
||||
// 是否控制器钩子
|
||||
// is_backend 当前为后端业务处理
|
||||
// hook_name 钩子名称
|
||||
if(isset($params['is_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
// 参数一 描述
|
||||
// 参数二 0 为处理成功, 负数为失败
|
||||
// 参数三 返回数据
|
||||
return DataReturn('返回描述', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} else {
|
||||
return 'hello world!';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"base":{
|
||||
"plugins":"freightfee",
|
||||
"name":"运费设置",
|
||||
"logo":"\/static\/upload\/images\/plugins_freightfee\/2019\/03\/18\/1552894366387964.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"快递运费设置",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5",
|
||||
"app",
|
||||
"alipay",
|
||||
"weixin",
|
||||
"baidu"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.4.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<legend>
|
||||
<span class="fs-16">运费设置</span>
|
||||
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="freightfee-content">
|
||||
<div class="items">
|
||||
<label>应用导航名称</label>
|
||||
<div>
|
||||
{{if !empty($data['application_name'])}}
|
||||
{{$data.application_name}}
|
||||
{{else /}}
|
||||
无
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>登录入口名称</label>
|
||||
<div>
|
||||
{{if !empty($data['login_name'])}}
|
||||
{{$data.login_name}}
|
||||
{{else /}}
|
||||
游客登录
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>游客用户名</label>
|
||||
<div>
|
||||
{{if !empty($data['nickname'])}}
|
||||
{{$data.nickname}}
|
||||
{{else /}}
|
||||
游客
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="items">
|
||||
<label>订单查询提示</label>
|
||||
<div>
|
||||
{{if !empty($data['query_tips'])}}
|
||||
{{$data.query_tips}}
|
||||
{{else /}}
|
||||
无
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>默认游客登录</label>
|
||||
<div>
|
||||
{{if isset($data['is_default_tourist']) and $data['is_default_tourist'] eq 1}}
|
||||
是
|
||||
{{else /}}
|
||||
否
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items">
|
||||
<label>订单查询地址</label>
|
||||
<div>
|
||||
<a href="{{:PluginsHomeUrl('freightfee', 'index', 'index')}}" target="_blank">{{:PluginsHomeUrl('freightfee', 'index', 'index')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{:PluginsAdminUrl('freightfee', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
{{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="{{:PluginsAdminUrl('freightfee', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('freightfee', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">运费设置</span>
|
||||
<a href="{{:PluginsAdminUrl('freightfee', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||
</legend>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>计价方式</label>
|
||||
<div>
|
||||
{{foreach $is_whether_list as $v}}
|
||||
<label class="am-radio-inline m-r-10">
|
||||
<input type="radio" name="valuation" value="{{$v.id}}" {{if isset($data['valuation']) and $data['valuation'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['valuation']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="freightfee-rules">
|
||||
<table class="am-table am-table-striped am-table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>运送到</th>
|
||||
<th>首件数(件)</th>
|
||||
<th>首费(元)</th>
|
||||
<th>续件数(件)</th>
|
||||
<th>续费(元)</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Amaze UI</td>
|
||||
<td>http://amazeui.org</td>
|
||||
<td>2012-10-01</td></tr>
|
||||
<tr>
|
||||
<td>Amaze UI</td>
|
||||
<td>http://amazeui.org</td>
|
||||
<td>2012-10-01</td></tr>
|
||||
<tr>
|
||||
<td>Amaze UI</td>
|
||||
<td>http://amazeui.org</td>
|
||||
<td>2012-10-01</td></tr>
|
||||
<tr>
|
||||
<td>Amaze UI</td>
|
||||
<td>http://amazeui.org</td>
|
||||
<td>2012-10-01</td></tr>
|
||||
<tr>
|
||||
<td>Amaze UI</td>
|
||||
<td>http://amazeui.org</td>
|
||||
<td>2012-10-01</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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 w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* 首页
|
||||
*/
|
||||
.freightfee-content .items {
|
||||
margin: 10px 0 20px 0;
|
||||
border-bottom: 1px dashed #f1f1f1;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.freightfee-content .edit-submit {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Loading…
Reference in New Issue