2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-50b4ae97"],{"07ac":function(e,t,n){var i=n("23e7"),a=n("6f53").values;i({target:"Object",stat:!0},{values:function(e){return a(e)}})},"08a9":function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"viewer-fade"}},[n("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":e.zIndex},attrs:{tabindex:"-1"}},[n("div",{staticClass:"el-image-viewer__mask",on:{click:function(t){return t.target!==t.currentTarget?null:e.handleMaskClick(t)}}}),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:e.hide}},[n("i",{staticClass:"el-icon-close"})]),e.isSingle?e._e():[n("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!e.infinite&&e.isFirst},on:{click:e.prev}},[n("i",{staticClass:"el-icon-arrow-left"})]),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!e.infinite&&e.isLast},on:{click:e.next}},[n("i",{staticClass:"el-icon-arrow-right"})])],n("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[n("div",{staticClass:"el-image-viewer__actions__inner"},[n("i",{staticClass:"el-icon-zoom-out",on:{click:function(t){return e.handleActions("zoomOut")}}}),n("i",{staticClass:"el-icon-zoom-in",on:{click:function(t){return e.handleActions("zoomIn")}}}),n("i",{staticClass:"el-image-viewer__actions__divider"}),n("i",{class:e.mode.icon,on:{click:e.toggleMode}}),n("i",{staticClass:"el-image-viewer__actions__divider"}),n("i",{staticClass:"el-icon-refresh-left",on:{click:function(t){return e.handleActions("anticlocelise")}}}),n("i",{staticClass:"el-icon-refresh-right",on:{click:function(t){return e.handleActions("clocelise")}}})])]),n("div",{staticClass:"el-image-viewer__canvas"},e._l(e.urlList,(function(t,i){return i===e.index?n("img",{key:t,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:e.imgStyle,attrs:{src:e.currentImg},on:{load:e.handleImgLoad,error:e.handleImgError,mousedown:e.handleMouseDown}}):e._e()})),0)],2)])},a=[],o=n("5530"),s=(n("a9e3"),n("99af"),n("b64b"),n("07ac"),n("c975"),n("acd8"),n("b680"),n("2b0e"));const r=s["default"].prototype.$isServer,c=(r||Number(document.documentMode),function(){return!r&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent("on"+t,n)}}()),l=function(){return!r&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent("on"+t,n)}}();Object.prototype.hasOwnProperty;const u=function(){return!s["default"].prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)};function d(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(i=>{e.apply(this,n),t=!1}))}}var h={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},f=u()?"DOMMouseScroll":"mousewheel",p={name:"elImageViewer",props:{urlList:{type:Array,default:function(){return[]}},zIndex:{type:Number,default:2e3},onSwitch:{type:Function,default:function(){}},onClose:{type:Function,default:function(){}},initialIndex:{type:Number,default:0},appendToBody:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0}},data:function(){return{index:this.initialIndex,isShow:!1,infinite:!0,loading:!1,mode:h.CONTAIN,transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}},computed:{isSingle:function(){return this.urlList.length<=1},isFirst:function(){return 0===this.index},isLast:function(){return this.index===this.urlList.length-1},currentImg:function(){return this.urlList[this.index]},imgStyle:function(){var e=this.transform,t=e.scale,n=e.deg,i=e.offsetX,a=e.offsetY,o=e.enableTransition,s={transform:"scale(".concat(t,") rotate(").concat(n,"deg)"),transition:o?"transform .3s":"","margin-left":"".concat(i,"px"),"margin-top":"".concat(a,"px")};return this.mode===h.CONTAIN&&(s.maxWidth=s.maxHeight="100%"),s}},watch:{index:{handler:function(e){this.reset(),this.onSwitch(e)}},currentImg:function(e){var t=this;this.$nextTick((function(e){var n=t.$refs.img[0];n.complete||(t.loading=!0)}))}},methods:{hide:function(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall:function(){var e=this;this._keyDownHandler=d((function(t){var n=t.keyCode;switch(n){case 27:e.hide();break;case 32:e.toggleMode();break;case 37:e.prev();break;case 38:e.handleActions("zoomIn");break;case 39:e.next();break;case 40:e.handleActions("zoomOut");break}})),this._mouseWheelHandler=d((function(t){var n=t.wheelDelta?t.wheelDelta:-t.detail;n>0?e.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):e.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})})),c(document,"keydown",this._keyDownHandler),c(document,f,this._mouseWheelHandler)},deviceSupportUninstall:function(){l(document,"keydown",this._keyDownHandler),l(document,f,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad:function(e){this.loading=!1},handleImgError:function(e){this.loading=!1,e.target.alt="加载失败"},handleMouseDown:function(e){var t=this;if(!this.loading&&0===e.button){var n=this.transform,i=n.offsetX,a=n.offsetY,o=e.pageX,s=e.pageY;this._dragHandler=d((function(e){t.transform.offsetX=i+e.pageX-o,t.transform.offsetY=a+e.pageY-s})),c(document,"mousemove",this._dragHandler),c(document,"mouseup",(function(e){l(document,"mousemove",t._dragHandler)})),e.preventDefault()}},handleMaskClick:function(){this.maskClosable&&this.hide()},reset:function(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode:function(){if(!this.loading){var e=Object.keys(h),t=Object.values(h),n=t.indexOf(this.mode),i=(n+1)%e.length;this.mode=h[e[i]],this.reset()}},prev:function(){if(!this.isFirst||this.infinite){var e=this.urlList.length;this.index=(this.index-1+e)%e}},next:function(){if(!this.isLast||this.infinite){var e=this.urlList.length;this.index=(this.index+1)%e}},handleActions:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.loading){var n=Object(o["a"])({zoomRate:.2,rotateDeg:90,enableTransition:!0},t),i=n.zoomRate,a=n.rotateDeg,s=n.enableTransition,r=this.transform;switch(e){case"zoomOut":r.scale>.2&&(r.scale=parseFloat((r.scale-i).toFixed(3)));break;case"zoomIn":r.scale=parseFloat((r.scale+i).toFixed(3));break;case"clocelise":r.deg+=a;break;case"anticlocelise":r.deg-=a;break}r.enableTransition=s}}},mounted:function(){this.deviceSupportInstall(),this.appendToBody&&document.body.appendChild(this.$el),this.$refs["el-image-viewer__wrapper"].focus()},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},m=p,v=n("0c7c"),g=Object(v["a"])(m,i,a,!1,null,null,null);t["a"]=g.exports},"6f53":function(e,t,n){var i=n("83ab"),a=n("df75"),o=n("fc6a"),s=n("d1e7").f,r=function(e){return function(t){var n,r=o(t),c=a(r),l=c.length,u=0,d=[];while(l>u)n=c[u++],i&&!s.call(r,n)||d.push(e?[n,r[n]]:r[n]);return d}};e.exports={entries:r(!0),values:r(!1)}},"7e12":function(e,t,n){var i=n("da84"),a=n("58a8").trim,o=n("5899"),s=i.parseFloat,r=1/s(o+"-0")!==-1/0;e.exports=r?function(e){var t=a(String(e)),n=s(t);return 0===n&&"-"==t.charAt(0)?-0:n}:s},acd8:function(e,t,n){var i=n("23e7"),a=n("7e12");i({global:!0,forced:parseFloat!=a},{parseFloat:a})},b804:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:{height:e.height,zIndex:e.zIndex}},[n("div",{class:e.className,style:{top:e.isSticky?e.stickyTop+"px":"",zIndex:e.zIndex,position:e.position,width:e.width,height:e.height}},[e._t("default",[n("div",[e._v("sticky")])])],2)])},a=[],o=n("d4ec"),s=n("bee2"),r=n("262e"),c=n("2caf"),l=(n("0d03"),n("d3b7"),n("25f0"),n("9ab4")),u=n("1b40"),d=function(e){Object(r["a"])(n,e);var t=Object(c["a"])(n);function n(){var e;return Object(o["a"])(this,n),e=t.apply(this,arguments),e.active=!1,e.position="",e.isSticky=!1,e.width="auto",e.height="auto",e}return Object(s["a"])(n,[{key:"mounted",value:function(){this.height=this.$el.getBoundingClientRect().height.toString()+"px",window.addEventListener("scroll",this.handleScroll),window.addEventListener("resize",this.handleResize)}},{key:"activated",value:function(){this.handleScroll()}},{key:"destroyed",value:function(){window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("resize",this.handleResize)}},{key:"sticky",value:function(){this.active||(this.position="fixed",this.active=!0,this.width=this.width+"px",this.isSticky=!0)}},{key:"handleReset",value:function(){this.active&&(this.position="",this.width="auto",this.active=!1,this.isSticky=!1)}},{key:"handleScroll",value:function(){var e=this.$el.getBoundingClientRect().width;this.width=e.toString()+"px"||!1;var t=this.$el.getBoundingClientRect().top;t<this.stickyTop?this.sticky():this.handleReset()}},{key:"handleResize",value:function(){this.isSticky&&(this.width=this.$el.getBoundingClientRect().width.toString()+"px")}}]),n}(u["c"]);Object(l["a"])([Object(u["b"])({default:0})],d.prototype,"stickyTop",void 0),Object(l["a"])([Object(u["b"])({default:1})],d.prototype,"zIndex",void 0),Object(l["a"])([Object(u["b"])({default:""})],d.prototype,"className",void 0),d=Object(l["a"])([Object(u["a"])({name:"Sticky"})],d);var h=d,f=h,p=n("0c7c"),m=Object(p["a"])(f,i,a,!1,null,null,null);t["a"]=m.exports},db85:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"k",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return r})),n.d(t,"m",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"n",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return h})),n.d(t,"q",(function(){return f})),n.d(t,"p",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"l",(function(){return v})),n.d(t,"h",(function(){return g})),n.d(t,"o",(function(){return b})),n.d(t,"i",(function(){return w})),n.d(t,"r",(function(){return _})),n.d(t,"j",(function(){return y}));var i=n("b32d"),a={name:"",address:"",logo:"",qtypes:[]},o=function(e){return Object(i["a"])({url:"/api/shops",method:"post",params:e})},s=function(e,t){return Object(i["a"])({url:"/api/shop/".concat(e),method:"get",params:t})},r=function(){return Object(i["a"])({url:"/api/myshop",method:"get"})},c=function(e){return Object(i["a"])({url:"/api/shop/save",method:"post",data:e})},l=function(e){return Object(i["a"])({url:"/api/shop/".concat(e,"/delete"),method:"post"})},u=function(e){return Object(i["a"])({url:"/api/shop/gameinfo/save",method:"post",data:e})},d=function(e){return Object(i["a"])({url:"/api/shop/gameinfo",method:"post",data:e})},h=function(e){return Object(i["a"])({url:"/api/shop/gameqr",method:"post",data:e})},f=function(e){return Object(i["a"])({url:"/api/shop/save_qtype",method:"post",data:e})},p=function(e){return Object(i["a"])({url:"/api/shop/publish",method:"post",data:e})},m=function(e){return Object(i["a"])({url:"/api/shop/gametheme",method:"post",data:e})},v=function(e){return Object(i["a"])({url:"/api/shop/gametheme/save",method:"post",data:e})},g=function(e){return Object(i["a"])({url:"/api/shop/lottery",method:"post",data:e})},b=function(e){return Object(i["a"])({url:"/api/shop/lottery_update",method:"post",data:e})},w=function(e){return Object(i["a"])({url:"/api/shop/share",method:"post",data:e})},_=function(e){return Object(i["a"])({url:"/api/shop/share_update",method:"post",data:e})},y=function(e){return Object(i["a"])({url:"/api/shop/game_users",method:"post",data:e})}}}]);
|
|
//# sourceMappingURL=chunk-50b4ae97.feccad1c.js.map
|