PageSourceSearch

https://www.etmall.com.tw/Resource/Bundle/MyHistory.js?v=fba7b96eeb63e9b457a9

js etmall.com.tw collected 2026-09-24 09:49:40 UTC 10,310 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkComponents=self.webpackChunkComponents||[]).push([[1303],{40843:function(W,A,r){r.r(A),r.d(A,{default:function(){return G}});var k=r(52675),U=r(44114),F=r(7588),K=r(83851),z=r(81278),X=r(60825),Z=r(23500),f=r(45458),E=r(23029),j=r(92901),O=r(56822),h=r(53954),C=r(85501),g=r(64467),Q=r(28706),Y=r(2008),q=r(62062),tt=r(54554),et=r(18111),at=r(22489),rt=r(61701),ot=r(79432),st=r(26099),M=r(58168),nt=r(34782),ct=r(10729),it=r(27495),lt=r(25440),J=r(76374),H=r(8131);function N(o,a){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);a&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable})),e.push.apply(e,t)}return e}function R(o){for(var a=1;a<arguments.length;a++){var e=arguments[a]!=null?arguments[a]:{};a%2?N(Object(e),!0).forEach(function(t){(0,g.A)(o,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):N(Object(e)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(e,t))})}return o}function x(o,a,e){return a=(0,h.A)(a),(0,O.A)(o,S()?Reflect.construct(a,e||[],(0,h.A)(o).constructor):a.apply(o,e))}function S(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S=function(){return!!o})()}var D=function(o){function a(e){var t;return(0,E.A)(this,a),t=x(this,a,[e]),t.state={products:{}},t}return(0,C.A)(a,o),(0,j.A)(a,[{key:"componentWillReceiveProps",value:function(t){var s=t.goodID!==this.props.goodID,n=typeof this.state.products[t.goodID]>"u";s&&n&&this._getProducts(t.goodID)}},{key:"componentDidUpdate",value:function(){this._initJcarousel()}},{key:"_initJcarousel",value:function(){$("#recommendJcarousel").jcarousel({wrap:"both"}),$("#recommendJcarousel .jcarousel-control-prev").jcarouselControl({target:"-=5"}),$("#recommendJcarousel .jcarousel-control-next").jcarouselControl({target:"+=5"})}},{key:"_getProducts",value:function(t){this.getSimilarProduct(t)}},{key:"getSimilarProduct",value:function(t){var s=this,n=this.state.products,c=10;(0,J.A)({url:"/Recommendation/GetProduct",isShowLoading:!1,data:{type:"Basket",goodIds:[t]},success:function(l){if(_.isEmpty(l))s.setState({productid:t,products:{}});else{var v=l.length>c?l.slice(0,c):l,d=R({},n);d[t]=v.map(function(y,i){var u=i<9?"0".concat(i+1):"".concat(i+1);return R(R({},y),{},{size:"150",componentClassName:"sendGA",dataCategory:"All_RecomAlsoBuy",dataAction:"All_RecomAlsoBuy_product",dataLabel:"All_RecomAlsoBuy_".concat(y.id,"_").concat(u),imageUrl:y.imageUrl.replace("_XL","_ML")})}),s.setState({productid:t,products:d})}},error:function(){}})}},{key:"_renderRecommendProducts",value:function(){var t=this.state.products[this.props.goodID];return _.isEmpty(t)?!1:(t=t.map(function(s,n){var c=s.RecName,m=s.id,l=c?JSON.stringify({click:{item_id:m,type:"rec",recname:c}}):null;return React.createElement(H.A,(0,M.A)({key:n},s,{dataDcs:l,finalPriceWrapClassName:"d-flex flex-column"}))}),t)}},{key:"render",value:function(){if(_.isEmpty(this.state.products[this.props.goodID]))return!1;var t={width:"9999em",position:"relative"};return React.createElement("ul",{className:"n-history__list n-hover--img",style:t},this._renderRecommendProducts())}}])}(React.Component);D.defaultProps={isLoadLater:"true",uid:0,pid:"",goodID:"",ch:""};var b=r(17751),I=r(79833),ut=r(15167);function B(o,a){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);a&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable})),e.push.apply(e,t)}return e}function L(o){for(var a=1;a<arguments.length;a++){var e=arguments[a]!=null?arguments[a]:{};a%2?B(Object(e),!0).forEach(function(t){(0,g.A)(o,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):B(Object(e)).forEac
1h(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(e,t))})}return o}function T(o,a,e){return a=(0,h.A)(a),(0,O.A)(o,w()?Reflect.construct(a,e||[],(0,h.A)(o).constructor):a.apply(o,e))}function w(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w=function(){return!!o})()}var p=7,G=function(o){function a(e){var t;return(0,E.A)(this,a),t=T(this,a,[e]),(0,g.A)(t,"handleClickCarouselController",function(s){var n=t.state.movement,c=(n+s)*p;t._getBrowsedProducts({start:c,clickType:s>0?"next":"prev",movement:n+s})}),t.state={current:0,productname:"",buyid:0,historyData:JSON.parse(localStorage.getItem("ProdReviewed"))||[],movement:0},t.pageGa=t.props.isShop?"Shop":"All",t}return(0,C.A)(a,o),(0,j.A)(a,[{key:"componentWillMount",value:function(){this._getBrowsedProducts({start:0,clickType:"init",movement:0})}},{key:"_initJcarousel",value:function(){this.historyJcarousel=$("#historyJcarousel").jcarousel({wrap:"both"}),$("#historyJcarousel .jcarousel-control-next").jcarouselControl({target:"+=".concat(p)}),$("#historyJcarousel .jcarousel-control-prev").jcarouselControl({target:"-=".concat(p)})}},{key:"componentDidMount",value:function(){this._initJcarousel()}},{key:"_getBrowsedProducts",value:function(t){var s=this,n=t.start,c=t.clickType,m=t.movement,l=this.state.historyData,v=(0,f.A)(l),d=v.splice(n,p).filter(function(i){return typeof i=="number"}),y=c==="prev"?p-d.length:0;d.length>0?$.ajax({url:"/Product/GetBrowsedProducts",method:"POST",dataType:"json",data:{goodids:d},success:function(u){if(u.length!==0){var P=(0,f.A)(l);P.splice.apply(P,[n+y,u.length].concat((0,f.A)(u)));var V=c==="init"?{current:0,productname:u[0].title,buyid:u[0].id}:{};s.setState(L({historyData:P,movement:m},V))}}}):this.setState({movement:m})}},{key:"_onmouseover",value:function(t){if(t.target.getAttribute("rel")!=null&&t.target.getAttribute("rel")!=this.state.current){var s=parseInt(t.target.getAttribute("rel"));this.setState({current:s,productname:this.state.historyData[s].title,buyid:this.state.historyData[s].id})}}},{key:"_renderHistoryProducts",value:function(){var t=this,s=this.state.historyData.map(function(n,c){var m;if(n){var l=c==t.state.current?"current":"",v=String.format("{0}",n.pageLink),d=String.format("mh_{0}",c),y=c<9?"_0".concat(c+1):"_".concat(c+1);return React.createElement("li",{className:l,onMouseOver:function(u){t._onmouseover(u)},rel:c,key:d},React.createElement("a",{href:v,title:n.title,target:"",className:"sendGA",rel:c,"data-category":"".concat(t.pageGa,"_RecomVisited_Product"),"data-action":"".concat(t.pageGa,"_RecomVisited_Product"),"data-label":"".concat(t.pageGa,"_RecomVisited_Product_").concat(n.id).concat(y)},React.createElement("div",{className:"n-pic",rel:c},n.isAgeRating?React.createElement("div",{className:"n-18x__mask"},React.createElement("div",{className:"n-icon--18x n-icon--18x-small"})):null,n==null||(m=n.Badges)===null||m===void 0?void 0:m.map(function(i,u){return React.createElement(I.p9,{key:"".concat(i.Text,"_").concat(u),shape:"trapezoid",text:i.Text,position:"absolute",top:"14px",left:"-5px",minWidth:b.Wn[i.Style].WIDTH,tagColor:b.Wn[i.Style].COLOR})}),React.createElement("img",{src:n.imageUrl,alt:n.title||"\u66FE\u700F\u89BD\u7684\u5546\u54C1\u5716",rel:c,style:{width:"120px",height:"120px",borderRadius:"6px"}}))))}});return s}},{key:"_renderMyhistoryRecommendProducts",value:function(){return React.createElement("div",{className:"n-history__bottom jcarousel-wrapper"},React.createElement("div",{className:"n-history__caption"},"\u8CB7\u4E86",React.createElement("span",{className:"n-pr--medium"},this.state.productname),"\u7684\u5BA2\u6236\u4E5F\u8CB7\u4E86"),React.createElement("div",{className:"n-history__body jcarousel",id:"recommendJcarousel",style:{overflow:"hidden",display:"block",height:"276px"}},React.createElement(D,{pid:this.props.pid,ch:this.props.model.cateID,goodID:this.state.buyid,isLoadLater:"true",isBigData:this.props.isBigData,uid:""}),React.createElement("button",{className:"sendGA n-l-arrow__wrap jcarousel-control-prev",title:"Prev","data-category":"All_RecomAlsoBuy","data-action":"All_RecomAlsoBuy_SwiftPage","data-label":"All_RecomAlsoBuy_SwiftPage"},React.createElement("span",{className:"n-arrow--top"}),React.createElement("span",{className:"n-arrow--bottom"})),React.createElement("button",{className:"sendGA n-r-arrow__wrap jcarousel-control-next",title:"Next","data-category":"All_RecomAlsoBuy","data-action":"All_RecomAlsoBuy_SwiftPage","data-label":"All_RecomAlsoBuy_SwiftPage"},React.createElement("span",{className:"n-arrow--top"}),React.createElement("span",{className:"n-arrow--bottom"}))))}},{key:"render",value:function(){var t=this;if(_.isEmpty(this.state.historyData))return!1;var s={width:"9999em",position:"relative",overflow:"hidden"};return React.createElement("section",{className:"n-m-bottom--sm",id:"_indexHistory"},React.createElement("div",{className:"n-title__wrap"},React.createElement("div",{className:"n-title--18"},"\u66FE\u700F\u89BD\u7684\u5546\u54C1")),React.createElement("div",{className:"n-history"},React.createElement("div",{className:"n-history__top"},React.createElement("div",{className:"n-history__body jcarousel",id:"historyJcarousel"},React.createElement("ul",{className:"n-history__list",style:s},this._renderHistoryProducts()),React.createElement("button",{className:"sendGA n-l-arrow__wrap jcarousel-control-prev",href:"javascript:;",title:"Prev","data-category":"".concat(this.pageGa,"_RecomVisited"),"data-action":"".concat(this.pageGa,"_RecomVisited_SwiftPage"),"data-label":"".concat(this.pageGa,"_RecomVisited_SwiftPage"),onClick:function(){return t.handleClickCarouselController(-1)}},React.createElement("span",{className:"n-arrow--top"}),React.createElement("span",{className:"n-arrow--bottom"})),React.createElement("button",{className:"sendGA n-r-arrow__wrap jcarousel-control-next",href:"javascript:;",title:"Next","data-category":"".concat(this.pageGa,"_RecomVisited"),"data-action":"".concat(this.pageGa,"_RecomVisited_SwiftPage"),"data-label":"".concat(this.pageGa,"_RecomVisited_SwiftPage"),onClick:function(){return t.handleClickCarouselController(1)}},React.createElement("span",{className:"n-arrow--top"}),React.createElement("span",{className:"n-arrow--bottom"})))),this._renderMyhistoryRecommendProducts()))}}])}(React.Component);G.defaultProps={pid:"",model:[],isBigData:!0,isShop:!1}}}]);

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.