PageSourceSearch

https://www.homelegance.com/r/gou/www/hmlg_v1/js_at/vueMixin/vueMixin.js?v=20260930

js homelegance.com collected 2026-10-04 21:16:32 UTC 43,868 bytes, 984 lines download raw bytes

1const compare_mixin = {
2    data: {
3        compare_timeount: {},
4        //single model compare
5        compare_single_model_checked: [],
6        compare_single_model_ids: [],
7        compare_single_models: [],
8        compare_single_datas: [],
9        compare_show_tips: false,
10        compare_show_block: false,
11        compare_dialog: false,
12
13        isCompareBtnGroupFlex: true,
14    },
15    mounted() {
16        const _self = this
17
18        this.$nextTick(() => {
19            //获取compare models
20            _self.getCompareModels();
21
22            // 监听屏幕大小
23            var Width = document.documentElement.clientWidth;
24            if (Width < 900) {
25                _self.isCompareBtnGroupFlex = false;
26            } else {
27                _self.isCompareBtnGroupFlex = true;
28            }
29        })
30
31        window.onresize = function () {
32            var Width = document.documentElement.clientWidth;
33            if (Width < 900) {
34                _self.isCompareBtnGroupFlex = false;
35            } else {
36                _self.isCompareBtnGroupFlex = true;
37            }
38        }
39    },
40    methods: {
41        /* compare method */
42        addCompareModels() {
43            //console.log("handleCompare");
44            var _self = this
45            const compare_single_datas = this.compare_single_datas;
46            let json_str = JSON.stringify(compare_single_datas);
47
48            $.ajax({
49                url: URLPrefix.url_prefix + "/addCompareModels.htm",
50                type: "post",
51                async: "false",
52                dataType: "json",
53                data: {
54                    "compare_single_models": json_str,
55                },
56                success: function (data) {
57                    if (isNotEmpty(data)) {
58                        _self.compare_single_models = data;
59                        _self.compare_show_block = true;
60                    }
61                }
62            })
63        },
64        getCompareModels() {
65            var _self = this;
66            $.ajax({
67                url: URLPrefix.url_prefix + "/getCompareModels.htm",
68                type: "post",
69                dataType: "json",
70                async: "false",
71                data: {},
72                success: function (data) {
73                    if (isNotEmpty(data)) {
74                        _self.compare_single_models = data;
75
76                        data.forEach((item, index) => {
77                            let type = item.type;
78                            let serial_no = item.serial_no;
79
80                            var model_obj = {
81                                "type": type,
82                                "serial_no": serial_no,
83                            }
84
85                            _self.compare_single_model_checked.push(serial_no);
86                            _self.compare_single_model_ids.push(serial_no);
87                            _self.compare_single_datas.push(model_obj);
88                        });
89                        _self.compare_show_block = true;
90                    }
91                }
92            })
93        },
94        handleCompare(serial_no, compare_type) {
95            if (isEmpty(compare_type)) {
96                compare_type = "model"
97            }
98            const _self = this;
99
100            var compare_single_model_ids = this.compare_single_model_ids;
101
102            var model_obj = {
103                "type": compare_type,
104                "serial_no": serial_no,
105            }
106            if (_self.array_contain(compare_single_model_ids, serial_no)) {
107                //删除该条记录
108                _self.removeCompare(serial_no);
109            } else {
110                //新增
111                if (compare_single_model_ids.length < 4) {
112                    this.compare_single_datas.push(model_obj);
113                    _self.compare_single_model_ids.push(serial_no);
114
115                    //设置compare models
116                    _self.addCompareModels();
117                } else {
118                    clearTimeout(_self.compare_timeount);
119
120                    //去除最后一个checkBox
121                    _self.compare_single_model_checked.splice(_self.compare_single_model_checked.length - 1, 1);
122
123                    //显示消息
124                    _self.compare_show_tips = true;
125
126                    _self.compare_timeount = setTimeout(function () {
127                        _self.compare_show_tips = false;
128                    }, 4000);
129                }
130            }
131        },
132        viewModelDetail(modelUrl) {
133            if (isNotEmpty(modelUrl)) {
134                location.href = __path + "/" + modelUrl;
135            }
136        },
137        removeCompare(serial_no) {
138            var _self = this;
139            var compare_single_model_ids = this.compare_single_model_ids.slice();
140
141            var index;
142            compare_single_model_ids.forEach((item, idx) => {
143                if (item == serial_no) {
144                    index = idx;
145                }
146            })
147            if (isNotEmpty(index)) {
148                this.compare_single_model_ids.splice(index, 1);
149                this.compare_single_models.splice(index, 1);
150                this.compare_single_datas.splice(index, 1);
151                this.compare_single_model_checked.splice(index, 1);
152
153                if (this.compare_single_model_ids.length == 0) {
154                    _self.compare_show_block = false;
155                }
156
157                //设置compare models
158                _self.addCompareModels();
159            }
160        },
161        hideCompareBlock() {
162            this.compare_show_block = false;
163            this.compare_show_tips = false;
164        },
165        removeAllCompare() {
166            this.compare_single_model_ids.splice(0)
167            this.compare_single_models.splice(0)
168            this.compare_single_model_checked.splice(0)
169            this.compare_single_datas.splice(0)
170
171            this.compare_show_block = false;
172            this.compare_show_tips = false;
173
174            this.addCompareModels();
175        },
176        compareModels() {
177            var compare_url = __path + "/compareModels.htm";
178            window.open(compare_url);
179        },
180        array_contain(array, obj) {
181            for (var i = 0; i < array.length; i++) {
182                if (array[i] == obj)//如果要求数据类型也一致,这里可使用恒等号===
183                    return true;
184            }
185            return false;
186        },
187
188        //quote
189        handleAddQuote(serial_no, product_id, quote_type) {
190            // console.log(serial_no, product_id, quote_type);
191            $.ajax({
192                url: URLPrefix.url_prefix + "/nmember/addQuoteSheet.htm",
193                type: "post",
194                async: "false",
195                dataType: "json",
196                data: {
197                    websiteId: URLPrefix.website_id,
198                    product_id: product_id,
199                    serial_no: serial_no,
200                    quote_type: quote_type
201                },
202                success: function (res) {
203                    const code = res.code
204                    const success = res.success
205                    const message = res.message
206                    if (code === 20000) {
207                        showMessageTips(message, "success");
208
209                        $("#quoteSheets").click();
210                    } else {
211                        showMessageTips(message, "warning");
212                    }
213                }
214            })
215        },
216        
217        //removeBackInStock(
218        removeBackInStock(product_id) {
219			var _self = this
220            $.ajax({
221                url: URLPrefix.url_prefix + "/member/removeArrivalStockNotice",
222                type: "post",
223                async: "false",
224                dataType: "json",
225                data: {
226                    product_id: product_id,
227                },
228                 beforeSend: function () {
229                    _self._loadingOpen();
230                },
231                success: function (res) {
232                    const code = res.code
233                    if (code === 20000) {
234                        showMessageTips("Remove successful", "success");
235
236                        location.href = location.href;
237                    } else {
238                        showMessageTips("Remove failed", "warning");
239                    }
240                },
241                complete: function () {
242                    _self._loadingClose();
243                }
244            })
245        }
246    }
247}
248const product_inquiry_mixin = {
249    data: {
250        websiteId: URLPrefix.website_id,
251        base: URLPrefix.url_prefix,
252        webSite_name: URLPrefix.website_name,
253        /* ProductInquiry */
254        remoteLoading: false,
255        fullscreenLoading: false,
256        showSmallSize: false,
257        modelName: '',
258        dialogProductInquiryVisible: false,
259        inquiry_tableData: [],
260        tableHeaderColumn: [{ "is_disabled": true, "name": "action", "width": 50, "label": "SN", "type": "sn", "text_align": "center" }, { "name": "fash_name", "width": 120, "label": "Model", "type": "text_click", "click": "quickViewModel", "text_align": "center" }, { "name": "fash_description", "width": 300, "label": "Description", "type": "text", "text_align": "left" }, { "name": "current_can_sell", "width": 110, "label": "Availability", "type": "text", "text_align": "center" }, { "name": "apo", "width": 160, "label": "Confirmed", "type": "html", "text_align": "center" }, { "name": "bpo", "width": 160, "label": "Estimated?", "type": "html", "text_align": "center" }, { "name": "cbf", "width": 80, "label": "Cuft", "type": "double_2", "text_align": "center" }, { "name": "weight", "width": 80, "label": "Weight", "type": "double_2", "text_align": "center" }, { "name": "mpack", "width": 140, "label": "Piece per Carton", "type": "text", "text_align": "center" }],
261        tableHeaderColumn_local: [{ "is_disabled": true, "name": "action", "width": 50, "label": "SN", "type": "sn", "text_align": "center" }, { "name": "fash_name", "width": 120, "label": "Model", "type": "text_click", "click": "quickViewModel", "text_align": "center" }, { "name": "fash_description", "width": 300, "label": "Description", "type": "text", "text_align": "left" }, { "name": "current_can_sell", "width": 110, "label": "Availability", "type": "text", "text_align": "center" }, { "name": "apo", "width": 160, "label": "Confirmed", "type": "html", "text_align": "center" }, { "name": "bpo", "width": 160, "label": "Estimated?", "type": "html", "text_align": "center" }, { "name": "cbf", "width": 80, "label": "Cuft", "type": "double_2", "text_align": "center" }, { "name": "weight", "width": 80, "label": "Weight", "type": "double_2", "text_align": "center" }, { "name": "mpack", "width": 140, "label": "Piece per Carton", "type": "text", "text_align": "center" }],
262        tableHeaderColumn_remote_bo: [{"is_disabled":true,"name":"action","width":50,"label":"SN","type":"sn","text_align":"center"},{"name":"fash_name","width":120,"label":"Model","type":"text_click","click":"quickViewModel","text_align":"center"},{"name":"fash_description","width":300,"label":"Description","type":"text","text_align":"left"},{"name":"current_can_sell","width":110,"label":"Availability","type":"text","text_align":"center"},{"name":"aga_apo","width":160,"label":"Confirmed","type":"html","text_align":"center"},{"name":"cbf","width":80,"label":"Cuft","type":"double_2","text_align":"center"},{"name":"weight","width":80,"label":"Weight","type":"double_2","text_align":"center"},{"name":"mpack","width":140,"label":"Piece per Carton","type":"text","text_align":"center"}],
263        
264    },
265    methods: {
266        _loadingOpen: function () {
267            this.fullscreenLoading = true;
268        },
269        _loadingClose: function () {
270            this.fullscreenLoading = false;
271        },
272        formatNumber: function (number, decimals) {
273            return formatMoney(number, decimals);
274        },
275        // 设置表格中每行的唯一ID
276        setListTableRowKey: function (row) {
277            if (row.row_key) {
278                if (row.product_id) row.row_key = row.product_id;
279                return row.row_key;
280            }
281            var id =
282                (Math.random() * 10000000).toString(16).substr(0, 4) +
283                "-" +
284                new Date().getTime() +
285                "-" +
286                Math.random()
287                    .toString()
288                    .substr(2, 5);
289            row.row_key = id;
290            return id;
291        },
292        searchProductInquiry: function (model_name, inquiry_type) {
293            var _self = this;
294
295			if(isEmpty(inquiry_type) || inquiry_type == "local") {
296				inquiry_type = "local"
297				_self.tableHeaderColumn = _self.tableHeaderColumn_local
298			} else {
299				_self.tableHeaderColumn = _self.tableHeaderColumn_remote_bo				
300			}
301            _self.modelName = model_name;
302            $.ajax({
303                url: _self.base + "/nmember/searchTableData.htm",
304                type: "post",
305                dataType: "json",
306                data: {
307                    "websiteId": _self.websiteId,
308                    "tableType": 2,
309                    "fash_name": _self.modelName,
310                    "status": "IN",
311                    "query_matching_type": 1,
312                    "warehouse_id": 1,
313                    "inquiry_type": inquiry_type
314                },
315                beforeSend: function () {
316                    _self._loadingOpen();
317                },
318                success: function (data) {
319                    if (isNotEmpty(data.tableData)) {
320                        _self.inquiry_tableData = data.tableData;
321
322                        _self.dialogProductInquiryVisible = true;
323                    } else {
324                        showMessageTips("No product inquiry", "info")
325                        _self.dialogProductInquiryVisible = false;
326                    }
327                },
328                complete: function () {
329                    _self._loadingClose();
330                },
331            })
332        },
333        searchProductInquiry_mixed: function (model_name) {
334            var _self = this;
335            _self.modelName = model_name;
336
337            const search_from = custom_url_obj.get("search_from")
338            const wh_type = custom_url_obj.get("wh_type")
339            const show_ctg_id = custom_url_obj.get("show_ctg_id")
340
341            $.ajax({
342                url: _self.base + "/mixedWH/getMixedProductInquiry",
343                type: "post",
344                dataType: "json",
345                data: {
346                    "websiteId": _self.websiteId,
347                    "tableType": 2,
348                    "model_name": _self.modelName,
349                    "status": "IN",
350                    "warehouse_id": _self.warehouse_id,
351                    "search_from": search_from,
352                    "wh_type": wh_type,
353                    "show_ctg_id": show_ctg_id
354                },
355                beforeSend: function () {
356                    _self._loadingOpen();
357                },
358                success: function (data) {
359                    if (isNotEmpty(data.tableData)) {
360                        _self.inquiry_tableData = data.tableData;
361                        _self.dialogProductInquiryVisible = true;
362                    } else {
363                        showMessageTips("No product inquiry", "info")
364                        _self.dialogProductInquiryVisible = false;
365                    }
366                },
367                complete: function () {
368                    _self._loadingClose();
369                },
370            })
371        },
372        quickViewModel: function (event, index) {
373            var _self = this
374            var current_row = this.inquiry_tableData[index];
375            var modelName = current_row.fash_name;
376
377            if (isNotEmpty(modelName)) {
378                $.ajax({
379                    url: __path + "/getPorductModalData.htm",
380                    type: "post",
381                    dataType: "json",
382                    data: {
383                        model_name: modelName
384                    },
385                    beforeSend: function () {
386                        $("#ajax_wait").show();
387                    },
388                    success: function (data) {
389                        if (data.result == "0") {
390                            alert("Model does not support quick viewing.");
391                        } else if (data.result == "1") {
392                            var url = __path + data.redirect_url;
393                            var redirect_url = __path + data.redirect_url;
394                            var modalType = data.modalType;
395
396                            setQuickViewModal(url, redirect_url, modalType, () => {
397                                _self.dialogProductInquiryVisible = false;
398                            })
399                        }
400                    },
401                    complete: function () {
402                        $("#ajax_wait").hide();
403                    }
404                });
405            }
406        },
407    }
408}
409const singlemodel_detail_mixin = {
410    data: {
411        websiteId: URLPrefix.website_id,
412        base: URLPrefix.url_prefix,
413        webSite_name: URLPrefix.website_name,
414        availability_label: 'Availability',
415        hmlg_stock_label: '',
416
417        tableData: [],
418        quantity: '',
419
420        price_label: 'Price',
421        original_price_label: 'Special Price',
422
423        show_promotion_price: false,
424
425        is_login: URLPrefix.isLogin + '',
426        is_msrp: false,
427        is_staff: false,
428
429        relateItemData: [],
430        seeMoreCollectItemData: [],
431
432        //arrivalStockNotice
433        isBellHovering: false,
434        isArrivalStockAdded: false
435    },
436    methods: {
437        formatNumber: function (number, decimals) {
438            return formatMoney(number, decimals);
439        },
440        _dealPageData: function () {
441            if (isNotEmpty(this.resultData)) {
442                var result_data = this.resultData;
443
444                //console.log(result_data);
445                var tableData = result_data.tableData;
446                var show_promotion_price = false;
447
448                $.each(tableData, function (i, v) {
449                    var price = v.price;
450                    var price_really = v.price_really;
451                    var original_price = v.original_price;
452
453                    if (!show_promotion_price
454                        && isNotEmpty(price) && isNotEmpty(original_price)
455                        && parseFloat(price_really) < parseFloat(original_price)) {
456                        show_promotion_price = true;
457                    }
458                })
459
460                this.tableData = result_data.tableData;
461                this.show_promotion_price = show_promotion_price;
462
463                this.price_label = result_data.price_label;
464                this.original_price_label = result_data.original_price_label;
465            }
466        },
467        setRelatedProducts: function (count) {
468            var _self = this
469            var modelName = $("#product_name").val();
470            var catalogSerialNo = $("#catalogSerialNo").val();
471            var categoryPath = $("#categoryPath").val();
472
473            $.ajax({
474                url: __path + "/getRelateProductHmlg.htm?rand=" + Math.random(),
475                data: {
476                    catalogSerialNo: catalogSerialNo,
477                    count: count,
478                    modelName: modelName,
479                    categoryPath: categoryPath,
480                },
481                dataType: "json",
482                type: "post",
483                async: "false",
484                beforeSend: function () {
485                    $("#relateItemDiv").hide();
486                },
487                success: function (data) {
488                    if (data && data.length > 0) {
489                        $("#relateItemDivWrapper").show()
490
491                        _self.relateItemData.splice(0)
492                        data.forEach(item => {
493                            let item_url = __path + '/' + item.url
494                            if (item.is_collection) {
495                            } else {
496                                item_url = item_url.replace(".htm", "/")
497                            }
498                            let picture_path = __path + item.pic_path
499                            let name = item.name
500                            let model_serial_no = item.model_serial_no
501
502                            _self.relateItemData.push({
503                                url: item_url,
504                                pic_path: picture_path,
505                                name: name,
506                                model_serial_no
507                            })
508                        })
509
510                        /* 初始化 relatedContent*/
511                        _self.$nextTick(() => {
512                            relatedContent = new Swiper(".related-content", {
513                                spaceBetween: 10,
514                                navigation: {
515                                    nextEl: ".related-box-next",
516                                    prevEl: ".related-box-prev",
517                                },
518                                preventClicksPropagation: false,
519                                slidesPerView: 5,
520                                freeMode: true,
521                                watchSlidesVisibility: true,
522                                watchSlidesProgress: true,
523                                breakpoints: {
524                                    1200: {  //当屏幕宽度大于于等于1200
525                                        slidesPerView: 5,
526                                    },
527                                    768: {  //当屏幕宽度大于于等于768
528                                        slidesPerView: 4,
529                                    },
530                                    576: {  //当屏幕宽度大于于等于576
531                                        slidesPerView: 3,
532                                    },
533                                    320: {  //当屏幕宽度大于等于320
534                                        slidesPerView: 2,
535                                    },
536                                },
537                            });
538                            setQuickViewBtn()
539                        })
540                    } else {
541                        $("#relateItemDivWrapper").hide()
542                    }
543                },
544                complete: function () {
545                    $("#relateItemDiv").show();
546                }
547            });
548        },
549        //seeMoreCollect
550        setSeeMoreCollects: function (count) {
551            //同collection的single model
552            var _self = this
553            var modelName = $("#product_name").val();
554            var catalogSerialNo = $("#catalogSerialNo").val();
555            var categoryPath = $("#categoryPath").val();
556
557            $.ajax({
558                url: __path + "/getRelateProductHmlg.htm?rand=" + Math.random(),
559                data: {
560                    catalogSerialNo: catalogSerialNo,
561                    count: count,
562                    modelName: modelName,
563                    related_by: "collection_name",
564                },
565                dataType: "json",
566                type: "post",
567                async: "false",
568                beforeSend: function () {
569                    $("#see_more_collectItemDiv").hide();
570                },
571                success: function (data) {
572                    if (data && data.length > 0) {
573                        $("#see_more_collectItemDivWrapper").show()
574
575                        _self.seeMoreCollectItemData.splice(0)
576                        data.forEach(item => {
577                            let item_url = __path + '/' + item.url
578                            if (item.is_collection) {
579                            } else {
580                                item_url = item_url.replace(".htm", "/")
581                            }
582                            let picture_path = __path + item.pic_path
583                            let name = item.name
584                            let model_serial_no = item.model_serial_no
585
586                            _self.seeMoreCollectItemData.push({
587                                url: item_url,
588                                pic_path: picture_path,
589                                name: name,
590                                model_serial_no
591                            })
592                        })
593
594                        /* 初始化 seeMoreCollectionContent*/
595                        _self.$nextTick(() => {
596                            seeMoreCollectionContent = new Swiper(".see_more_collect-content", {
597                                spaceBetween: 10,
598                                navigation: {
599                                    nextEl: ".see_more_collect-box-next",
600                                    prevEl: ".see_more_collect-box-prev",
601                                },
602                                preventClicksPropagation: false,
603                                slidesPerView: 5,
604                                freeMode: true,
605                                watchSlidesVisibility: true,
606                                watchSlidesProgress: true,
607                                breakpoints: {
608                                    1200: {  //当屏幕宽度大于于等于1200
609                                        slidesPerView: 5,
610                                    },
611                                    768: {  //当屏幕宽度大于于等于768
612                                        slidesPerView: 4,
613                                    },
614                                    576: {  //当屏幕宽度大于于等于576
615                                        slidesPerView: 3,
616                                    },
617                                    320: {  //当屏幕宽度大于等于320
618                                        slidesPerView: 2,
619                                    },
620                                },
621                            });
622
623                            setQuickViewBtn()
624                        })
625                    } else {
626                        $("#see_more_collectItemDivWrapper").hide()
627                    }
628                },
629                complete: function () {
630                    $("#see_more_collectItemDiv").show();
631                }
632            });
633        },
634        checkModelStatus: function (modelName) {
635            var _self = this
636            var is_checked = true
637            if (_self.isModelNotExists === true) {
638                //model不存在
639                var tips_msg = modelName + " does not exists.";
640                showMessageTips(tips_msg, "warning");
641                is_checked = false
642            } else if (_self.isHasInventory === true) {
643                //model当前有货
644                var tips_msg = modelName + " has inventory.";
645                showMessageTips(tips_msg, "warning");
646                is_checked = false
647            } else if (_self.isArrivalStockAdded === true) {
648                //到货提醒已经存在
649                var tips_msg = modelName + " has been added.";
650                showMessageTips(tips_msg, "warning");
651                is_checked = false
652            }
653            return is_checked
654        },
655        //arrivalStockNotice
656        addArrivalStockNotice: function (productId, modelName) {
657            var _self = this
658
659            if (this.checkModelStatus(modelName)) {
660                var url = __path + "/member/addArrivalStockNotice"
661                var params = {
662                    product_id: productId
663                }
664                send_post_ajax_request(url, params, (res) => {
665                    var code = res.code
666                    if (code == "50008") {
667                        //重新登录
668                        location.href = __path + "/member/login.htm"
669                    } else {
670                        var data = res.data
671                        var status = data.status
672                        if (status === -1) {
673                            //model不存在
674                            var tips_msg = modelName + " does not exists.";
675                            showMessageTips(tips_msg, "warning");
676                            _self.isModelNotExists = true
677                        } else if (status === 0) {
678                            //model当前有货
679                            var tips_msg = modelName + " has inventory.";
680                            showMessageTips(tips_msg, "warning");
681                            _self.isHasInventory = true
682                        } else if (status === 1) {
683                            //添加成功
684                            var tips_msg = "We will notify you through email and dashboard when " + modelName + " is back in stock.";
685                            showMessageTips(tips_msg, "success");
686                            _self.isArrivalStockAdded = true
687                        } else if (status === 2) {
688                            //到货提醒已经存在
689                            var tips_msg = modelName + " has been added.";
690                            showMessageTips(tips_msg, "warning");
691                            _self.isArrivalStockAdded = true
692                        }
693                    }
694                })
695            }
696        }
697    }
698}
699
700const collection_detail_mixin = {
701    data: {
702        websiteId: URLPrefix.website_id,
703        base: URLPrefix.url_prefix,
704        webSite_name: URLPrefix.website_name,
705        availability_label: 'Availability',
706        hmlg_stock_label: '',
707
708        tableData: [],
709        quantity: '',
710
711        price_label: 'Price',
712        original_price_label: 'Special Price',
713
714        show_promotion_price: false,
715
716        is_login: URLPrefix.isLogin + '',
717        is_msrp: false,
718        is_staff: false,
719
720        relateItemData: [],
721        /* ProductInquiry */
722        modelName: '',
723        remoteLoading: false,
724
725        dialogProductInquiryVisible: false,
726
727        inquiry_tableData: [],
728        tableHeaderColumn: [{ "is_disabled": true, "name": "action", "width": 50, "label": "SN", "type": "sn", "text_align": "center" }, { "name": "fash_name", "width": 120, "label": "Model", "type": "text_click", "click": "quickViewModel", "text_align": "center" }, { "name": "fash_description", "width": 300, "label": "Description", "type": "text", "text_align": "left" }, { "name": "current_can_sell", "width": 110, "label": "Availability", "type": "text", "text_align": "center" }, { "name": "apo", "width": 160, "label": "Confirmed", "type": "html", "text_align": "center" }, { "name": "bpo", "width": 160, "label": "Estimated?", "type": "html", "text_align": "center" }, { "name": "cbf", "width": 80, "label": "Cuft", "type": "double_2", "text_align": "center" }, { "name": "weight", "width": 80, "label": "Weight", "type": "double_2", "text_align": "center" }, { "name": "mpack", "width": 140, "label": "Piece per Carton", "type": "text", "text_align": "center" }],
729        tableHeaderColumn_local: [{ "is_disabled": true, "name": "action", "width": 50, "label": "SN", "type": "sn", "text_align": "center" }, { "name": "fash_name", "width": 120, "label": "Model", "type": "text_click", "click": "quickViewModel", "text_align": "center" }, { "name": "fash_description", "width": 300, "label": "Description", "type": "text", "text_align": "left" }, { "name": "current_can_sell", "width": 110, "label": "Availability", "type": "text", "text_align": "center" }, { "name": "apo", "width": 160, "label": "Confirmed", "type": "html", "text_align": "center" }, { "name": "bpo", "width": 160, "label": "Estimated?", "type": "html", "text_align": "center" }, { "name": "cbf", "width": 80, "label": "Cuft", "type": "double_2", "text_align": "center" }, { "name": "weight", "width": 80, "label": "Weight", "type": "double_2", "text_align": "center" }, { "name": "mpack", "width": 140, "label": "Piece per Carton", "type": "text", "text_align": "center" }],
730        tableHeaderColumn_remote_bo: [{"is_disabled":true,"name":"action","width":50,"label":"SN","type":"sn","text_align":"center"},{"name":"fash_name","width":120,"label":"Model","type":"text_click","click":"quickViewModel","text_align":"center"},{"name":"fash_description","width":300,"label":"Description","type":"text","text_align":"left"},{"name":"current_can_sell","width":110,"label":"Availability","type":"text","text_align":"center"},{"name":"apo","width":160,"label":"Confirmed","type":"html","text_align":"center"},{"name":"cbf","width":80,"label":"Cuft","type":"double_2","text_align":"center"},{"name":"weight","width":80,"label":"Weight","type":"double_2","text_align":"center"},{"name":"mpack","width":140,"label":"Piece per Carton","type":"text","text_align":"center"}],
731        showSmallSize: false,
732
733        master_model_mode_visible: false
734    },
735    methods: {
736        formatNumber: function (number, decimals) {
737            return formatMoney(number, decimals);
738        },
739        // 设置表格中每行的唯一ID
740        setListTableRowKey: function (row) {
741            if (row.row_key) {
742                if (row.product_id) row.row_key = row.product_id;
743                return row.row_key;
744            }
745            var id =
746                (Math.random() * 10000000).toString(16).substr(0, 4) +
747                "-" +
748                new Date().getTime() +
749                "-" +
750                Math.random()
751                    .toString()
752                    .substr(2, 5);
753            row.row_key = id;
754            return id;
755        },
756        _dealPageData: function () {
757            if (isNotEmpty(this.resultData)) {
758                var result_data = this.resultData;
759
760                //console.log(result_data);
761                var tableData_ary = []
762                var tableData = result_data.tableData;
763                var show_promotion_price = false;
764
765                const search_from = custom_url_obj.get("search_from")
766                const wh_type = custom_url_obj.get("wh_type")
767                const show_ctg_id = custom_url_obj.get("show_ctg_id")
768
769                $.each(tableData, function (i, v) {
770                    var price = v.price;
771                    var price_really = v.price_really;
772                    var original_price = v.original_price;
773
774                    if (!show_promotion_price
775                        && isNotEmpty(price) && isNotEmpty(original_price)
776                        && parseFloat(price_really) < parseFloat(original_price)) {
777                        show_promotion_price = true;
778                    }
779
780                    if (isNotEmpty(v.url) && isNotEmpty(search_from) && search_from == "wh") {
781                        var url_obj = new objURL(v.url)
782                        url_obj.set("search_from", search_from);
783                        url_obj.set("wh_type", wh_type);
784                        url_obj.set("show_ctg_id", show_ctg_id);
785                        v.url = url_obj.url()
786                    }
787                    tableData_ary.push(v)
788                })
789
790                this.tableData = tableData_ary;
791                this.show_promotion_price = show_promotion_price;
792
793                this.availability_label = result_data.availability_label;
794                this.hmlg_stock_label = result_data.hmlg_stock_label;
795
796                this.price_label = result_data.price_label;
797                this.original_price_label = result_data.original_price_label;
798            }
799        },
800        inputFocus(event) {
801            event.currentTarget.select();
802        },
803        quantityHandleChange(index, scope_row) {
804            var _self = this;
805            //检查库存
806            /* 检查库存 */
807            var product_id = scope_row.product_id;
808            var quantity = scope_row.quantity;
809            var mpack = scope_row.mpack;
810
811            if (checkMpack(mpack, quantity)) {
812                checkStock_new(product_id, quantity, 0, function () {
813
814                }, function () {
815                    scope_row.quantity = '';
816                }, function () { });
817            } else {
818                _self.$nextTick(function () {
819                    _self.tableData[index]['quantity'] = mpack;
820                })
821            }
822        },
823        addToCart(index) {
824            var _self = this;
825            var product_ids = [];
826            var item_qtys = [];
827
828            var tableData = this.tableData;
829            tableData.forEach((item) => {
830                let quantity = item.quantity
831                let product_id = item.product_id
832
833                if (isNotEmpty(quantity) && isNotEmpty(product_id)
834                    && parseInt(quantity) > 0) {
835                    product_ids.push(product_id)
836                    item_qtys.push(quantity)
837                }
838            })
839
840            if (product_ids.length > 0 && item_qtys.length > 0) {
841                add_to_cart_ajax(product_ids.join(","), item_qtys.join(","), () => {
842                    tableData.forEach((item) => {
843                        if (item.quantity > 0) {
844                            item.quantity = 0
845                        }
846                    })
847                });
848            } else {
849				showMessageTips("Please input quantity", "warning");
850			}
851        },
852        blurModelContainerQty(row) {
853            var _self = this;
854            var qty = row.quantity;
855
856            if (qty > 0) {
857                var model_name = row.model;
858                var mpack = row.mpack;
859
860                checkMixedMasterModelMpack(qty, mpack, function () {
861                    var tips_msg = "Model '" + model_name + "'<br/>Master Pack is " + mpack;
862                    showMessageTips(tips_msg, "warning");
863
864                    row.quantity = mpack + "";
865                });
866            }
867        },
868        add_to_container(index) {
869            var _self = this;
870            var product_ids = [];
871            var item_qtys = [];
872
873            var tableData = this.tableData;
874            tableData.forEach((item) => {
875                let quantity = item.quantity
876                let product_id = item.product_id
877
878                if (isNotEmpty(quantity) && isNotEmpty(product_id)
879                    && parseInt(quantity) > 0) {
880                    product_ids.push(product_id)
881                    item_qtys.push(quantity)
882                    item.quantity = 0
883                }
884            })
885            if (isNotEmpty(product_ids) && isNotEmpty(item_qtys)) {
886                addToContainers(product_ids.join(","), item_qtys.join(","));
887            }
888        },
889        //related
890        setRelatedProducts(count) {
891            var collectionSerialNo = $("#collectionSerialNo").val();
892            var _self = this
893
894            $.ajax({
895                url: __path + "/getRelateProductHmlg.htm?rand=" + Math.random(),
896                data: {
897                    collectionSerialNo: collectionSerialNo,
898                    count: count,
899                },
900                dataType: "json",
901                type: "post",
902                async: "false",
903                beforeSend: function () {
904                    $("#relateItemDiv").hide();
905                },
906                success: function (data) {
907                    if (data && data.length > 0) {
908                        $("#relateItemDivWrapper").show()
909                        $("#related_prdoucts_div").show();
910
911                        _self.relateItemData.splice(0)
912
913                        const search_from = custom_url_obj.get("search_from")
914                        const wh_type = custom_url_obj.get("wh_type")
915                        const show_ctg_id = custom_url_obj.get("show_ctg_id")
916
917                        data.forEach(item => {
918                            if (isNotEmpty(search_from) && search_from == "wh") {
919                                var item_url_obj = new objURL(item.url);
920
921                                item_url_obj.set("search_from", search_from)
922                                item_url_obj.set("wh_type", wh_type)
923                                item_url_obj.set("show_ctg_id", show_ctg_id)
924                                item.url = item_url_obj.url()
925                            }
926                            let is_single_model = item.is_single_model
927                            let item_url = __path + '/' + item.url
928                            let item_m_url = __path + '/' + item.url.replace('.htm', '/')
929                            let picture_path = __path + item.picture_path
930                            let name = item.name
931                            let serial_no = item.collection_serial_no
932
933                            _self.relateItemData.push({
934                                is_single_model,
935                                item_url,
936                                item_m_url,
937                                picture_path,
938                                name,
939                                serial_no
940                            })
941                        })
942
943                        /* 初始化 relatedContent*/
944                        _self.$nextTick(() => {
945                            relatedContent = new Swiper(".related-content", {
946                                spaceBetween: 10,
947                                navigation: {
948                                    nextEl: ".related-box-next",
949                                    prevEl: ".related-box-prev",
950                                },
951                                preventClicksPropagation: false,
952                                slidesPerView: 5,
953                                freeMode: true,
954                                watchSlidesVisibility: true,
955                                watchSlidesProgress: true,
956                                breakpoints: {
957                                    1200: {  //当屏幕宽度大于于等于1200
958                                        slidesPerView: 5,
959                                    },
960                                    768: {  //当屏幕宽度大于于等于768
961                                        slidesPerView: 4,
962                                    },
963                                    576: {  //当屏幕宽度大于于等于576
964                                        slidesPerView: 3,
965                                    },
966                                    320: {  //当屏幕宽度大于等于320
967                                        slidesPerView: 2,
968                                    },
969                                },
970                            });
971
972                            setQuickViewBtn()
973                        })
974                    } else {
975                        $("#relateItemDivWrapper").hide()
976                    }
977                },
978                complete: function () {
979                    $("#relateItemDiv").show();
980                }
981            });
982        }
983    }
984}

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.