-
Notifications
You must be signed in to change notification settings - Fork 0
/
70.async.js
1 lines (1 loc) · 9.92 KB
/
70.async.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[70],{86209:function(oe,R,n){n.d(R,{Z:function(){return e}});var P=n(68136),g=n(3303),c=n.n(g),U=n(51724),f={container:"container___hIX9Z",isListHover:"isListHover___B_O7Y",markerEle:"markerEle___mqH4h",markerEleText:"markerEleText___Cr1hu"},i=n(33130),y=function(v){var _=v.text,F=v.uid,b=v.price,w=v.mouseoverId,V=v.setMouseoverId,Y=v.mouseClickedId,G=v.setMouseClickedId,X=F===w,W=F===Y,Q=function(H){H.preventDefault(),V&&V(F)},$=function(H){H.preventDefault(),V&&V("")},q=function(H){H.preventDefault(),G&&G(function(ee){return ee===F?"":F})};return(0,i.jsx)("div",{className:c()(f.container,(X||W)&&f.isListHover),onClick:q,onMouseOver:Q,onMouseLeave:$,children:(0,i.jsx)("div",{className:c()(f.markerEle,(X||W)&&f.isListHover),children:(0,i.jsx)("div",{className:f.markerEleText,children:(0,U.G)(b)})})})},B=y,e=B},51724:function(oe,R,n){n.d(R,{G:function(){return P},U:function(){return c}});var P=function(f){return"".concat(f?"$".concat(f,"/\u6708"):"\u4EF7\u683C\u5F85\u8BAE")},g=[{val:1e3*60*1,text:"\u521A\u521A"},{val:1e3*60*60,text:"\u5206\u949F\u524D"},{val:1e3*60*60*24,text:"\u5C0F\u65F6\u524D"},{val:1e3*60*60*24*30,text:"\u5929\u524D"},{val:1e3*60*60*24*365,text:"\u4E2A\u6708\u524D"},{val:1e3*60*60*24*365,text:"\u5E74\u524D"}].reverse(),c=function(f){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Date,y=new Date(f).getTime(),B=new Date(i).getTime(),e=B-y,K="",v="";return g.some(function(_){if(K=_.text,v="".concat(Math.floor(e/_.val)),_.val<e)return _.val===1e3*60*1&&(v=""),!0}),"".concat(v," ").concat(K)}},39070:function(oe,R,n){n.r(R),n.d(R,{default:function(){return Fe}});var P=n(37066),g=n.n(P),c=n(68136),U=n(80063),f=n(22029),i=n.n(f),y=n(86209),B={container:"container___ZV6Fu",loading:"loading___HRQ2V",mapContainer:"mapContainer___cv8F1"},e=n(33130),K=function(t){var a=t.loading,o=t.listData,r=t.mouseoverId,j=t.setMouseoverId,h=t.mouseClickedId,I=t.setMouseClickedId,T={center:{lat:37.52666,lng:-122.08106},zoom:10.4},z=o.map(function(m){var x=i()(m,"uid",""),p=i()(m,"title",""),l=i()(m,"price",""),d=i()(m,"location_lat",0),E=i()(m,"location_lng",0);return(0,e.jsx)(y.Z,{text:p,lat:d,lng:E,price:l,uid:x,mouseoverId:r,setMouseoverId:j,mouseClickedId:h,setMouseClickedId:I},x)}),k=function(x){x.preventDefault(),j("")};return(0,e.jsxs)("div",{className:B.container,children:[a&&(0,e.jsx)("div",{className:B.loading,children:"Loading"}),!a&&(0,e.jsx)("div",{className:B.mapContainer,onMouseLeave:k,children:(0,e.jsx)(U.ZP,{bootstrapURLKeys:{key:"AIzaSyBMhjUXTNWE8oMeKFSOojf4FhBbbFRgS10"},defaultCenter:T.center,defaultZoom:T.zoom,children:z})})]})},v=K,_=v,F=n(23368),b=n.n(F),w=n(3303),V=n.n(w),Y=n(51724),G=n(76388),X={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 757.4h-53.8c-4.2 0-7.7 3.5-7.7 7.7v61.8H197.1V197.1h629.8v61.8c0 4.2 3.5 7.7 7.7 7.7h53.8c4.2 0 7.7-3.4 7.7-7.7V158.7c0-17-13.7-30.7-30.7-30.7H158.7c-17 0-30.7 13.7-30.7 30.7v706.6c0 17 13.7 30.7 30.7 30.7h706.6c17 0 30.7-13.7 30.7-30.7V765.1c0-4.3-3.5-7.7-7.7-7.7zm18.6-251.7L765 393.7c-5.3-4.2-13-.4-13 6.3v76H438c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"export",theme:"outlined"},W=X,Q=n(16518),$=function(t,a){return c.createElement(Q.Z,(0,G.Z)({},t,{ref:a,icon:W}))},q=c.forwardRef($),u={container:"container___BETZf",hLink:"hLink___TtKQx",onHover:"onHover___e4V8G",gridContainer:"gridContainer___IfRHA",picContainer:"picContainer___M7Fbs",img:"img___KheDm",title:"title___G2dlm",locationAndDate:"locationAndDate___G43SS",pricingAndLink:"pricingAndLink___HRudK",pricing:"pricing___kIbFj"},H=function(t){var a=t.list,o=a===void 0?{}:a,r=t.uid,j=t.mouseoverId,h=t.setMouseoverId,I=t.mouseClickedId,T=t.setMouseClickedId,z=i()(o,"name","--"),k=i()(o,"content","--"),m=i()(o,"price","--"),x=i()(o,"addressCity","--"),p=i()(o,"lastUpdated",""),l=p?(0,Y.U)(p):"--",d=i()(o,"imageIds[0]",""),E=d?"http://res.cloudinary.com/xinbenlv/image/upload/c_fill,g_north,w_400,h_300,g_center/".concat(d,".jpg"):"",J=r===j,A=r===I,S=function(s){s.preventDefault(),h(r)},O=function(s){s.preventDefault(),h("")},Z=function(s){s.preventDefault(),T(function(D){return D===r?"":r})},M=function(s){return function(D){D.preventDefault(),window.location.href="/client-react-io?id=".concat(s)}};return(0,e.jsxs)("div",{className:V()(u.container,(J||A)&&u.onHover),onMouseOver:S,onMouseLeave:O,onClick:Z,"list-uid":r,children:[(0,e.jsxs)("div",{className:u.gridContainer,children:[(0,e.jsx)("div",{className:u.title,children:k}),(0,e.jsxs)("div",{className:u.locationAndDate,children:[x," ",l]}),(0,e.jsxs)("div",{className:u.pricingAndLink,children:[(0,e.jsx)("div",{className:u.pricing,children:(0,Y.G)(m)}),(0,e.jsx)("div",{className:u.hLink,children:(0,e.jsx)(q,{onClick:M(r)})})]})]}),(0,e.jsx)("div",{className:u.picContainer,children:d&&(0,e.jsx)("img",{className:u.img,src:E,alt:"img"})})]})},ee=H,le=ee,ce=n(45631),de={title:"title___VK2Df"},ve=function(t){var a=t.scrollRef,o=function(){a&&(a.scrollTop=0)};return(0,e.jsx)("div",{className:de.title,onClick:o,children:(0,e.jsx)(ce.Z,{})})},ue=ve,me=ue,te={container:"container____MpL6",listContainer:"listContainer___a4C7h",loading:"loading___A9OBG"},Ee=function(t){return t.scrollHeight-t.scrollTop===t.clientHeight},fe=function(t){var a=t.name,o=t.loading,r=t.listData,j=t.mouseoverId,h=t.setMouseoverId,I=t.mouseClickedId,T=t.setMouseClickedId,z=t.onScrollBottom,k=(0,c.useRef)(),m=r.map(function(l){var d=i()(l,"uid","--");return(0,e.jsx)(le,{list:l,uid:d,mouseoverId:j,setMouseoverId:h,mouseClickedId:I,setMouseClickedId:T},d)}),x=function(d){d.preventDefault(),h("")},p=b()(function(l){var d=l.clientY,E=l.pageY,J=l.target;if(k.current){var A,S,O,Z,M,C,s=((A=l.target)===null||A===void 0||(S=A.parentElement)===null||S===void 0||(O=S.parentElement)===null||O===void 0?void 0:O.getAttribute("list-uid"))||((Z=l.target)===null||Z===void 0||(M=Z.parentElement)===null||M===void 0?void 0:M.getAttribute("list-uid"))||((C=l.target)===null||C===void 0?void 0:C.getAttribute("list-uid"));s&&z(s)}},100);return(0,e.jsxs)("div",{className:te.container,children:[o&&(0,e.jsx)("div",{className:te.loading,children:"Loading"}),!o&&(0,e.jsxs)("div",{className:te.listContainer,onMouseLeave:x,onWheel:p,ref:k,children:[m,(0,e.jsx)(me,{scrollRef:k.current})]})]})},he=fe,Ie=he,xe=n(13367),Me=n(25796),ne={title:"title____ozcv",plusIcon:"plusIcon_____WUh",searchBox:"searchBox___VFJqr"},Ce=function(t){var a=t.name;return(0,e.jsxs)("div",{className:ne.title,children:[(0,e.jsx)("div",{className:ne.plusIcon,children:(0,e.jsx)(Me.Z,{})}),(0,e.jsx)("div",{className:ne.searchBox,children:(0,e.jsx)(xe.Z,{placeholder:"\u641C\u7D22 \u533A\u57DF/\u57CE\u5E02"})})]})},ge=Ce,Le=ge,je={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 00-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 00-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 00-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0012.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]},name:"sort-ascending",theme:"outlined"},ke=je,Se=function(t,a){return c.createElement(Q.Z,(0,G.Z)({},t,{ref:a,icon:ke}))},De=c.forwardRef(Se),Ne=n(85219),ae={title:"title___b5ztX",sort:"sort___td5oV",condition:"condition___i7XL2"},Te=function(t){var a=t.name;return(0,e.jsxs)("div",{className:ae.title,children:[(0,e.jsxs)("div",{className:ae.sort,children:["\u6392\u5E8F",(0,e.jsx)(De,{})]}),(0,e.jsxs)("div",{className:ae.condition,children:["\u7B5B\u9009\u6761\u4EF6",(0,e.jsx)(Ne.Z,{})]})]})},pe=Te,Ae=pe,Oe=n(30587),N={container:"container___ulS8A",searchContainer:"searchContainer___lfrVI",filterContainer:"filterContainer___nI45l",mapContainer:"mapContainer___Onay6",listContainer:"listContainer___r5KiT",actionContainer:"actionContainer___tnjK7",contentContainer:"contentContainer___vqT1m",mouseActionInfo:"mouseActionInfo___c2nxp"},Be=!0,se=function(t,a){var o=t.sort(function(r,j){var h=i()(r,"lastUpdated",""),I=i()(j,"lastUpdated","");return new Date(h).getTime()<new Date(I).getTime()?1:-1});return[o.slice(0,a),o.slice(a)]},_e=function(){var t=(0,c.useState)(!1),a=g()(t,2),o=a[0],r=a[1],j=(0,c.useState)([]),h=g()(j,2),I=h[0],T=h[1],z=(0,c.useState)([]),k=g()(z,2),m=k[0],x=k[1],p=(0,c.useState)(""),l=g()(p,2),d=l[0],E=l[1],J=(0,c.useState)(""),A=g()(J,2),S=A[0],O=A[1];(0,c.useEffect)(function(){r(!0),fetch(Oe.I).then(function(M){return M.json()}).then(function(M){T(se(M,0)[1]);var C=se(M,100),s=g()(C,2),D=s[0],re=s[1];x(D),r(!1)})},[]);var Z=function(C){var s=I.findIndex(function(ie){return(ie==null?void 0:ie.uid)===C}),D=[];if(s){if(s>50){var re=Math.max(0,s-50),He=Math.min(s+50,I.length);D=I.slice(re,He)}else D=I.slice(0,100);x(D)}};return(0,e.jsxs)("div",{className:N.container,children:[Be&&(0,e.jsxs)("div",{className:N.mouseActionInfo,children:["---",!!d&&"Mouse Over @ ".concat(d),"---",!!S&&"Mouse Click @ ".concat(S),"---"]}),(0,e.jsxs)("div",{className:N.actionContainer,children:[(0,e.jsx)("div",{className:N.searchContainer,children:(0,e.jsx)(Le,{name:"Search"})}),(0,e.jsx)("div",{className:N.filterContainer,children:(0,e.jsx)(Ae,{name:"Filter"})})]}),(0,e.jsxs)("div",{className:N.contentContainer,children:[(0,e.jsx)("div",{className:N.mapContainer,children:(0,e.jsx)(_,{name:"MapContainer",loading:o,listData:m,mouseoverId:d,setMouseoverId:E,mouseClickedId:S,setMouseClickedId:O})}),(0,e.jsx)("div",{className:N.listContainer,children:(0,e.jsx)(Ie,{name:"List",loading:o,listData:m,mouseoverId:d,setMouseoverId:E,mouseClickedId:S,setMouseClickedId:O,onScrollBottom:Z})})]})]})},Fe=_e}}]);