wupengfei 2 年之前
父节点
当前提交
cf84264ffa

二进制
1.3.4.20220530 (2).zip


+ 1 - 0
addons/kdniao/.addonrc

@@ -0,0 +1 @@
+{"files":[],"license":"regular","licenseto":"52871","licensekey":"EqiwP4eGSLaxtWk1 ol2Syo85DLskJU4aXSyHFw==","domains":["hdlkeji.com"],"licensecodes":[],"validations":["629b583abe0e6955e04ae79d8a2c42db"]}

+ 54 - 0
addons/kdniao/Kdniao.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace addons\kdniao;
+
+use app\common\library\Menu;
+use think\Addons;
+
+/**
+ * 插件
+ */
+class Kdniao extends Addons
+{
+
+    /**
+     * 插件安装方法
+     * @return bool
+     */
+    public function install()
+    {
+
+        return true;
+    }
+
+    /**
+     * 插件卸载方法
+     * @return bool
+     */
+    public function uninstall()
+    {
+
+        return true;
+    }
+
+    /**
+     * 插件启用方法
+     * @return bool
+     */
+    public function enable()
+    {
+        Menu::enable('kdniao');
+        return true;
+    }
+
+    /**
+     * 插件禁用方法
+     * @return bool
+     */
+    public function disable()
+    {
+        Menu::disable('kdniao');
+        return true;
+    }
+
+}

+ 23 - 0
addons/kdniao/bootstrap.js

@@ -0,0 +1,23 @@
+if ($('.kdniao').length > 0) {
+
+    $('.kdniao').each(function () {
+        var code = $(this).data('code');
+
+        $(this).addClass('btn btn-xs bg-success').append('<i class="fa fa-truck"></i>' + code);
+    });
+
+    $('.kdniao').click(function () {
+        var company = $(this).data('company');
+        var code = $(this).data('code');
+
+        if (company && code) {
+            Layer.open({
+                type: 2,
+                area: ['700px', '450px'],
+                fixed: false, //不固定
+                maxmin: true,
+                content: '/addons/kdniao/index/query?company=' + company + '&code=' + code
+            });
+        }
+    });
+}

+ 46 - 0
addons/kdniao/config.php

@@ -0,0 +1,46 @@
+<?php
+
+return array(
+    0 =>
+        array(
+            'name'    => 'EBusinessID',
+            'title'   => '商户ID',
+            'type'    => 'string',
+            'content' =>
+                array(),
+            'value'   => '',
+            'rule'    => 'required',
+            'msg'     => '',
+            'tip'     => '',
+            'ok'      => '',
+            'extend'  => '',
+        ),
+    1 =>
+        array(
+            'name'    => 'AppKey',
+            'title'   => 'AppKey',
+            'type'    => 'string',
+            'content' =>
+                array(),
+            'value'   => '',
+            'rule'    => 'required',
+            'msg'     => '',
+            'tip'     => '',
+            'ok'      => '',
+            'extend'  => '',
+        ),
+    2 =>
+        array(
+            'name'    => 'ReqURL',
+            'title'   => 'API请求地址',
+            'type'    => 'string',
+            'content' =>
+                array(),
+            'value'   => 'http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx',
+            'rule'    => 'required',
+            'msg'     => '',
+            'tip'     => '',
+            'ok'      => '',
+            'extend'  => '',
+        ),
+);

