PageSourceSearch

https://www.sellersprite.com/assets-v2/js/account-common.js?v202609241633

js sellersprite.com collected 2026-09-24 09:26:35 UTC 8,155 bytes, 214 lines download raw bytes

1var asinArr = [];//结果数组
2var dom = !$('#page-type').length;
3var isAba = dom ? 20 : 100;
4var leaveAsin = isAba;
5var placeholderText = '剩余可输入'+leaveAsin+'个ASIN',defultText = 'ASIN或产品链接,如:B00FLYWNYQ,最多'+ (dom ? 20 : 100) +'个;可直接从txt或Excel按列复制粘贴';
6function fIsBAsin(asin) {
7    return /^[B|b]0[a-zA-Z0-9]{8,10}$/.test(asin);
8}
9function fIsAsin(asin) {
10    return fIsBAsin(asin) || /^[0-9]{7,11}[a-zA-Z0-9]{1,2}$/.test(asin);
11}
12
13function getInputChange(event, type) {
14    if (type) {
15        var arr = event.split(' ');
16    } else {
17        var arr = event.target.value.split(' ');
18    }
19    var list = [];//输入
20    for (j = 0; j < arr.length; j++) {
21        // console.log(arr[j]);
22        //控制输入数量
23        if (asinArr.length >= isAba) break;// && fIsAsin(arr[j])
24        if (!asinArr.includes(arr[j])) {
25            if(fIsAsin(arr[j].split("\t")[0].toUpperCase())){
26                asinArr.push(arr[j].split("\t")[0].toUpperCase());
27                list.push(arr[j].split("\t")[0].toUpperCase())
28            }
29        }
30    }
31    if (!list.length) return;
32    leaveAsin = leaveAsin - list.length;
33    var div = ''
34    for (var i = 0; i < asinArr.length; i++) {
35        // if(fIsAsin(asinArr[i])){iconfont icon-shanchu
36        div += `<span class="tag-asin">` + asinArr[i] + `<i class="asin-del">x</i></span>`
37        // }
38    };
39    leastAsin ();
40    $('#dialog-batch-input-asin').val('');
41    $('.input-tag-asins-box').find('.tag-asin').remove();
42    $('#dialog-batch-input-asin').before(div);
43    $('#dialog-batch-input-asin').attr('placeholder', placeholderText);
44    singleDel();
45}
46function leastAsin(){
47    switch (window.GLOBAL_MOMENT_LANGUAGE) {
48        case 'en':
49                placeholderText = `${(dom ? 20 : 100)-leaveAsin}/${(dom ? 20 : 100)}`;
50                defultText = 'Enter up to '+ (dom ? 20 : 100) + ' product ASINs';
51                break;
52        case 'jp':
53                placeholderText =`${(dom ? 20 : 100)-leaveAsin}/${(dom ? 20 : 100)}のASINが記入されました`;
54                defultText = 'ASINまたは商品リンク(最大'+ (dom ? 20 : 100) +'個)例:B00FLYWNYQ。直接txtまたはExcelから列ごとにコピペすることができます。';
55                break;
56        default:
57                placeholderText = `已录入${(dom ? 20 : 100)-leaveAsin}/${(dom ? 20 : 100)}个ASIN`;
58                defultText = 'ASIN或产品链接,如:B00FLYWNYQ,最多'+ (dom ? 20 : 100) +'个;可直接从txt或Excel按列复制粘贴';
59                break;
60    }
61}
62// 单个asin删除
63function singleDel() {
64    $('.input-tag-asins-box').on('click', '.asin-del', function () {
65        let asin = $(this).parent('.tag-asin').text();
66        let index = asinArr.indexOf(asin);
67        var spliceArr = asinArr.splice(index, 1);
68        $(this).parent('.tag-asin').remove();
69        leaveAsin = leaveAsin + 1;
70        leastAsin();
71        $('#dialog-batch-input-asin').attr('placeholder', placeholderText);
72    })
73}
74$(function () {
75    // 查询历史
76    var module = '';
77    $('#queryHistory').click(function () {
78        module = $(this).attr('data-module').replace(/\s*/g, "")
79        terminal = $(this).attr('data-terminal').replace(/\s*/g, "")
80        $('#sidebar-history').show()
81        window.getAccount.getAccount()
82        if (module == 'CL' || module == 'PR') {
83            loadQueryHistoryLogs(1, module, module)
84        } else {
85            loadQueryHistoryLogs(1, module)
86        }
87
88    });
89    // 子账号筛选
90    $('.account-dropdown-menu').on('click', '.dropdown-item', function (e) {
91        $('#dropdownMenuButton').text($(this).text())
92        $('.account-dropdown-menu').hide()
93        var page = 1;
94        var id = $(this).attr('data-accountid');
95        //         查竞品 CL
96        // 选产品 PR
97        if (module == 'CL' || module == 'PR') {
98            loadQueryHistoryLogs(page, module, module, id)
99        } else {
100            loadQueryHistoryLogs(page, module, '', id)
101        }
102
103    })
104    //查询历史
105    function loadQueryHistoryLogs(page, module, isModule, id) {
106        if (!page) page = 1;
107        if (!id) id = ''
108        if (!isModule) isModule = ''
109        var t;
110        if (terminal == 'W' || terminal == 'E') {
111            t = terminal;
112        } else {
113            t = null;
114        }
115        page = parseInt(page, 10);
116        page = page - 1;
117        var pageSize = 20;
118        $('#querylog-pg-nv').html('');
119        $.ajax({
120            type: "post",
121            url: "/v2/query-log/history",
122            data: {
123                "startIndex": pageSize * page,
124                "parentModule": module,
125                "module": isModule,
126                "terminal": t,
127                "familyClientId": id
128            },
129            cache: false,
130            async: true,
131            dataType: "json",
132            beforeSend: function () {
133                $('#querylog-tbody').html($('#querylog-tbody-loading').tmpl({}));
134                $('#querylog-op-tbody').hide();
135            }
136        }).then(function (ajaxData) {
137            $('#querylog-tbody-loading').hide()
138            $('#querylog-tbody').html('');
139            if (ajaxData && ajaxData.code == "OK" && ajaxData.data) {
140                //查询无结果
141                if (!ajaxData.data.items || ajaxData.data.items.length <= 0) {
142                    $('#querylog-tbody').html($('#querylog-tbody-noitem-tmp').tmpl({}));
143                    $('#querylog-op-tbody').hide();
144                    return;
145                }
146                $('#querylog-tbody').html($('#querylog-tbody-tmp').tmpl({
147                    pg: ajaxData.data
148                }));
149                $('#querylog-pg-nv').html($('#querylog-pg-nv-tmp').tmpl({
150                    pg: ajaxData.data
151                }));
152                $('#querylog-op-tbody').show();
153                //tooltip
154                $('[data-tips]').each(tips_popover);
155                //分页按钮点击事件
156                $('#querylog-pg-nv').find('.page-item').unbind('click').bind('click', function (e) {
157                    e.stopPropagation();
158                    var page = $(this).attr('data-page');
159                    if (module == 'CL' || module == 'PR') {
160                        loadQueryHistoryLogs(page, module, module, id)
161                    } else {
162                        loadQueryHistoryLogs(page, module, '', id)
163                    }
164                });
165            } else {
166                swal({
167                    title: '操作失败',
168                    text: '查询历史获取失败,请稍后再试!',
169                    type: 'error'
170                });
171            }
172        });
173
174    }
175
176    // 批量输入asin start
177    // 点击批量查询弹窗
178    $('#batch-input-dialog').click(function () {
179        $('#modal-batch-input-asin').modal();
180        let asinList = $('input[name=textareaValue]').val();
181        if (asinList) {
182            getInputChange(asinList, 1);
183        }
184    });
185    // 清空弹窗内容
186    $('.button-box').on('click', '.btn-del-asin-list', function () {
187        $('#dialog-batch-input-asin').val('')
188        $('.input-tag-asins-box').find('.tag-asin').remove();
189        asinArr = [];
190        leaveAsin = dom ? 20 : 100;
191        leastAsin();
192        $('#dialog-batch-input-asin').attr('placeholder', defultText);
193    })
194
195    // 批量查询
196    $('.button-box').on('click', '.btn-batch-search', function () {
197        $('input[name=textareaValue]').val(asinArr.join(' '))
198        $('#form-condition-search').submit();
199    })
200    // 展示形式切换
201    $('.monthly-asin-grid-liebiao-btn').on('click', '.monthly-asin-grid-type', function () {
202        let type = $(this).attr('data-grid');
203        if (!$(this).hasClass('grid-is-active')) {
204            $(this).siblings().removeClass('grid-is-active');
205            $(this).addClass('grid-is-active');
206        }
207        if (type == 'liebiao') {
208            $('.input-tag-asins-box').addClass('grid-is-liebiao');
209        } else {
210            $('.input-tag-asins-box').removeClass('grid-is-liebiao');
211        }
212    })
213    // 批量输入asin end
214})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.