mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改配送区域管理
This commit is contained in:
parent
6f6c946b2d
commit
be73c6a7d6
@ -1,45 +0,0 @@
|
|||||||
<?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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -35,6 +35,20 @@ class ShopTruckTemplate extends Controller
|
|||||||
$query->where(['deleted' => 0])->order('sort desc,id desc')->page();
|
$query->where(['deleted' => 0])->order('sort desc,id desc')->page();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配送区域管理
|
||||||
|
* @auth true
|
||||||
|
* @menu true
|
||||||
|
*/
|
||||||
|
public function region()
|
||||||
|
{
|
||||||
|
if ($this->request->isGet()) {
|
||||||
|
$this->title = '配送区域管理';
|
||||||
|
$this->citys = TruckService::instance()->region(3);
|
||||||
|
$this->fetch('form_region');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加配送邮费模板
|
* 添加配送邮费模板
|
||||||
* @auth true
|
* @auth true
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-header"><b class="color-green">{{province.name}}</b> 可选区域</div>
|
<div class="layui-card-header"><b class="color-green">{{province.name}}</b> 可选区域</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<a ng-repeat="x in province.sub" ng-bind="x.name" ng-click="SetActiveCity(x)"
|
<a ng-repeat="x in province.subs" 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"
|
class="layui-btn layui-btn-radius layui-btn-normal margin-left-0 margin-right-5 margin-bottom-5"
|
||||||
></a>
|
></a>
|
||||||
</div>
|
</div>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-header"><b class="color-green">{{city.name}}</b> 可选区域</div>
|
<div class="layui-card-header"><b class="color-green">{{city.name}}</b> 可选区域</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<a ng-repeat="x in city.sub" ng-bind="x.name"
|
<a ng-repeat="x in city.subs" ng-bind="x.name"
|
||||||
class="layui-btn layui-btn-radius layui-btn-normal margin-left-0 margin-right-5 margin-bottom-5"
|
class="layui-btn layui-btn-radius layui-btn-normal margin-left-0 margin-right-5 margin-bottom-5"
|
||||||
></a>
|
></a>
|
||||||
</div>
|
</div>
|
||||||
@ -35,20 +35,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="layui-hide">
|
<label class="layui-hide">
|
||||||
<textarea class="layui-textarea" id="RegionData">{$list|json_encode|raw}</textarea>
|
<textarea class="layui-textarea" id="RegionData">{$citys|json_encode|raw}</textarea>
|
||||||
</label>
|
</label>
|
||||||
<script>
|
<script>
|
||||||
require(['angular'], function () {
|
require(['angular'], function () {
|
||||||
var app = angular.module("TruckForm", []).run(callback);
|
var app = angular.module("TruckForm", []).run(callback);
|
||||||
var _data = document.getElementById('RegionData').value || '[]';
|
var _data = document.getElementById('RegionData').value || '[]';
|
||||||
|
console.log(_data)
|
||||||
angular.bootstrap(document.getElementById(app.name), [app.name]);
|
angular.bootstrap(document.getElementById(app.name), [app.name]);
|
||||||
|
|
||||||
function callback($rootScope) {
|
function callback($rootScope) {
|
||||||
$rootScope.items = angular.fromJson(_data);
|
$rootScope.items = angular.fromJson(_data);
|
||||||
$rootScope.province = $rootScope.items[0];
|
$rootScope.province = $rootScope.items[0];
|
||||||
$rootScope.city = $rootScope.province.sub[0];
|
$rootScope.city = $rootScope.province.subs[0];
|
||||||
$rootScope.SetActiveProvince = function (province) {
|
$rootScope.SetActiveProvince = function (province) {
|
||||||
$rootScope.city = province.sub[0];
|
$rootScope.city = province.subs[0];
|
||||||
$rootScope.province = province;
|
$rootScope.province = province;
|
||||||
};
|
};
|
||||||
$rootScope.SetActiveCity = function (city) {
|
$rootScope.SetActiveCity = function (city) {
|
Loading…
x
Reference in New Issue
Block a user