+ 66 - 0
addons/kdniao/controller/Index.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace addons\kdniao\controller;
+
+use addons\kdniao\library\Kdniao;
+use think\addons\Controller;
+use think\Db;
+use think\response\Json;
+
+class Index extends Controller
+{
+
+    public function index()
+    {
+        if ($this->request->isPost()) {
+            $code = $this->request->post('code');
+            $company = $this->request->post('company');
+            $kdniao = new Kdniao();
+            $wuliu = $kdniao->getOrderTracesByJson($company, $code);
+
+            if ($wuliu == -1) {
+                $json = [
+                    'code' => 0,
+                    'msg'  => '未设置接口配置!请在插件管理中配置!',
+                    'data' => '',
+                ];
+                return Json($json);
+            }
+
+            $wuliu = json_decode($wuliu, true);
+
+            $json = [
+                'code' => 1,
+                'msg'  => '获取成功',
+                'data' => isset($wuliu['Traces']) && count($wuliu['Traces']) ? array_reverse($wuliu['Traces']) : [['AcceptStation' => '暂无物流信息', 'AcceptTime' => date('Y-m-d H:i:s', time())]]
+            ];
+            //物流信息倒序
+            return Json($json);
+        } else {
+            $data = Db::name('kdniao')->select();
+            $this->assign('data', $data);
+            return $this->view->fetch();
+        }
+    }
+
+    /**
+     * 查询
+     */
+    public function query()
+    {
+        $code = $this->request->param('code');
+        $company = $this->request->param('company');
+        $kdniao = new Kdniao();
+        $wuliu = $kdniao->getOrderTracesByJson($company, $code);
+
+        $wuliu = json_decode($wuliu, true);
+
+        /*if (isset($wuliu['Traces']) && count($wuliu['Traces'])) {
+            $this->assign('data', array_reverse($wuliu['Traces']));
+        }*/
+
+        $this->assign('data', isset($wuliu['Traces']) && count($wuliu['Traces']) ? array_reverse($wuliu['Traces']) : '');
+        return $this->view->fetch();
+    }
+
+}

+ 10 - 0
addons/kdniao/info.ini

@@ -0,0 +1,10 @@
+name = kdniao
+title = 快递鸟
+intro = 快递鸟API物流即时信息查询插件
+author = Coder
+website = http://www.kdniao.com
+version = 1.0.1
+state = 1
+url = /addons/kdniao
+license = regular
+licenseto = 52871

+ 28 - 0
addons/kdniao/install.sql

