www.5688.cn Open in urlscan Pro
139.196.28.122  Public Scan

Submitted URL: http://www.5688.cn/source/js/tools.js
Effective URL: https://www.5688.cn/source/js/tools.js
Submission: On November 27 via manual from IN — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

/**
 * Created by Administrator on 2015/9/8.
 */
;
$(function () {

    //--------------------------------------------------------------------------------------
    //鏌ユ捣鍏崇紪鐮� :鍒ゆ柇鍏冪礌鏄惁瀛樺湪,鑷姩瀹屾垚鏌ヨ琛ㄥ崟
    //--------------------------------------------------------------------------------------

    /*    if ($('#hscode_search_key').length > 0) {
            $('#hscode_search_key').autocomplete(
                {
                    source: function (request, response) {
                        $.ajax({
                            url: "/remotejson/getHscode",
                            dataType: "jsonp",
                            data: {
                                query: request.term,
                            }, success: function (data) {
                                response(data.hscode);
                            },
                            error: function () {
                                layer.alert('鏈煡璇㈠埌鏁版嵁');
                            }
                        });
                    },

                    minLength: 2,
                    select: function (event, ui) {
                        $('#hscode_val').val(ui.item.code);
                        $(this).val(ui.item.label);
                        $('#hscode_search_btn').click();
                        return false;
                    }
                }).data("ui-autocomplete")._renderItem = function (ul, item) {
                return $("<li>")
                    .data("ui-autocomplete-item", item)
                    .append(item.value + "<span>" + item.label + "</span>")
                    .appendTo(ul);
            };
        }*/

    //--------------------------------------------------------------------------------------
    //鏌ユ腐鍙� :鐐瑰嚮鏌ヨ浜嬩欢
    //--------------------------------------------------------------------------------------

    $('#hscode_search_btn').on('click', function () {
        var _index = layer.load(1);
        location.href = '/hscode/'+$('#hscode_search_key').val()+'/';
        // $.post('/remotejson/hscode_find', {key: $('#hscode_search_key').val()}, function (data, status) {
        //
        //     //鍏抽棴
        //     layer.close(_index);
        //     console.log(data)
        //     if (data.status == 1) {
        //
        //         //榛樿椤垫棤table鎯呭喌涓嬫坊鍔爐able瀹瑰櫒
        //         if ($('.tbody').length == 0) {
        //             $('.hscode_list').html('<table><thead><tr><th width="10%">娴峰叧缂栫爜</th><th width="75%">鍟嗗搧鎻忚堪</th><th width="15%">褰掔被瀹炰緥</th></tr></thead><tbody class="tbody"></tbody></table>');
        //         }
        //
        //         $('.tbody').html(data.list);
        //         $('.egList').html(data.en_list);
        //         // $('.page').html(data.page);
        //     }
        //     else {
        //         layer.alert(data.msg);
        //     }
        // }, 'json')
    });

    //鍥炶溅鎻愪氦鏌ヨ
    $('#hscode_search_key').keydown(function (e){
        if (e.keyCode == 13) {
            $('#hscode_search_btn').click();
        }
    });
    //--------------------------------------------------------------------------------------
    //鏌ユ腐鍙� :鍒ゆ柇鍏冪礌鏄惁瀛樺湪,鑷姩瀹屾垚鏌ヨ琛ㄥ崟
    //--------------------------------------------------------------------------------------

    if ($('#search_key').length > 0) {
        $('#search_key').autocomplete(
            {
                source: function (request, response) {
                    $.ajax({
                        url: "/remotejson/getallports_country",
                        dataType: "jsonp",
                        data: {
                            query: request.term,
                        }, success: function (data) {
                            response(data.ports);
                        },
                        error: function () {
                            layer.alert('鏈煡璇㈠埌鏁版嵁');
                        }
                    });
                },

                minLength: 2,
                select: function (event, ui) {
                    $('#port_val').val(ui.item.code);
                    $(this).val(ui.item.label);
                    $('#search_btn').click();
                    return false;
                }
            }).data("ui-autocomplete")._renderItem = function (ul, item) {
            return $("<li>")
                .data("ui-autocomplete-item", item)
                .append(item.value + "<span>" + item.label + "</span>")
                .appendTo(ul);
        };
    }

    //--------------------------------------------------------------------------------------
    //鏌ユ腐鍙� :鐐瑰嚮鏌ヨ浜嬩欢
    //--------------------------------------------------------------------------------------

    $('#search_btn').on('click', function () {
        var _index = layer.load(1);
        $.post('/remotejson/port_find', {key: $('#port_val').val()}, function (data, status) {
            //鍏抽棴
            layer.close(_index);
            if (data.status == 1) {
                $('.page').removeClass('ports_country').removeClass('ports_route').addClass('ports_search');

                //榛樿椤垫棤table鎯呭喌涓嬫坊鍔爐able瀹瑰櫒
                if ($('.tbody').length == 0) {
                    $('.port_list').html('<table><thead><tr class="noborder2"><th>娓彛鑻辨枃鍚�</th> <th>娓彛涓枃鍚�</th><th>娓彛浠g爜</th><th>鍥藉</th><th>鑸嚎</th><th>娴疯繍璐�</th></tr></thead><tbody class="tbody"></tbody></table>');
                }

                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json')
    });
    //--------------------------------------------------------------------------------------
    //璐х墿鐘舵€� :鐐瑰嚮鏌ヨ浜嬩欢
    //--------------------------------------------------------------------------------------
    $('#track_btn').on('click', function () {
        var order_no = $('#track_key').val();
        if(order_no == ''){
            layer.msg('璇疯緭鍏ヨ鍗曞彿');return false;
        }
        var _index = layer.load(1);
        $.post('/tools/apiTrack', {order_no: order_no}, function (res) {
            //鍏抽棴
            layer.close(_index);
            if(res == '0'){
                $('.tbody').html("<tr><td colspan='8'>鏆傛棤鏁版嵁</td></tr>");return false;
            }
            var staust = '';
            if(res.JobStatus){
                $.each(res.JobStatus,function (i,v) {
                    // if(i<8) {
                    //     if($.inArray(i,res.job_status) == -1){
                    //         staust += `<span>${v}</span>`;
                    //     }else {
                    //         staust += `<span class="bule">${v}</span>`;
                    //     }
                    // }
                    staust += `<li class="bounceInDown">
                                <h3>${v.time}</h3>
                                <dl>
                                    <dt>${v.flowname}<span>${v.info}</span></dt>
                                </dl>                                  
                            </li>`;
                })
            }

            var data = `<div class="history">
                            <ul>
                                ${staust}
                            </ul>
                        </div>`;
            var html = '<tr>'
            html += `<td>${res.pol_name}</td>`;
            html += `<td>${res.pod_name}</td>`;
            html += `<td>${res.shipping_mode}</td>`;
            html += `<td>${res.etc}</td>`;
            html += `<td>${res.eta}</td>`;
            html += `<td>${res.etd}</td>`;
            html += `<td>${res.type}</td>`;
            html += `<td><a href='javascript:void(0)' class='viewnote'>鏌ョ湅</a></td>`;
            html += '</tr>'
            html += `<tr class='none'><td colspan='8'>${data}</td></tr>`;
            $('.tbody').html(html);
        }, 'json')
    });
    //view note
    $(document).on('click', '.viewnote', function () {
        $(this).parents().parents().next('.none').toggle()
    });
    //--------------------------------------------------------------------------------------
    //鏌ユ腐鍙� :娓彛榛樿缈婚〉(鎸夊浗瀹�)
    //--------------------------------------------------------------------------------------

    $(document).on('click', '.ports_country a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/getportsbycountry", $('#port_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    //--------------------------------------------------------------------------------------
    //鏌ユ腐鍙� :娓彛榛樿缈婚〉(鎸夎埅绾�)
    //--------------------------------------------------------------------------------------
    $(document).on('click', '.ports_route a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/getportsbyroute", $('#port_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    //--------------------------------------------------------------------------------------
    //鏌ユ腐鍙� :娓彛鏌ヨ榛樿缈婚〉
    //--------------------------------------------------------------------------------------
    $(document).on('click', '.ports_search a', function () {
        var _index = layer.load(1);

        $.get($(this).attr('rel'), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });


    //--------------------------------------------------------------------------------------
    //鏌ヨ埞鍙� :鍒ゆ柇鍏冪礌鏄惁瀛樺湪锛岃〃鍗曡嚜鍔ㄥ畬鎴�
    //--------------------------------------------------------------------------------------
    if ($('#ship_search_key').length > 0) {
        $('#ship_search_key').autocomplete(
            {
                source: function (request, response) {
                    $.ajax({
                        url: "/remotejson/getshipowner",
                        dataType: "jsonp",
                        data: {
                            query: request.term,
                        }, success: function (data) {
                            response(data.shipowner);
                        },
                        error: function () {
                            layer.alert('鏈煡璇㈠埌鏁版嵁');
                        }
                    });
                },

                minLength: 2,
                select: function (event, ui) {
                    $(this).val(ui.item.label);
                    $('#newpage').attr('href', '/shipowner/' + ui.item.code.toLowerCase() + '.html');
                    $('#redirect').click();
                    return false;
                }
            }).data("ui-autocomplete")._renderItem = function (ul, item) {
            return $("<li>")
                .data("ui-autocomplete-item", item)
                .append(item.value + "<span>" + item.label + "</span>")
                .appendTo(ul);
        };
    }

    //--------------------------------------------------------------------------------------
    //鏌ヨ埞鍙� :鐐瑰嚮鏌ヨ浜嬩欢
    //--------------------------------------------------------------------------------------
    $('#ship_search_btn').on('click', function () {
        if ($('#newpage').attr('href').length > 0) {
            $('#redirect').click();
            return false;
        } else {
            layer.alert('鑸瑰叕鍙镐笉鑳戒负绌猴紒')
        }
    });

    //--------------------------------------------------------------------------------------
    //鏌ヨ埞鍙� :鑸瑰徃缈婚〉
    //--------------------------------------------------------------------------------------
    $(document).on('click', '.shipowner_page a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/getshiplist", $('#shipowner_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    //璐х墿璺熻釜
    $(document).on('click', '.tracking a', function () {
        var _index = layer.load(1);
        var $_page = $(this).attr('data-ci-pagination-page');
        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }
        $('#pagination').val($_page);
        //post form
        $.post("/remotejson/gettracklist", $('#shipowner_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);
            if (data.status == 1) {
                $('.category ul').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });
    //鐐瑰嚮鑸瑰叕鍙�
    $(document).on('click','.track li',function () {
        $('#port').val($(this).data('id'));
        $(this).css('color','#09f');
        $(this).siblings().css('color','#000');
    })
    //鐐瑰嚮鏌ヨ
    $('#tracka_search_btn').on('click', function () {
        var id = $('#port').val();
        if ($('#port').val() != '') {
            $.post("/remotejson/gettrack", {id:id}, function (data) {
                //鍏抽棴
                if(data){
                    //window.location.href = data;
                    window.open(data);
                }
            });
            return false;
        } else {
            layer.alert('璇烽€夋嫨鑸瑰叕鍙革紒')
        }
    });
    //--------------------------------------------------------------------------------------
    //鏌ユ満鍦� :鍒ゆ柇鍏冪礌鏄惁瀛樺湪锛岃〃鍗曡嚜鍔ㄥ畬鎴�
    //--------------------------------------------------------------------------------------
    if ($('#airport_search_key').length > 0) {
        $('#airport_search_key').autocomplete(
            {
                source: function (request, response) {
                    $.ajax({
                        url: "/remotejson/getallairport_country",
                        dataType: "jsonp",
                        data: {
                            query: request.term,
                        }, success: function (data) {
                            response(data.ports);
                        },
                        error: function () {
                            layer.alert('鏈煡璇㈠埌鏁版嵁');
                        }
                    });
                },

                minLength: 2,
                select: function (event, ui) {
                    $('#airport_val').val(ui.item.code); //娉ㄦ剰鑸瑰叕鍙稿尯鍒�
                    $(this).val(ui.item.label);
                    $('#airport_search_btn').click();
                    return false;
                }
            }).data("ui-autocomplete")._renderItem = function (ul, item) {
            return $("<li>")
                .data("ui-autocomplete-item", item)
                .append(item.value + "<span>" + item.label + "</span>")
                .appendTo(ul);
        };
    }
    //璐х墿璺熻釜
    $(document).on('click', '.airline a', function () {
        var _index = layer.load(1);
        var $_page = $(this).attr('data-ci-pagination-page');
        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }
        $('#pagination').val($_page);
        //post form
        $.post("/remotejson/gettrackalist", $('#shipowner_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);
            if (data.status == 1) {
                $('.category ul').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });
    //鐐瑰嚮鑸瑰叕鍙�
    $(document).on('click','.tracking li',function () {
        $('#port').val($(this).data('id'));
        $(this).css('color','#09f');
        $(this).siblings().css('color','#000');
    })
    //鐐瑰嚮鏌ヨ
    $('#track_search_btn').on('click', function () {
        var id = $('#port').val();
        if ($('#port').val() != '') {
            $.post("/remotejson/gettracka", {id:id}, function (data) {
                //鍏抽棴
                if(data){
                    //window.location.href = data;
                    window.open(data);
                }
            });
            return false;
        } else {
            layer.alert('璇烽€夋嫨鑸┖鍏徃锛�')
        }
    });
    //--------------------------------------------------------------------------------------
    //鏌ユ満鍦�  :鐐瑰嚮鏌ヨ浜嬩欢
    //--------------------------------------------------------------------------------------

    $('#airport_search_btn').on('click', function () {

        var _index = layer.load(1);
        $.post('/remotejson/airport_find', {key: $('#airport_val').val()}, function (data, status) {

            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                if (!$('.page').is('.airport_search')) {
                    $('.page').addClass('airport_search');
                }

                //榛樿椤垫棤table鎯呭喌涓嬫坊鍔爐able瀹瑰櫒
                if ($('.tbody').length == 0) {
                    $('.port_list').html('<table><thead><tr class="noborder2"><th>涓夊瓧绠€鐮�</th> <th>鑻辨枃鍚嶇О</th><th>涓枃鍚嶇О</th><th>鎵€灞炲浗瀹�</th><th>绌鸿繍璐�</th></tr></thead><tbody class="tbody"></tbody></table>');
                }

                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json')
    });

    //--------------------------------------------------------------------------------------
    //鏌ユ満鍦� :鏈哄満鏌ヨ榛樿缈婚〉
    //--------------------------------------------------------------------------------------
    $(document).on('click', '.airport_search a', function () {
        var _index = layer.load(1);

        $.get($(this).attr('rel'), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    //--------------------------------------------------------------------------------------
    //鏌ユ満鍦� :鏄剧ず娓呭叧淇℃伅
    //--------------------------------------------------------------------------------------

    $('#showinfo').on('click', function () {
        if ($('.customs_clearance').is(":visible")) {
            $('.customs_clearance').hide();
        } else {
            $('.customs_clearance').show();
        }
    });

    //--------------------------------------------------------------------------------------
    //鏌ヨ埅鍙� :鍒ゆ柇鍏冪礌鏄惁瀛樺湪锛岃〃鍗曡嚜鍔ㄥ畬鎴�
    //--------------------------------------------------------------------------------------
    if ($('#airline_search_key').length > 0) {
        $('#airline_search_key').autocomplete(
            {
                source: function (request, response) {
                    $.ajax({
                        url: "/remotejson/getairline",
                        dataType: "jsonp",
                        data: {
                            query: request.term,
                        }, success: function (data) {
                            response(data.airline);
                        },
                        error: function () {
                            layer.alert('鏈煡璇㈠埌鏁版嵁');
                        }
                    });
                },

                minLength: 2,
                select: function (event, ui) {
                    $(this).val(ui.item.label);
                    $('#newpage').attr('href', '/airline/' + ui.item.code.toLowerCase().replace('*', '1') + '.html');
                    $('#redirect').click();
                    return false;
                }
            }).data("ui-autocomplete")._renderItem = function (ul, item) {
            return $("<li>")
                .data("ui-autocomplete-item", item)
                .append(item.code + "<span>" + item.value + '-' + item.label + "</span>")
                .appendTo(ul);
        };
    }

    //--------------------------------------------------------------------------------------
    //鏌ヨ埅鍙� :鐐瑰嚮鏌ヨ浜嬩欢
    //--------------------------------------------------------------------------------------
    $('#airline_search_btn').on('click', function () {
        if ($('#newpage').attr('href').length > 0) {
            $('#redirect').click();
            return false;
        } else {
            layer.alert('鑸┖鍏徃涓嶈兘涓虹┖锛�')
        }
    });

    //--------------------------------------------------------------------------------------
    //鏌ヨ埅鍙� :鑸徃缈婚〉
    //--------------------------------------------------------------------------------------
    $(document).on('click', '.airline_page a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/getairlinelist", $('#shipowner_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    //--------------------------------------------------------------------------------------
    //宸ュ叿鍏宠仈杩愪环缈婚〉
    //--------------------------------------------------------------------------------------
    $(document).on('click', '#_ocean_ports_freight_page a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/ocean_ports_freight", $('#ocean_ports_freight_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    $(document).on('click', '#_ocean_ship_freight_page a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/ocean_ship_freight", $('#ocean_ship_freight_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    $(document).on('click', '#_air_line_freight_page a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/air_line_freight", $('#air_line_freight_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });

    $(document).on('click', '#_air_port_freight_page a', function () {
        var _index = layer.load(1);

        var $_page = $(this).attr('data-ci-pagination-page');

        if (typeof($_page) == 'undefined' || $_page == '') {
            $_page = 1;
        }

        $('#pagination').val($_page);

        //post form
        $.post("/remotejson/air_ports_freight", $('#air_port_freight_forms').serialize(), function (data) {
            //鍏抽棴
            layer.close(_index);

            if (data.status == 1) {
                $('.tbody').html(data.list);
                $('.page').html(data.page);
            }
            else {
                layer.alert(data.msg);
            }
        }, 'json');
    });


//--------------------------------------------------------------------------------------
//绾犻敊
//--------------------------------------------------------------------------------------
    $('#_correct').on('click', function () {
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            shadeClose: true,
            skin: 'notice',
            area: ['500px', '250px'],
            content: '<div class="correct"><input type="text" value="" placeholder="鎮ㄧ殑E-mail/QQ,閫夊~" id="contact"><textarea id="content" placeholder="鍙嶉鐨勫唴瀹瑰啓杩�..."></textarea><input type="button" value="鎻愪氦鍙嶉" id="sent_notice"></div>'
        });
    });

    $(document).on('click', '#sent_notice', function () {
        var _this = $(this);
        var _contact = $('#contact').val();
        var _content = $('#content').val();

        if (_content == '') {
            layer.alert("鍙嶉鍐呭涓嶈兘涓虹┖");
            return false;
        }

        layer.load(1); //鍔犺浇

        //post form
        $.post("/mail/ajax_tools_feedback", {
            url: window.location.href,
            contact: encodeURI(_contact),
            content: _content
        }, function (data) {
            layer.closeAll(); //鍏抽棴
            layer.alert(data.msg);
        }, 'json');
    });

});