2 lines
29 KiB
JavaScript
2 lines
29 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-facc6e54"],{"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=[],r=n("5530"),s=(n("a9e3"),n("99af"),n("b64b"),n("07ac"),n("c975"),n("acd8"),n("b680"),n("2b0e"));const o=s["default"].prototype.$isServer,c=(o||Number(document.documentMode),function(){return!o&&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!o&&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"}},p=u()?"DOMMouseScroll":"mousewheel",f={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,r=e.enableTransition,s={transform:"scale(".concat(t,") rotate(").concat(n,"deg)"),transition:r?"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,p,this._mouseWheelHandler)},deviceSupportUninstall:function(){l(document,"keydown",this._keyDownHandler),l(document,p,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,r=e.pageX,s=e.pageY;this._dragHandler=d((function(e){t.transform.offsetX=i+e.pageX-r,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(r["a"])({zoomRate:.2,rotateDeg:90,enableTransition:!0},t),i=n.zoomRate,a=n.rotateDeg,s=n.enableTransition,o=this.transform;switch(e){case"zoomOut":o.scale>.2&&(o.scale=parseFloat((o.scale-i).toFixed(3)));break;case"zoomIn":o.scale=parseFloat((o.scale+i).toFixed(3));break;case"clocelise":o.deg+=a;break;case"anticlocelise":o.deg-=a;break}o.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=f,g=n("0c7c"),v=Object(g["a"])(m,i,a,!1,null,null,null);t["a"]=v.exports},4400:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("sticky",{attrs:{"z-index":10,"class-name":"sub-navbar"}},[n("el-button-group",[n("el-button",{attrs:{icon:"el-icon-close"},on:{click:e.onCancel}},[e._v("取消")]),n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["shop:game_setting"],expression:"['shop:game_setting']"}],attrs:{type:"success",icon:"el-icon-check"},on:{click:e.saveVal}},[e._v("保存")])],1)],1),n("el-row",[1===e.userLevel?n("el-select",{staticClass:"w100",attrs:{placeholder:"选择"+e.$t("main.shop"),name:"shop",required:""},model:{value:e.shop,callback:function(t){e.shop=t},expression:"shop"}},e._l(e.allDepts,(function(e){return n("el-option",{key:e._id,attrs:{label:e.name,value:e._id}})})),1):e._e()],1),e._l(e.list,(function(t){return n("div",{key:t._id,staticClass:"one-block"},[n("el-row",[n("el-switch",{attrs:{"active-text":t.name,disabled:e.noShop,"inactive-text":""},on:{change:function(n){return e.gameSelectedChange(t._id)}},model:{value:t.selected,callback:function(n){e.$set(t,"selected",n)},expression:"game.selected"}})],1),n("el-divider",{attrs:{"content-position":"left"}}),n("el-row",{staticStyle:{display:"flex","flex-wrap":"wrap"}},e._l(t.versions,(function(i,a){return n("el-col",{key:i._id,staticStyle:{"margin-bottom":"20px"},attrs:{span:4,offset:a%4===0?0:2}},[n("el-card",{attrs:{"body-style":{padding:"0px"}}},[n("img",{staticClass:"image",attrs:{src:i.image,alt:i.name}}),n("div",{staticStyle:{padding:"14px"}},[n("div",{staticClass:"sub-bottom"},[n("span",[e._v(e._s(i.name))]),n("span",[e.noShop?e._e():n("router-link",{staticClass:"link-type",attrs:{to:"/shop/theme_edit/"+e.shop+"/"+t._id+"/"+i._id}},[e._v(" 自定义 ")])],1)]),n("div",{staticClass:"bottom"},[e.noShop?e._e():n("el-image",{staticStyle:{width:"40px",height:"40px"},attrs:{src:1===i.type?"img/icons/wqr.png":"img/icons/preview.png"},on:{click:function(n){return e.showPreview(i,t._id,i.image)}}}),1!==i.type||e.noShop?e._e():n("span",{on:{click:function(n){return e.showPreview(i,t._id,i.image)}}},[e._v(" 查看小程序码 ")]),0!==i.type||e.noShop?e._e():n("span",[n("a",{attrs:{href:i.url,target:"_blank"}},[e._v("预览游戏 ")])]),n("el-switch",{attrs:{"active-text":"",disabled:e.noShop,"inactive-text":""},on:{change:function(n){return e.versionSelectedChange(t._id,i._id)}},model:{value:i.selected,callback:function(t){e.$set(i,"selected",t)},expression:"vdata.selected"}})],1)])])],1)})),1)],1)})),n("el-dialog",{staticStyle:{"z-index":"1999"},attrs:{visible:e.dialogVisible,"modal-append-to-body":!1,title:"自定义小程序码"},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-row",{staticStyle:{display:"flex","flex-wrap":"wrap"}},[n("el-col",{staticStyle:{width:"430px"},attrs:{span:12}},[n("el-image",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],staticStyle:{width:"100%"},attrs:{src:e.qrUrl}}),n("canvas",{attrs:{id:"qr_canvas",width:"430",height:"430"}})],1),n("el-col",{attrs:{span:10}},[n("el-form",{ref:"modalForm",attrs:{"label-position":"top"}},[n("el-form-item",{attrs:{label:"参数"}},[n("el-input",{attrs:{placeholder:"参数",maxlength:19},model:{value:e.qrParam,callback:function(t){e.qrParam=t},expression:"qrParam"}})],1),n("el-form-item",{attrs:{label:"logo大小"}},[n("el-slider",{attrs:{min:.5,max:1,step:.01},on:{change:e.logoScaleChange},model:{value:e.logoScale,callback:function(t){e.logoScale=t},expression:"logoScale"}})],1),n("el-form-item",{attrs:{label:"logo背景色"}},[n("el-color-picker",{on:{change:e.logoBgChange},model:{value:e.logoBg,callback:function(t){e.logoBg=t},expression:"logoBg"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary",loading:e.refreshing},on:{click:e.refreshImg}},[e._v(" 生成 ")]),n("el-button",{attrs:{type:"success",loading:e.refreshing},on:{click:e.exportCanvasAsPNG}},[e._v(" 下载 ")])],1)],1),n("label",{staticClass:"history_list"},[e._v("历史记录")]),n("ul",{staticClass:"infinite-list",staticStyle:{overflow:"auto"},attrs:{id:"history_list"}},e._l(e.historys,(function(t){return n("li",{key:t,staticClass:"infinite-list-item"},[n("el-button",{staticClass:"history_content",attrs:{size:"mini",type:"text",loading:e.refreshing,round:""},on:{click:function(n){return e.historyClicked(t)}}},[e._v(e._s(t))]),n("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-delete"},on:{click:function(n){return e.deleteHistory(t)}}})],1)})),0)],1)],1)],1),e.showViewer?n("el-image-viewer",{staticStyle:{"z-index":"2500"},attrs:{"on-close":e.closeViewer,"url-list":[e.qrUrl]}}):e._e()],2)},a=[],r=n("b85c"),s=n("1da1"),o=n("d4ec"),c=n("bee2"),l=n("262e"),u=n("2caf"),d=(n("7db0"),n("99af"),n("4795"),n("0d03"),n("cb29"),n("a15b"),n("96cf"),n("9ab4")),h=n("1b40"),p=n("c1a2"),f=n("b804"),m=n("08a9"),g=n("db85"),v=n("9dba"),b=n("4c9b"),y=n("d257"),w=n("b7c7"),k=430,_=190,x=function(e){Object(l["a"])(n,e);var t=Object(u["a"])(n);function n(){var e;return Object(o["a"])(this,n),e=t.apply(this,arguments),e.total=0,e.list=[],e.listLoading=!0,e.shop="",e.allDepts=[],e.gameid="",e.versionid="",e.qrUrl="",e.shopLogo="",e.showViewer=!1,e.dialogVisible=!1,e.qrParam="",e.refreshing=!1,e.preGameId="",e.preVersionId="",e.historys=[],e.logoScale=1,e.logoBg="#ffffff",e.listQuery={page:1,limit:20,key:"",hasVersion:1},e}return Object(c["a"])(n,[{key:"userLevel",get:function(){return v["a"].level}},{key:"noShop",get:function(){return!this.shop}},{key:"created",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getList();case 2:if(1!==v["a"].level){e.next=9;break}return e.next=5,this.getRemoteDeptList("");case 5:b["k"].$on(b["j"],(function(){t.getRemoteDeptList()})),this.$local.get(w["a"])&&(this.shop=this.$local.get(w["a"]).id),e.next=10;break;case 9:this.shop=v["a"].department;case 10:this.shop&&this.getShopInfo(this.shop),b["k"].$on(b["e"],(function(){t.getList()}));case 12:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"beforeDestory",value:function(){1===v["a"].level&&b["k"].$off(b["j"]),b["k"].$off(b["e"])}},{key:"onShopChange",value:function(){this.shop&&(this.getShopGameSetting(this.shop),this.$local.set(w["a"],{id:this.shop}),this.getShopInfo(this.shop))}},{key:"getList",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.listLoading=!0,e.next=3,Object(p["e"])(this.listQuery);case 3:t=e.sent,n=t.data,this.listLoading=!1,this.list=n.records,this.total=n.total;case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getShopGameSetting",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,i,a,s,o,c,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(g["f"])({shopid:t});case 2:n=e.sent,i=n.data,console.log(i),this.gameid=i.gameid,this.versionid=i.versionid,this.updateGameSelected(),a=0;case 9:if(!(a<this.list.length)){e.next=34;break}s=this.list[a],o=Object(r["a"])(s.versions),e.prev=12,o.s();case 14:if((c=o.n()).done){e.next=22;break}if(l=c.value,1!==l.type){e.next=20;break}return e.next=19,this.getGameQr(this.shop,s._id,l._id);case 19:l.qr=e.sent;case 20:e.next=14;break;case 22:e.next=27;break;case 24:e.prev=24,e.t0=e["catch"](12),o.e(e.t0);case 27:return e.prev=27,o.f(),e.finish(27);case 30:h["c"].set(this.list,a,s);case 31:a++,e.next=9;break;case 34:case"end":return e.stop()}}),e,this,[[12,24,27,30]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getGameQr",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t,n,i,a){var r,s,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r={shop:t,gameId:n,version:i,params:a},e.next=3,Object(g["g"])(r);case 3:return s=e.sent,o=s.data,e.abrupt("return",o.url);case 6:case"end":return e.stop()}}),e)})));function t(t,n,i,a){return e.apply(this,arguments)}return t}()},{key:"updateGameSelected",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n,i,a,s,o,c,l,u=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(0!==this.list.length){e.next=2;break}return e.abrupt("return");case 2:this.gameid||(this.gameid=this.list[0]._id),t=Object(r["a"])(this.list),e.prev=4,t.s();case 6:if((n=t.n()).done){e.next=13;break}if(i=n.value,i._id!==this.gameid){e.next=11;break}return i.versions.find((function(e){return e._id===u.versionid}))||(this.versionid=i.versions[0]._id),e.abrupt("break",13);case 11:e.next=6;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e["catch"](4),t.e(e.t0);case 18:return e.prev=18,t.f(),e.finish(18);case 21:for(a=0;a<this.list.length;a++){s=this.list[a],s.selected=s._id===this.gameid,o=Object(r["a"])(s.versions);try{for(o.s();!(c=o.n()).done;)l=c.value,l.selected=l._id===this.versionid}catch(d){o.e(d)}finally{o.f()}h["c"].set(this.list,a,s)}case 22:case"end":return e.stop()}}),e,this,[[4,15,18,21]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"getRemoteDeptList",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!(v["a"].level>1)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Object(g["k"])({key:t});case 4:if(n=e.sent,i=n.data,i.records){e.next=8;break}return e.abrupt("return");case 8:this.allDepts=i.records;case 9:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"gameSelectedChange",value:function(e){console.log(e),this.gameid=e,this.updateGameSelected()}},{key:"versionSelectedChange",value:function(e,t){console.log(e,t),this.gameid=e,this.versionid=t,this.updateGameSelected()}},{key:"onCancel",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("确认不保存当前信息?","Warning",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:this.$store.dispatch("delView",this.$route),this.$router.go(-1),e.next=9;break;case 7:e.prev=7,e.t0=e["catch"](0);case 9:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"saveVal",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.shop&&this.gameid&&this.versionid){e.next=3;break}return this.$message({message:"请先选择一个游戏",type:"warning"}),e.abrupt("return");case 3:return e.prev=3,t={shopid:this.shop,gameid:this.gameid,versionid:this.versionid},e.next=7,Object(g["n"])(t);case 7:this.$notify({title:"Success",message:"更新游戏配置成功",type:"success",duration:2e3}),e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](3),console.log("save shop gamesetting error");case 13:case"end":return e.stop()}}),e,this,[[3,10]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"showPreview",value:function(e,t,n){var i=this;if(this.preGameId=t,this.preVersionId=e._id,1===e.type&&e.qr){this.qrUrl=e.qr,this.dialogVisible=!0;var a="".concat(this.preGameId,"|").concat(this.preVersionId),r=this.$local.get(a);this.historys.length=0,r&&(this.historys=r),setTimeout((function(){i.doDraw()}),500)}else e.url&&window.open(e.url,"_blank")}},{key:"closeViewer",value:function(){this.qrUrl="",this.showViewer=!1}},{key:"refreshImg",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(console.log("refresh qr with gameid: ".concat(this.preGameId,", versionid: ").concat(this.preVersionId,", param: ").concat(this.qrParam)),t=[],!this.qrParam){e.next=13;break}if(!(this.qrParam.length>19)){e.next=6;break}return this.$message({message:"参数的长度不能超过19个字符",type:"error"}),e.abrupt("return",!1);case 6:if(/^[a-zA-Z0-9]+$/.test(this.qrParam)){e.next=9;break}return this.$message({message:"参数只能是数字或大小写字母",type:"error"}),e.abrupt("return",!1);case 9:t.push(this.qrParam),this.historys.pushOnce(this.qrParam),n="".concat(this.preGameId,"|").concat(this.preVersionId),this.$local.set(n,this.historys);case 13:return this.refreshing=!0,e.prev=14,e.next=17,this.getGameQr(this.shop,this.preGameId,this.preVersionId,t);case 17:return i=e.sent,e.next=20,Object(y["b"])(1);case 20:this.qrUrl=i,this.doDraw(),e.next=27;break;case 24:e.prev=24,e.t0=e["catch"](14),this.$message({message:"生成二维码出错",type:"error"});case 27:this.refreshing=!1;case 28:case"end":return e.stop()}}),e,this,[[14,24]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"historyClicked",value:function(e){this.qrParam=e,this.refreshImg()}},{key:"deleteHistory",value:function(e){var t=this.historys.zremove(e);if(t){var n="".concat(this.preGameId,"|").concat(this.preVersionId);this.$local.set(n,this.historys)}}},{key:"getShopInfo",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(g["e"])(t,{});case 3:n=e.sent,i=n.data,this.shopLogo=i.logo,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log("err get shop info",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"logoScaleChange",value:function(e){console.log("logo scale change",e),this.doDraw()}},{key:"logoBgChange",value:function(e){this.doDraw()}},{key:"doDraw",value:function(){var e=this,t=document.getElementById("qr_canvas");if(!t)return!1;var n=t.getContext("2d");n.clearRect(0,0,k,k);var i=new Image;i.src=this.qrUrl+"?t="+(new Date).getDate(),i.setAttribute("crossOrigin","Anonymous"),i.onload=function(){i.complete&&(n.drawImage(i,0,0,k,k),e.shopLogo&&e.drawLogo(n))}}},{key:"drawLogo",value:function(e){var t=this,n=new Image;n.src=this.shopLogo,n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){if(n.complete){var i=document.createElement("canvas"),a=i.getContext("2d");i.width=430,i.height=430,a.fillStyle=t.logoBg,a.fillRect(0,0,k,k);var r=_*t.logoScale,s=(k-r)/2;a.drawImage(n,0,0,n.width,n.height,s,s,r,r);var o=e.createPattern(i,"no-repeat"),c=(k-_)/2;e.roundRect(c,c,_,_,_/2),e.fillStyle=o,e.fill()}}}},{key:"exportCanvasAsPNG",value:function(){var e="".concat(this.shop,".png");this.qrParam&&(e="".concat(this.shop,"_").concat(this.qrParam,".png"));var t=document.getElementById("qr_canvas");if(!t)return!1;var n="image/png",i=t.toDataURL(n),a=document.createElement("a");a.download=e,a.href=i,a.dataset.downloadurl=[n,a.download,a.href].join(":"),document.body.appendChild(a),a.click(),document.body.removeChild(a)}}]),n}(h["c"]);Object(d["a"])([Object(h["d"])("shop")],x.prototype,"onShopChange",null),x=Object(d["a"])([Object(h["a"])({name:"GameSetting",components:{Sticky:f["a"],ElImageViewer:m["a"]},filters:{parseGameType:function(e){return 1===e?"微信小游戏":"网页版"}}})],x);var O=x,j=O,S=(n("eda93"),n("c9a1"),n("0c7c")),C=Object(S["a"])(j,i,a,!1,null,"cb98f782",null);t["default"]=C.exports},"4c9b":function(e,t,n){"use strict";n.d(t,"k",(function(){return a})),n.d(t,"i",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"g",(function(){return u})),n.d(t,"j",(function(){return d})),n.d(t,"h",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"b",(function(){return f}));var i=n("2b0e"),a=new i["default"],r="event_shop_puzzles_update",s="event_activity_update",o="event_exam_update",c="event_game_update",l="event_coupon_update",u="event_puzzle_update",d="event_shop_update",h="event_role_update",p="event_mail_update",f="event_announce_update"},"6f53":function(e,t,n){var i=n("83ab"),a=n("df75"),r=n("fc6a"),s=n("d1e7").f,o=function(e){return function(t){var n,o=r(t),c=a(o),l=c.length,u=0,d=[];while(l>u)n=c[u++],i&&!s.call(o,n)||d.push(e?[n,o[n]]:o[n]);return d}};e.exports={entries:o(!0),values:o(!1)}},"7db0":function(e,t,n){"use strict";var i=n("23e7"),a=n("b727").find,r=n("44d2"),s="find",o=!0;s in[]&&Array(1)[s]((function(){o=!1})),i({target:"Array",proto:!0,forced:o},{find:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),r(s)},"7e12":function(e,t,n){var i=n("da84"),a=n("58a8").trim,r=n("5899"),s=i.parseFloat,o=1/s(r+"-0")!==-1/0;e.exports=o?function(e){var t=a(String(e)),n=s(t);return 0===n&&"-"==t.charAt(0)?-0:n}:s},"81d5":function(e,t,n){"use strict";var i=n("7b0b"),a=n("23cb"),r=n("50c4");e.exports=function(e){var t=i(this),n=r(t.length),s=arguments.length,o=a(s>1?arguments[1]:void 0,n),c=s>2?arguments[2]:void 0,l=void 0===c?n:a(c,n);while(l>o)t[o++]=e;return t}},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=[],r=n("d4ec"),s=n("bee2"),o=n("262e"),c=n("2caf"),l=(n("0d03"),n("d3b7"),n("25f0"),n("9ab4")),u=n("1b40"),d=function(e){Object(o["a"])(n,e);var t=Object(c["a"])(n);function n(){var e;return Object(r["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,p=h,f=n("0c7c"),m=Object(f["a"])(p,i,a,!1,null,null,null);t["a"]=m.exports},c1a2:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"f",(function(){return c})),n.d(t,"c",(function(){return l}));var i=n("b32d"),a={type:0,name:""},r={versions:[a],name:""},s=function(e){return Object(i["a"])({url:"/api/games",method:"post",params:e})},o=function(e,t){return Object(i["a"])({url:"/api/game/".concat(e),method:"get",params:t})},c=function(e){return Object(i["a"])({url:"/api/game/save",method:"post",data:e})},l=function(e){return Object(i["a"])({url:"/api/game/".concat(e,"/delete"),method:"post"})}},c9a1:function(e,t,n){"use strict";n("f4f0")},cb29:function(e,t,n){var i=n("23e7"),a=n("81d5"),r=n("44d2");i({target:"Array",proto:!0},{fill:a}),r("fill")},db85:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"k",(function(){return r})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return o})),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 p})),n.d(t,"p",(function(){return f})),n.d(t,"c",(function(){return m})),n.d(t,"l",(function(){return g})),n.d(t,"h",(function(){return v})),n.d(t,"o",(function(){return b})),n.d(t,"i",(function(){return y})),n.d(t,"r",(function(){return w})),n.d(t,"j",(function(){return k}));var i=n("b32d"),a={name:"",address:"",logo:"",local:0,qtypes:[]},r=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})},o=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})},p=function(e){return Object(i["a"])({url:"/api/shop/save_qtype",method:"post",data:e})},f=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})},g=function(e){return Object(i["a"])({url:"/api/shop/gametheme/save",method:"post",data:e})},v=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})},y=function(e){return Object(i["a"])({url:"/api/shop/share",method:"post",data:e})},w=function(e){return Object(i["a"])({url:"/api/shop/share_update",method:"post",data:e})},k=function(e){return Object(i["a"])({url:"/api/shop/game_users",method:"post",data:e})}},dd49:function(e,t,n){e.exports={menuBg:"#304156",menuText:"#bfcbd9",menuActiveText:"#409eff"}},eda93:function(e,t,n){"use strict";n("dd49")},f4f0:function(e,t,n){}}]);
|
|
//# sourceMappingURL=chunk-facc6e54.964a7b46.js.map
|