@@ -0,0 +1,28 @@
+
+CREATE TABLE IF NOT EXISTS `__PREFIX__kdniao` (
+  `company` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
+  `code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快递鸟物流编码表';
+
+
+BEGIN;
+INSERT INTO `__PREFIX__kdniao` (`company`, `code`) VALUES
+('顺丰速运', 'SF'),
+('百世快递', 'HTKY'),
+('中通快递', 'ZTO'),
+('申通快递', 'STO'),
+('圆通速递', 'YTO'),
+('韵达速递', 'YD'),
+('邮政快递包裹', 'YZPY'),
+('EMS', 'EMS'),
+('天天快递', 'HHTT'),
+('京东快递', 'JD'),
+('优速快递', 'UC'),
+('德邦快递', 'DBL'),
+('宅急送', 'ZJS'),
+('TNT快递', 'TNT'),
+('UPS', 'UPS'),
+('DHL', 'DHL'),
+('FEDEX联邦(国内件)', 'FEDEX'),
+('FEDEX联邦(国际件)', 'FEDEX_GJ');
+COMMIT;

+ 99 - 0
addons/kdniao/library/Kdniao.php

@@ -0,0 +1,99 @@
+<?php
+
+namespace addons\kdniao\library;
+
+class Kdniao
+{
+    protected $config = [];
+
+    public function __construct($options = [])
+    {
+        if ($config = get_addon_config('kdniao')) {
+            $this->config = array_merge($this->config, $config);
+        }
+        $this->config = array_merge($this->config, is_array($options) ? $options : []);
+    }
+
+    /**
+     * Json方式 查询订单物流轨迹
+     * @param string $shipper
+     * @param string $code
+     * @return int|string
+     */
+    public function getOrderTracesByJson($shipper, $code)
+    {
+        $eBusinessID = $this->config["EBusinessID"];
+        $appKey = $this->config["AppKey"];
+        $reqURL = $this->config["ReqURL"];
+
+        if (!$eBusinessID || !$appKey || !$reqURL) {
+            return -1;
+        }
+
+        $requestData = "{'OrderCode':'','ShipperCode':'$shipper','LogisticCode':'$code'}";
+
+        $datas = array(
+            'EBusinessID' => $eBusinessID,
+            'RequestType' => '1002',
+            'RequestData' => urlencode($requestData),
+            'DataType'    => '2',
+        );
+        $datas['DataSign'] = $this->encrypt($requestData, $appKey);
+        $result = $this->sendPost($reqURL, $datas);
+
+        //根据公司业务处理返回的信息......
+
+        return $result;
+    }
+
+    /**
+     * Post提交数据
+     * @param  string $url   请求Url
+     * @param  array  $datas 提交的数据
+     * @return string 响应返回的html
+     */
+    protected function sendPost($url, $datas)
+    {
+        $temps = array();
+        foreach ($datas as $key => $value) {
+            $temps[] = sprintf('%s=%s', $key, $value);
+        }
+        $post_data = implode('&', $temps);
+        $url_info = parse_url($url);
+        if (empty($url_info['port'])) {
+            $url_info['port'] = 80;
+        }
+        $httpheader = "POST " . $url_info['path'] . " HTTP/1.0\r\n";
+        $httpheader .= "Host:" . $url_info['host'] . "\r\n";
+        $httpheader .= "Content-Type:application/x-www-form-urlencoded\r\n";
+        $httpheader .= "Content-Length:" . strlen($post_data) . "\r\n";
+        $httpheader .= "Connection:close\r\n\r\n";
+        $httpheader .= $post_data;
+        $fd = fsockopen($url_info['host'], $url_info['port']);
+        fwrite($fd, $httpheader);
+        $gets = "";
+        $headerFlag = true;
+        while (!feof($fd)) {
+            if (($header = @fgets($fd)) && ($header == "\r\n" || $header == "\n")) {
+                break;
+            }
+        }
+        while (!feof($fd)) {
+            $gets .= fread($fd, 128);
+        }
+        fclose($fd);
+
+        return $gets;
+    }
+
+    /**
+     * 电商Sign签名生成
+     * @param string 内容
+     * @param string Appkey
+     * @return string DataSign签名
+     */
+    protected function encrypt($data, $appkey)
+    {
+        return urlencode(base64_encode(md5($data . $appkey)));
+    }
+}

+ 190 - 0
addons/kdniao/view/index/index.html

@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>快递鸟物流即时信息查询 - {$site.name}</title>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+    <!-- Bootstrap Core CSS -->
+    <link rel="stylesheet" href="__CDN__/assets/libs/bootstrap/dist/css/bootstrap.min.css">
+
+    <style>
+        .track_list {
+            padding: 10px;
+            list-style: none;
+        }
+
+        .track_list li {
+            font-size: 14px;
+            border-left: 1px solid #dcdcdc;
+            padding-bottom: 10px;
+            padding-left: 15px;
+            position: relative
+        }
+
+        .track_list li p.time {
+            font-size: 11px;
+            padding-bottom: 10px;
+            border-bottom: 1px solid #e7e7e7
+        }
+
+        .track_list li p:first-child {
+            padding-bottom: 5px
+        }
+
+        .track_list li.now p {
+            color: #00bb42
+        }
+
+        .track_list li.old p {
+            color: #9d9d9d
+        }
+
+        .track_list li.now .ico {
+            display: block;
+            position: absolute;
+            left: -8px;
+            top: 0;
+            width: 16px;
+            height: 16px;
+            background-color: #b0ffd4;
+            border-radius: 8px
+        }
+
+        .track_list li.now .ico i {
+            display: block;
+            width: 12px;
+            height: 12px;
+            background-color: #00aa2c;
+            border-radius: 6px;
+            position: absolute;
+            left: 2px;
+            top: 2px
+        }
+
+        .track_list li.old .ico {
+            display: block;
+            width: 10px;
+            height: 10px;
+            background-color: #dcdcdc;
+            border-radius: 5px;
+            position: absolute;
+            left: -5px;
+            top: 4px
+        }
+
+        .track_list li:last-child {
+            border-left: 0
+        }
+
+        .track_list li:last-child .time {
+            border-bottom: 0
+        }
+
+        .track_list li:last-child.old .ico {
+            left: -4px;
+            top: 0
+        }
+
+        .logistics_track .nofound {
+            padding: 30px 10px;
+            line-height: 20px;
+            font-size: 12px;
+            color: #9b9b9b
+        }
+
+        .track_list li p a {
+            color: #0d90ff
+        }
+    </style>
+    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+    <!--[if lt IE 9]>
+    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
+    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
+    <![endif]-->
+
+</head>
+<body>
+<div class="container">
+    <h2>快递鸟物流即时信息查询</h2>
+    <hr>
+    <form action="" class="form-horizontal">
+        <fieldset>
+            <div class="form-group">
+                <label class="col-lg-1 control-label">物流公司</label>
+                <div class="col-lg-11">
+                    <select id="company" name="company" class="form-control">
+                        <option value="">--请选择--</option>
+                        {volist name="data" id="vo"}
+                        <option value="{$vo.code}">{$vo.company}</option>
+                        {/volist}
+                    </select>
+                </div>
+            </div>
+
+            <div class="form-group">
+                <label class="col-lg-1 control-label">快递编号</label>
+                <div class="col-lg-11">
+                    <input type="text" class="form-control" id="code" name="code" placeholder="快递编号">
+                </div>
+            </div>
+
+            <div class="form-group">
+                <div class="col-lg-11 col-lg-offset-1">
+                    <button type="button" id="btnsend" name="btnsend" class="btn btn-primary">发送</button>
+                    <button type="reset" class="btn btn-default">重置</button>
+                </div>
+            </div>
+        </fieldset>
+    </form>
+
+    <div class="well">
+        <div class="row">
+            <blockquote>物流数据:</blockquote>
+            <ul class="track_list">
+
+            </ul>
+        </div>
+    </div>
+</div>
+<!-- jQuery -->
+<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
+
+<script type="text/javascript">
+    $("#btnsend").click(function () {
+        $.ajax({
+            type: "post",
+            url: "{:addon_url('kdniao/index/index')}",
+            data: {company: $("#company").val(), code: $("#code").val(), r: Math.random()},
+            success: function (data) {
+                console.log(data);
+                $('.track_list').html('');
+
+                if (data.code) {
+                    $.each(data.data, function (i, n) {
+                        var $li = $('<li class="' + (i == 0 ? 'now' : 'old') + '">' +
+                            '<p>' + n.AcceptStation + '</p>' +
+                            '<p>' + n.AcceptTime + '</p>' +
+                            '<span class="ico"><i></i></span>' +
+                            '</li>');
+                        $('.track_list').append($li);
+                    });
+                } else {
+                    var $li = $('<li>' +
+                        '<b>' + data.msg + '</b>' +
+                        '</li>');
+                    $('.track_list').append($li);
+                }
+
+            },
+            error: function () {
+                alert('查询失败');
+            },
+            complete: function () {
+
+            }
+        });
+    });
+</script>
+</body>
+</html>

+ 129 - 0
addons/kdniao/view/index/query.html

@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>快递鸟物流即时信息查询 - {$site.name}</title>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+    <!-- Bootstrap Core CSS -->
+    <link rel="stylesheet" href="__CDN__/assets/libs/bootstrap/dist/css/bootstrap.min.css">
+
+    <style>
+        .track_list {
+            padding: 10px;
+            list-style: none;
+        }
+
+        .track_list li {
+            font-size: 14px;
+            border-left: 1px solid #dcdcdc;
+            padding-bottom: 10px;
+            padding-left: 15px;
+            position: relative
+        }
+
+        .track_list li p.time {
+            font-size: 11px;
+            padding-bottom: 10px;
+            border-bottom: 1px solid #e7e7e7
+        }
+
+        .track_list li p:first-child {
+            padding-bottom: 5px
+        }
+
+        .track_list li.now p {
+            color: #00bb42
+        }
+
+        .track_list li.old p {
+            color: #9d9d9d
+        }
+
+        .track_list li.now .ico {
+            display: block;
+            position: absolute;
+            left: -8px;
+            top: 0;
+            width: 16px;
+            height: 16px;
+            background-color: #b0ffd4;
+            border-radius: 8px
+        }
+
+        .track_list li.now .ico i {
+            display: block;
+            width: 12px;
+            height: 12px;
+            background-color: #00aa2c;
+            border-radius: 6px;
+            position: absolute;
+            left: 2px;
+            top: 2px
+        }
+
+        .track_list li.old .ico {
+            display: block;
+            width: 10px;
+            height: 10px;
+            background-color: #dcdcdc;
+            border-radius: 5px;
+            position: absolute;
+            left: -5px;
+            top: 4px
+        }
+
+        .track_list li:last-child {
+            border-left: 0
+        }
+
+        .track_list li:last-child .time {
+            border-bottom: 0
+        }
+
+        .track_list li:last-child.old .ico {
+            left: -4px;
+            top: 0
+        }
+
+        .logistics_track .nofound {
+            padding: 30px 10px;
+            line-height: 20px;
+            font-size: 12px;
+            color: #9b9b9b
+        }
+
+        .track_list li p a {
+            color: #0d90ff
+        }
+    </style>
+    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+    <!--[if lt IE 9]>
+    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
+    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
+    <![endif]-->
+
+</head>
+<body>
+<div class="container">
+    <div class="well">
+        <div class="row">
+            <blockquote>物流数据:</blockquote>
+            <ul class="track_list">
+                {volist name="data" id="item" empty="暂无物流信息"}
+                <li class='{if condition="$i eq 1"}now{else/}old{/if}'>
+                    <p>{$item.AcceptStation}</p>
+                    <p>{$item.AcceptTime}</p>
+                    <span class="ico"><i></i></span>
+                </li>
+                {/volist}
+            </ul>
+        </div>
+    </div>
+</div>
+<!-- jQuery -->
+<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
+
+
+</body>
+</html>

+ 2 - 2
addons/kefu/config.php

@@ -90,7 +90,7 @@ return [
         'title' => 'Gateway进程数',
         'type' => 'string',
         'content' => [],
-        'value' => '1',
+        'value' => '2',
         'rule' => '',
         'tip' => '设置为CPU核数相等的数量性能最好',
         'ok' => '',
@@ -101,7 +101,7 @@ return [
         'title' => 'BusinessWorker进程数',
         'type' => 'string',
         'content' => [],
-        'value' => '2',
+        'value' => '4',
         'rule' => '',
         'tip' => '根据业务有无阻塞式IO,设为CPU核数的1-3倍',
         'ok' => '',

+ 1 - 1
addons/kefu/controller/Index.php

@@ -181,7 +181,7 @@ class Index extends Base
 
                             // 若需修改附加的字符串,请将`Events::onWebSocketConnect`方法里边的附加字符串一起修改
                             // 先用 user_token 数据表中的token字段同样的加密算法对token进行加密,否则workerman无法识别用户身份
-                            $sign                           = Common::getEncryptedToken($token) . 'kefu_user_sign_additional';
+                            $sign                           = Common::getEncryptedToken($token);// . 'kefu_user_sign_additional';
                             $key                            = md5(md5($auth->id) . md5($sign));
                             $cookie_data                    = [$auth->id, $key];
                             $this->token_list['kefu_token'] = implode('|', $cookie_data);

+ 1 - 1
addons/kefu/example/uni-customer/manifest.json

@@ -57,7 +57,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx4552387af63efaec",
+        "appid" : "wx3d434cd04d4f7a27",
         "setting" : {
             "urlCheck" : false,
             "es6" : false

+ 1 - 1
addons/kefu/example/uni-customer/pages/kefu/config.js

@@ -14,7 +14,7 @@ const expression = [
 ];
 
 export default {
-	baseURL: 'example.com', // 启动workerman服务的域名,无需填写协议和端口
+	baseURL: 'lvye.hdlkeji.com', // 启动workerman服务的域名,无需填写协议和端口
 	https_switch: false, // 是否启用https协议(默认关,正式版必开,且需要参考文档创建wss服务)
 	expression
 }

+ 1 - 1
addons/kefu/example/uni-customer/pages/kefu/kefu.vue

@@ -321,7 +321,7 @@
 					fail: res => {
 						uni.showModal({
 							title: '温馨提示',
-							content: '在线客服初始化失败,请重试~',
+							content: '在线客服初始化失败,请重试~~',
 							showCancel: false
 						})
 						that.errorTips = '初始化失败';

+ 1 - 1
addons/kefu/library/GatewayWorker/vendor/workerman/_www_wwwroot_lvye.zhousi.hdlkeji.com_think.pid

@@ -1 +1 @@
-19184
+30000

+ 1 - 1
addons/kefu/library/GatewayWorker/vendor/workerman/workerman/Worker.php

@@ -13,7 +13,7 @@
  */
 namespace Workerman;
 require_once __DIR__ . '/Lib/Constants.php';
-
+require_once 'Autoloader.php';
 use Workerman\Events\EventInterface;
 use Workerman\Connection\ConnectionInterface;
 use Workerman\Connection\TcpConnection;

+ 26 - 0
addons/shopro/controller/Qc.php

@@ -0,0 +1,26 @@
+<?php
+namespace addons\shopro\controller;
+use Workerman\Worker;
+use Workerman\Connection\TcpConnection;
+require_once '../vendor/autoload.php';
+require_once '../addons/kefu/library/GatewayWorker/vendor/workerman/workerman/Worker.php';
+// 证书最好是申请的证书
+$context = array(
+    // 更多ssl选项请参考手册 http://php.net/manual/zh/context.ssl.php
+    'ssl' => array(
+        // 请使用绝对路径
+        'local_cert'        => '/www/wwwroot/lvye.zhousi.hdlkeji.com/public/ssl/fullchain.pem', // 也可以是crt文件
+        'local_pk'          => '/www/wwwroot/lvye.zhousi.hdlkeji.com/public/ssl/privkey.key',
+        'verify_peer'       => false,
+        'allow_self_signed' => true, //如果是自签名证书需要开启此选项
+    )
+);
+// 这里设置的是websocket协议(端口任意,但是需要保证没被其它程序占用)
+
+$worker = new Worker('websocket://0.0.0.0:1818', $context);
+// 设置transport开启ssl,websocket+ssl即wss
+$worker->transport = 'ssl';
+$worker->onMessage = function(TcpConnection $con, $msg) {
+    $con->send('ok');
+};
+Worker::runAll();

+ 2 - 2
addons/shopro/library/chat/config.php

@@ -4,13 +4,13 @@ return array (
   'type' => 'kefu',
   'basic' => 
   array (
-    'last_customer_service' => 1,
+    'last_customer_service' => 0,
     'allocate' => 'busy',
     'notice' => '显示在用户端头部',
   ),
   'system' => 
   array (
-    'is_ssl' => 1,
+    'is_ssl' => 0,
     'ssl_type' => 'cert',
     'ssl_cert' => '/www/server/panel/vhost/cert/****/fullchain.pem',
     'ssl_key' => '/www/server/panel/vhost/cert/****/privkey.pem',

+ 1 - 0
public/.well-known/acme-challenge/hK_EkDYDmRJWLqwAhB0wZBcyhDAKKL__hihugi3Xzzg

@@ -0,0 +1 @@
+hK_EkDYDmRJWLqwAhB0wZBcyhDAKKL__hihugi3Xzzg.whDNgVWaPAZnZO87TouK-V-cBZ7zR8nRBZuwDRX6UNs

+ 24 - 1
public/assets/js/addons.js

@@ -1,5 +1,28 @@
 define([], function () {
-    if (Config.modulename == 'admin' && Config.controllername == 'index' && Config.actionname == 'index') {
+    if ($('.kdniao').length > 0) {
+
+    $('.kdniao').each(function () {
+        var code = $(this).data('code');
+
+        $(this).addClass('btn btn-xs bg-success').append('<i class="fa fa-truck"></i>' + code);
+    });
+
+    $('.kdniao').click(function () {
+        var company = $(this).data('company');
+        var code = $(this).data('code');
+
+        if (company && code) {
+            Layer.open({
+                type: 2,
+                area: ['700px', '450px'],
+                fixed: false, //不固定
+                maxmin: true,
+                content: '/addons/kdniao/index/query?company=' + company + '&code=' + code
+            });
+        }
+    });
+}
+if (Config.modulename == 'admin' && Config.controllername == 'index' && Config.actionname == 'index') {
 
     require.config({
         paths: {