mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-24 02:16:14 +08:00
添加配送区域管理
This commit is contained in:
parent
bf7e7e652a
commit
6f6c946b2d
45
app/data/controller/ShopTruckRegion.php
Normal file
45
app/data/controller/ShopTruckRegion.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace app\data\controller;
|
||||
|
||||
use think\admin\Controller;
|
||||
use think\admin\extend\DataExtend;
|
||||
|
||||
/**
|
||||
* 快递配送区域管理
|
||||
* Class ShopTruckRegion
|
||||
* @package app\data\controller
|
||||
*/
|
||||
class ShopTruckRegion extends Controller
|
||||
{
|
||||
/**
|
||||
* 绑定数据表
|
||||
* @var string
|
||||
*/
|
||||
private $table = 'ShopTruckRegion';
|
||||
|
||||
/**
|
||||
* 配送区域管理
|
||||
* @auth true
|
||||
* @menu true
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->title = '配送区域管理';
|
||||
$query = $this->_query($this->table);
|
||||
$query->field('id,pid,name')->page(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据列表处理
|
||||
* @param $data
|
||||
*/
|
||||
protected function _page_filter(&$data)
|
||||
{
|
||||
$data = DataExtend::arr2tree($data);
|
||||
}
|
||||
|
||||
}
|
@ -19,9 +19,6 @@
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-badge think-bg-red padding-5 padding-left-10 font-s15 layui-anim layui-anim-upbit">
|
||||
注意:快递公司配置不能随意修改或删除,会影响到物流路径查询!如需添加新快递请联系客服!
|
||||
</div>
|
||||
<div class="layui-tab layui-tab-card think-bg-white">
|
||||
<ul class="layui-tab-title">
|
||||
{foreach ['index'=>'快递公司','recycle'=>'回 收 站'] as $k=>$v}
|
||||
|
60
app/data/view/shop_truck_region/index.html
Normal file
60
app/data/view/shop_truck_region/index.html
Normal file
@ -0,0 +1,60 @@
|
||||
{extend name="../../admin/view/main"}
|
||||
|
||||
{block name="content"}
|
||||
<div class="think-box-shadow" id="TruckForm">
|
||||
<div class="padding-40">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">配送区域</div>
|
||||
<div class="layui-card-body layui-clear">
|
||||
<a ng-repeat="x in items" ng-bind="x.name" ng-click="SetActiveProvince(x)"
|
||||
class="layui-btn layui-btn-radius layui-btn-normal margin-left-0 margin-right-5 margin-bottom-5"
|
||||
></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header"><b class="color-green">{{province.name}}</b> 可选区域</div>
|
||||
<div class="layui-card-body">
|
||||
<a ng-repeat="x in province.sub" ng-bind="x.name" ng-click="SetActiveCity(x)"
|
||||
class="layui-btn layui-btn-radius layui-btn-normal margin-left-0 margin-right-5 margin-bottom-5"
|
||||
></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header"><b class="color-green">{{city.name}}</b> 可选区域</div>
|
||||
<div class="layui-card-body">
|
||||
<a ng-repeat="x in city.sub" ng-bind="x.name"
|
||||
class="layui-btn layui-btn-radius layui-btn-normal margin-left-0 margin-right-5 margin-bottom-5"
|
||||
></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<button class="layui-btn" ng-click="SetRuleItem()">确定修改</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="layui-hide">
|
||||
<textarea class="layui-textarea" id="RegionData">{$list|json_encode|raw}</textarea>
|
||||
</label>
|
||||
<script>
|
||||
require(['angular'], function () {
|
||||
var app = angular.module("TruckForm", []).run(callback);
|
||||
var _data = document.getElementById('RegionData').value || '[]';
|
||||
angular.bootstrap(document.getElementById(app.name), [app.name]);
|
||||
|
||||
function callback($rootScope) {
|
||||
$rootScope.items = angular.fromJson(_data);
|
||||
$rootScope.province = $rootScope.items[0];
|
||||
$rootScope.city = $rootScope.province.sub[0];
|
||||
$rootScope.SetActiveProvince = function (province) {
|
||||
$rootScope.city = province.sub[0];
|
||||
$rootScope.province = province;
|
||||
};
|
||||
$rootScope.SetActiveCity = function (city) {
|
||||
$rootScope.city = city;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
@ -8,9 +8,6 @@
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-badge think-bg-red padding-5 padding-left-10 font-s15 layui-anim layui-anim-upbit">
|
||||
注意:快递公司配置不能随意修改或删除,会影响到物流路径查询!如需添加新快递请联系客服!
|
||||
</div>
|
||||
<div class="layui-tab layui-tab-card think-bg-white">
|
||||
<div class="layui-tab-content think-box-shadow">
|
||||
{include file='shop_truck_company/index_search'}
|
||||
|
Loading…
x
Reference in New Issue
Block a user