12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-65ed85e2"],{"02d7":function(t,e){t.exports="data:image/jpeg;base64,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"},"0420":function(t,e,i){t.exports=i.p+"img/未按.2f242425.png"},"04d1":function(t,e,i){var a=i("342f"),n=a.match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},"130d":function(t,e,i){t.exports=i.p+"img/抬头1.2c2e2c26.png"},"326f":function(t,e,i){t.exports=i.p+"img/灰按钮.a67629bb.png"},4099:function(t,e,i){"use strict";i("f83b")},4323:function(t,e,i){t.exports=i.p+"img/下边云.dca19c2b.png"},4842:function(t,e,i){t.exports=i.p+"img/refresh.c9e66735.png"},"4e82":function(t,e,i){"use strict";var a=i("23e7"),n=i("1c0b"),r=i("7b0b"),s=i("50c4"),o=i("d039"),l=i("addb"),c=i("a640"),d=i("04d1"),u=i("d998"),h=i("2d00"),g=i("512ce"),f=[],p=f.sort,v=o((function(){f.sort(void 0)})),m=o((function(){f.sort(null)})),w=c("sort"),A=!o((function(){if(h)return h<70;if(!(d&&d>3)){if(u)return!0;if(g)return g<603;var t,e,i,a,n="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(a=0;a<47;a++)f.push({k:e+a,v:i})}for(f.sort((function(t,e){return e.v-t.v})),a=0;a<f.length;a++)e=f[a].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}})),x=v||!m||!w||!A,b=function(t){return function(e,i){return void 0===i?-1:void 0===e?1:void 0!==t?+t(e,i)||0:String(e)>String(i)?1:-1}};a({target:"Array",proto:!0,forced:x},{sort:function(t){void 0!==t&&n(t);var e=r(this);if(A)return void 0===t?p.call(e):p.call(e,t);var i,a,o=[],c=s(e.length);for(a=0;a<c;a++)a in e&&o.push(e[a]);o=l(o,b(t)),i=o.length,a=0;while(a<i)e[a]=o[a++];while(a<c)delete e[a++];return e}})},"512ce":function(t,e,i){var a=i("342f"),n=a.match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},"81d5":function(t,e,i){"use strict";var a=i("7b0b"),n=i("23cb"),r=i("50c4");t.exports=function(t){var e=a(this),i=r(e.length),s=arguments.length,o=n(s>1?arguments[1]:void 0,i),l=s>2?arguments[2]:void 0,c=void 0===l?i:n(l,i);while(c>o)e[o++]=t;return e}},a640:function(t,e,i){"use strict";var a=i("d039");t.exports=function(t,e){var i=[][t];return!!i&&a((function(){i.call(null,e||function(){throw 1},1)}))}},a71e:function(t,e,i){t.exports=i.p+"img/黄按钮.a85e1406.png"},addb:function(t,e){var i=Math.floor,a=function(t,e){var s=t.length,o=i(s/2);return s<8?n(t,e):r(a(t.slice(0,o),e),a(t.slice(o),e),e)},n=function(t,e){var i,a,n=t.length,r=1;while(r<n){a=r,i=t[r];while(a&&e(t[a-1],i)>0)t[a]=t[--a];a!==r++&&(t[a]=i)}return t},r=function(t,e,i){var a=t.length,n=e.length,r=0,s=0,o=[];while(r<a||s<n)r<a&&s<n?o.push(i(t[r],e[s])<=0?t[r++]:e[s++]):o.push(r<a?t[r++]:e[s++]);return o};t.exports=a},cb29:function(t,e,i){var a=i("23e7"),n=i("81d5"),r=i("44d2");a({target:"Array",proto:!0},{fill:n}),r("fill")},cdb0:function(t,e,i){t.exports=i.p+"img/Ribbon.631befc0.png"},cdc0:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"apps"}},[t.shows?a("div",[a("van-nav-bar",{attrs:{title:"智慧拼图","left-arrow":""},on:{"click-left":t.onClickLeft}})],1):t._e(),a("div",{ref:"wrap",staticClass:"wrap"},[a("div",{staticClass:"start-page"},[a("div",{staticClass:"headers"},[a("img",{attrs:{src:i("130d")}}),a("div",{staticClass:"headers-left"},[t._v(t._s(t.complete_num))]),a("div",{staticClass:"headers-right"},[t._v(t._s(t.no_complete_num))]),a("div",{staticClass:"header-content"},[a("div",{ref:"hygrometer",staticStyle:{width:"100px",height:"100px"},attrs:{id:"hygrometer"}},[t._v(" "+t._s(t.jindu)+" ")])])]),a("div",{staticClass:"album-list"},t._l(t.imgArr,(function(e,n){return a("div",{key:n,staticClass:"img-wrap",class:t.activeClass==n?"active":"",on:{click:function(i){return t.getItem(n,e.id)}}},[a("div",{staticClass:"img-wrap-imgs"},[t.imgshow==e.complete_status?a("img",{attrs:{src:i("0420")}}):a("img",{attrs:{src:e.picture,alt:""}}),t.pshow==e.complete_status?a("p",[t._v(" 用时:"+t._s(e.completion_time)+"s ")]):t._e()]),a("div",{staticClass:"contents-list-item-button",on:{click:function(i){return t.startGame(n,e.page_id)}}},[t.imgshow==e.complete_status?a("img",{attrs:{src:i("326f")}}):a("img",{attrs:{src:i("a71e")}}),t.imgshow==e.complete_status?a("p",[t._v("未解锁")]):a("p",[t._v(t._s(e.name))])])])})),0),t._m(0)]),a("div",{staticClass:"play-page"},[a("div",{staticClass:"deloy"},[t._v(" 倒计时:"),a("span",{attrs:{id:"time"}},[t._v(t._s(t.dealtime))])]),a("div",{staticClass:"play-area",attrs:{id:"playArea"}},t._l(t.boxArr,(function(e){return a("div",{key:e,ref:"piece"+e,refInFor:!0,class:["piece","piece-"+e,e==t.boxArractivelass?"active":""],style:{backgroundImage:"url("+t.selectedImg+")"},attrs:{index:e},on:{click:function(i){return t.changePositon(i,e)}}})})),0),a("div",{staticClass:"btn",attrs:{id:"change"},on:{click:function(e){return t.reOrder()}}},[t._v("重新排序")]),a("div",{staticClass:"btn",attrs:{id:"back"},on:{click:function(e){return t.goBack()}}},[t._v("返回")])]),a("div",{staticClass:"result-page"},[a("div",{staticClass:"result_box"},[t._m(1),a("div",{staticClass:"result_box_content"},[a("div",{staticClass:"content",on:{click:function(e){return t.imagePreview()}}},[a("img",{attrs:{src:this.selectedImg,alt:""}})]),a("div",{staticClass:"refresh",on:{click:function(e){return t.result_again()}}},[a("img",{attrs:{src:i("4842"),alt:""}})])]),a("div",{staticClass:"num_box"},[a("div",{staticClass:"text"},[t._v(t._s(180-t.dealtime)+"秒")])]),a("div",{staticClass:"result_btn",on:{click:function(e){return t.onceAgain()}}},[a("img",{attrs:{src:i("ce9b"),alt:""}})])])]),a("div",{staticClass:"preview-page last-page"},[a("img",{attrs:{src:t.canvasUrl,alt:"图片"}}),a("div",{staticClass:"btn play-again",on:{click:function(e){return t.reStart()}}},[t._v("重新再来")]),a("div",{staticClass:"btn share-other",on:{click:function(e){t.isVisible=!0}}},[t._v("我要分享")])]),t.isVisible?a("div",{staticClass:"share-bg",on:{click:function(e){t.isVisible=!1}}}):t._e()])])},n=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"footed"},[a("div",{staticClass:"footed-img"},[a("img",{attrs:{src:i("4323")}})])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"result_box_title"},[a("img",{attrs:{src:i("cdb0"),alt:""}})])}],r=(i("d81d"),i("cb29"),i("ac1f"),i("5319"),i("4e82"),i("28a2")),s=i("313e"),o=i("aa74"),l=i("22b4"),c=(i("1be7"),i("f95e")),d=i("5e81");Object(l["a"])([c["a"],d["a"]]);o["c"]({type:"series.liquidFill",optionUpdated:function(){var t=this.option;t.gridSize=Math.max(Math.floor(t.gridSize),4)},getInitialData:function(t,e){var i=o["e"].createDimensions(t.data,{coordDimensions:["value"]}),a=new o["a"](i,this);return a.initData(t.data),a},defaultOption:{color:["#294D99","#156ACF","#1598ED","#45BDFF"],center:["50%","50%"],radius:"50%",amplitude:"8%",waveLength:"80%",phase:"auto",period:"auto",direction:"right",shape:"circle",waveAnimation:!0,animationEasing:"linear",animationEasingUpdate:"linear",animationDuration:2e3,animationDurationUpdate:1e3,outline:{show:!0,borderDistance:8,itemStyle:{color:"none",borderColor:"#294D99",borderWidth:8,shadowBlur:20,shadowColor:"rgba(0, 0, 0, 0.25)"}},backgroundStyle:{color:"#E3F7FF"},itemStyle:{opacity:.95,shadowBlur:50,shadowColor:"rgba(0, 0, 0, 0.4)"},label:{show:!0,color:"#294D99",insideColor:"#fff",fontSize:50,fontWeight:"bold",align:"center",baseline:"middle",position:"inside"},emphasis:{itemStyle:{opacity:.8}}}});var u=i("3842"),h=o["d"].extendShape({type:"ec-liquid-fill",shape:{waveLength:0,radius:0,radiusY:0,cx:0,cy:0,waterLevel:0,amplitude:0,phase:0,inverse:!1},buildPath:function(t,e){null==e.radiusY&&(e.radiusY=e.radius);var i=Math.max(2*Math.ceil(2*e.radius/e.waveLength*4),8);while(e.phase<2*-Math.PI)e.phase+=2*Math.PI;while(e.phase>0)e.phase-=2*Math.PI;var a=e.phase/Math.PI/2*e.waveLength,n=e.cx-e.radius+a-2*e.radius;t.moveTo(n,e.waterLevel);for(var r=0,s=0;s<i;++s){var o=s%4,l=g(s*e.waveLength/4,o,e.waveLength,e.amplitude);t.bezierCurveTo(l[0][0]+n,-l[0][1]+e.waterLevel,l[1][0]+n,-l[1][1]+e.waterLevel,l[2][0]+n,-l[2][1]+e.waterLevel),s===i-1&&(r=l[2][0])}e.inverse?(t.lineTo(r+n,e.cy-e.radiusY),t.lineTo(n,e.cy-e.radiusY),t.lineTo(n,e.waterLevel)):(t.lineTo(r+n,e.cy+e.radiusY),t.lineTo(n,e.cy+e.radiusY),t.lineTo(n,e.waterLevel)),t.closePath()}});function g(t,e,i,a){return 0===e?[[t+.5*i/Math.PI/2,a/2],[t+.5*i/Math.PI,a],[t+i/4,a]]:1===e?[[t+.5*i/Math.PI/2*(Math.PI-2),a],[t+.5*i/Math.PI/2*(Math.PI-1),a/2],[t+i/4,0]]:2===e?[[t+.5*i/Math.PI/2,-a/2],[t+.5*i/Math.PI,-a],[t+i/4,-a]]:[[t+.5*i/Math.PI/2*(Math.PI-2),-a],[t+.5*i/Math.PI/2*(Math.PI-1),-a/2],[t+i/4,0]]}const f=u["o"];o["b"]({type:"liquidFill",render:function(t,e,i){var a=this.group;a.removeAll();var n=t.getData(),r=n.getItemModel(0),s=r.get("center"),l=r.get("radius"),c=i.getWidth(),d=i.getHeight(),u=Math.min(c,d),g=0,p=0,v=t.get("outline.show");v&&(g=t.get("outline.borderDistance"),p=f(t.get("outline.itemStyle.borderWidth"),u));var m,w,A,x=f(s[0],c),b=f(s[1],d),I=!1,y=t.get("shape");if("container"===y?(I=!0,m=[c/2,d/2],w=[m[0]-p/2,m[1]-p/2],A=[f(g,c),f(g,d)],l=[Math.max(w[0]-A[0],0),Math.max(w[1]-A[1],0)]):(m=f(l,u)/2,w=m-p/2,A=f(g,u),l=Math.max(w-A,0)),v){var C=D();C.style.lineWidth=p,a.add(D())}var B=I?0:x-l,S=I?0:b-l,M=null;a.add(L());var P=this._data,E=[];function _(t,e){if(y){if(0===y.indexOf("path://")){var i=o["d"].makePath(y.slice(7),{}),a=i.getBoundingRect(),n=a.width,r=a.height;n>r?(r*=2*t/n,n=2*t):(n*=2*t/r,r=2*t);var s=e?0:x-n/2,l=e?0:b-r/2;return i=o["d"].makePath(y.slice(7),{},new o["d"].BoundingRect(s,l,n,r)),e&&(i.position=[-n/2,-r/2]),i}if(I){var c=e?-t[0]:x-t[0],d=e?-t[1]:b-t[1];return o["e"].createSymbol("rect",c,d,2*t[0],2*t[1])}c=e?-t:x-t,d=e?-t:b-t;return"pin"===y?d+=t:"arrow"===y&&(d-=t),o["e"].createSymbol(y,c,d,2*t,2*t)}return new o["d"].Circle({shape:{cx:e?0:x,cy:e?0:b,r:t}})}function D(){var e=_(m);return e.style.fill=null,e.setStyle(t.getModel("outline.itemStyle").getItemStyle()),e}function L(){var e=_(l);e.setStyle(t.getModel("backgroundStyle").getItemStyle()),e.style.fill=null,e.z2=5;var i=_(l);i.setStyle(t.getModel("backgroundStyle").getItemStyle()),i.style.stroke=null;var a=new o["d"].Group;return a.add(e),a.add(i),a}function G(e,i,a){var r=I?l[0]:l,s=I?d/2:l,c=n.getItemModel(e),u=c.getModel("itemStyle"),g=c.get("phase"),p=f(c.get("amplitude"),2*s),v=f(c.get("waveLength"),2*r),m=n.get("value",e),w=s-m*s*2;g=a?a.shape.phase:"auto"===g?e*Math.PI/4:g;var A=u.getItemStyle();if(!A.fill){var y=t.get("color"),C=e%y.length;A.fill=y[C]}var B=2*r,S=new h({shape:{waveLength:v,radius:r,radiusY:s,cx:B,cy:0,waterLevel:w,amplitude:p,phase:g,inverse:i},style:A,position:[x,b]});S.shape._waterLevel=w;var M=c.getModel("emphasis.itemStyle").getItemStyle();M.lineWidth=0,S.ensureState("emphasis").style=M,o["e"].enableHoverEmphasis(S);var P=_(l,!0);return P.setStyle({fill:"white"}),S.setClipPath(P),S}function Y(t,e,i){var a=n.getItemModel(t),r=a.get("period"),s=a.get("direction"),o=n.get("value",t),l=a.get("phase");l=i?i.shape.phase:"auto"===l?t*Math.PI/4:l;var c=function(e){var i=n.count();return 0===i?e:e*(.2+(i-t)/i*.8)},d=0;d="auto"===r?c(5e3):"function"===typeof r?r(o,t):r;var u=0;"right"===s||null==s?u=Math.PI:"left"===s?u=-Math.PI:"none"===s?u=0:console.error("Illegal direction value for liquid fill."),"none"!==s&&a.get("waveAnimation")&&e.animate("shape",!0).when(0,{phase:l}).when(d/2,{phase:u+l}).when(d,{phase:2*u+l}).during((function(){M&&M.dirty(!0)})).start()}function k(e){var i=r.getModel("label");function a(){var e=t.getFormattedLabel(0,"normal"),i=100*n.get("value",0),a=n.getName(0)||t.name;return isNaN(i)||(a=i.toFixed(0)+"%"),null==e?a:e}var s={z2:10,shape:{x:B,y:S,width:2*(I?l[0]:l),height:2*(I?l[1]:l)},style:{fill:"transparent"},textConfig:{position:i.get("position")||"inside"},silent:!0},c={style:{text:a(),textAlign:i.get("align"),textVerticalAlign:i.get("baseline")}};Object.assign(c.style,o["e"].createTextStyle(i));var d=new o["d"].Rect(s),u=new o["d"].Rect(s);u.disableLabelAnimation=!0,d.disableLabelAnimation=!0;var h=new o["d"].Text(c),g=new o["d"].Text(c);d.setTextContent(h),u.setTextContent(g);var f=i.get("insideColor");g.style.fill=f;var p=new o["d"].Group;p.add(d),p.add(u);var v=_(l,!0);return M=new o["d"].CompoundPath({shape:{paths:e},position:[x,b]}),M.setClipPath(v),u.setClipPath(M),p}n.diff(P).add((function(e){var i=G(e,!1),r=i.shape.waterLevel;i.shape.waterLevel=I?d/2:l,o["d"].initProps(i,{shape:{waterLevel:r}},t),i.z2=2,Y(e,i,null),a.add(i),n.setItemGraphicEl(e,i),E.push(i)})).update((function(e,i){for(var r=P.getItemGraphicEl(i),s=G(e,!1,r),l={},c=["amplitude","cx","cy","phase","radius","radiusY","waterLevel","waveLength"],u=0;u<c.length;++u){var h=c[u];s.shape.hasOwnProperty(h)&&(l[h]=s.shape[h])}var g={},f=["fill","opacity","shadowBlur","shadowColor"];for(u=0;u<f.length;++u){h=f[u];s.style.hasOwnProperty(h)&&(g[h]=s.style[h])}I&&(l.radiusY=d/2),o["d"].updateProps(r,{shape:l},t),r.useStyle(g),r.position=s.position,r.setClipPath(s.getClipPath()),r.shape.inverse=s.inverse,Y(e,r,r),a.add(r),n.setItemGraphicEl(e,r),E.push(r)})).remove((function(t){var e=P.getItemGraphicEl(t);a.remove(e)})).execute(),r.get("label.show")&&a.add(k(E)),this._data=n},dispose:function(){}});var p=i("e16c"),v={inject:["reload"],props:{msg:String},data:function(){return{token:"",startDx:0,activeClass:-1,boxArractivelass:-1,prevIndex:null,curIndex:0,curposArr:[],clickStartBtn:!1,uploadimg:"",selectedImg:"",boxArr:new Array(9).fill(1).map((function(t,e){return e})),pieces:document.querySelectorAll(".piece"),pool:this.generateMatrix(3,28,20),matrixArr:this.upsetArr(this.generateMatrix(3,28,20)),imgArr:[],wall:0,prevEl:null,dealtime:180,timer:null,issuccess:!1,canvasUrl:"",isVisible:!1,shows:!1,infos_id:0,pshow:1,imgshow:null,jindu:sessionStorage.getItem("mjindu")?sessionStorage.getItem("myjindu"):0,complete_num:0,no_complete_num:0,jindus:0,page_id:""}},methods:{getItem:function(t,e){this.activeClass=t,this.infos_id=e},onFileChange:function(t){var e=t.target.files||t.dataTransfer.files;e.length&&this.createImage(e[0])},createImage:function(t){var e=this,i=new FileReader,a=this;i.onload=function(t){a.uploadimg=t.target.result,e.imgArr.push({url:t.target.result})},i.readAsDataURL(t)},startGame:function(t,e){this.page_id=e,this.timer=setInterval(this.timeStart,1e3),this.startDx=this.startDx-100,this.transformX(this.$refs.wrap,this.startDx+"vw"),this.selectedImg=this.imgArr[t].picture,this.shuffle(document.querySelectorAll(".piece"),this.pool)},reOrder:function(){this.shuffle(document.querySelectorAll(".piece"),this.pool)},changePositon:function(t,e){var i=/active/g;this.boxArractivelass=e;var a=document.querySelectorAll(".piece");if(this.wall){this.wall=0;var n=+this.prevEl.getAttribute("index"),r=+t.target.getAttribute("index");this.swap(this.pool,n,r),this.prevEl.style.transform="translate("+this.pool[n].x+"vw,"+this.pool[n].y+"vh)",t.target.style.transform="translate("+this.pool[r].x+"vw,"+this.pool[r].y+"vh)",this.boxArractivelass=-1,this.isTestSuccess(this.pool)&&(clearInterval(this.timer),this.startDx-=100,this.issuccess=!0,this.transformX(this.$refs.wrap,this.startDx+"vw"),console.log("拼图完成"),this.upresult(this.infos_id))}else{this.wall=1,this.prevEl=t.target;for(var s=0,o=a.length;s<o;s++)a[s].className=a[s].className.replace(" active","");!i.test(this.className)&&(this.className+=" active")}},timeStart:function(){this.dealtime--,this.dealtime<1&&(clearInterval(this.timer),this.$toast("挑战失败,请返回重新开始"))},transformX:function(t,e){t.style.transform="translateX("+e+")"},resetTime:function(){this.dealtime=180,clearInterval(this.timer)},goBack:function(){this.startDx+=100,this.transformX(this.$refs.wrap,this.startDx+"vw"),this.resetTime()},onceAgain:function(){console.log("前往项目详情",this.page_id),uni.navigateTo({url:"../../../../index/record/record?mine_code=ningdongyunying&pageId="+this.page_id})},result_again:function(){this.shuffle(document.querySelectorAll(".piece"),this.pool),this.startDx=-100,this.transformX(this.$refs.wrap,this.startDx+"vw"),this.resetTime(),this.dealtime=180,this.timer=setInterval(this.timeStart,1e3)},reStart:function(){this.startDx=this.startDx+300,this.transformX(this.$refs.wrap,this.startDx+"vw"),this.resetTime()},generateImg:function(){var t=document.createElement("canvas");if(t.getContext){var e=window.innerWidth,a=window.innerHeight,n=t.getContext("2d");t.width=e,t.height=a;var r=n.createLinearGradient(0,0,0,a);r.addColorStop(0,"#a1c4fd"),r.addColorStop(1,"#c2e9fb"),n.fillStyle=r,n.fillRect(0,0,e,a),n.fill();var s=0,o=this,l=new Image;l.src=o.selectedImg,l.setAttribute("crossOrigin","Anonymous"),l.onload=function(){s=.5*e*this.height/this.width,n.drawImage(l,.2*e,20,.6*e,s),n.fillStyle="#fff",n.font="20px Helvetica",n.textBaseline="hanging",n.textAlign="center",n.moveTo(10,10),n.fillText("我只用了"+(180-o.dealtime)+"s,快来挑战!",e/2,.1*a+s),n.fillStyle="#000",n.font="14px Helvetica",n.textBaseline="hanging",n.textAlign="center",n.moveTo(-30,10),n.fillText("关注下方二维码开始游戏",e/2,.18*a+s);var r=new Image;r.src=i("02d7"),r.onload=function(){n.drawImage(r,.35*e,.25*a+s,.3*e,.3*e);var i=new Image;i.src=o.convertCanvasToImage(t,1).src,i.setAttribute("crossOrigin","Anonymous"),i.className="previewImg",i.onload=function(){o.canvasUrl=this.src,o.startDx=o.startDx-100,o.transformX(o.$refs.wrap,o.startDx+"vw")}}}}else alert("浏览器不支持canvas!")},generateMatrix:function(t,e,i){for(var a=[],n=0,r=0;r<t;r++)for(var s=0;s<t;s++)a.push({x:s*e,y:r*i,index:n}),n++;return a},shuffle:function(t,e){this.upsetArr(e);for(var i=0,a=t.length;i<a;i++){var n=t[i];n.setAttribute("index",i),n.style.transform="translate("+e[i].x+"vw,"+e[i].y+"vh)"}},upsetArr:function(t){return t.sort((function(){return Math.random()>.5?-1:1}))},swap:function(t,e,i){var a=[t[i],t[e]];t[e]=a[0],t[i]=a[1]},isTestSuccess:function(t){return t.every((function(t,e){return t.index===e}))},convertCanvasToImage:function(t,e){var i=new Image;return i.src=t.toDataURL("image/png",e),i},drawLiquidfill:function(t){var e=s["a"](document.getElementById("hygrometer"));e.setOption({tooltip:{show:!0},series:[{name:"puzzle",type:"liquidFill",radius:"80px",data:[this.jindu],label:{normal:{color:"#ff7900",insideColor:"#ff7900",textStyle:{fontSize:20,fontWeight:"bold"}}},backgroundStyle:{color:"#fff"},color:[{type:"linear",x:0,y:1,x2:0,y2:0,colorStops:[{offset:1,color:["#ffff00"]},{offset:0,color:["#ffff00"]}],global:!1}],outline:{show:!0,borderDistance:0,itemStyle:{borderColor:"#fdd35d",borderWidth:3}}}]})},upresult:function(t){var e=String(180-this.dealtime),i=String(t);this.$http.post("http://ningdongyunying.nxjiewei.com:8011/api/jigsawPuzzle/completeJigsawPuzzle",{completion_time:e,picture_id:i}).then((function(t){console.log(t)})),this.getxinxi(this.$route.query.id)},onClickLeft:function(){window.history.back()},getpuzzle:function(t){var e=this;this.$http.post("http://ningdongyunying.nxjiewei.com:8011/api/jigsawPuzzle/pictureList",{special_id:t}).then((function(t){console.log(t.data.data.data),e.imgArr=t.data.data.data}))},getxinxi:function(t){var e=this;this.$http.post("http://ningdongyunying.nxjiewei.com:8011/api/jigsawPuzzle/getPercentCompleteData",{special_id:t}).then((function(t){var i=t.data.data.percent_complete/100;e.no_complete_num=t.data.data.no_complete_num,e.complete_num=t.data.data.complete_num,e.jindu=i,sessionStorage.setItem("myjindu",e.jindu),e.drawLiquidfill(e.jiudu)}))},imagePreview:function(){Object(r["a"])([this.selectedImg])}},created:function(){this.getxinxi(this.$route.query.id)},mounted:function(){document.body.style.backgroundColor="#39f",this.gettoken=Object(p["a"])(window.location.href).token,this.token="Bearer ".concat(this.gettoken),sessionStorage.setItem("mytoken",this.token),this.drawLiquidfill(),this.getpuzzle(Object(p["a"])(window.location.href).id),console.log(this.shows)}},m=v,w=(i("4099"),i("2877")),A=Object(w["a"])(m,a,n,!1,null,"19bbc956",null);e["default"]=A.exports},ce9b:function(t,e,i){t.exports=i.p+"img/to_book.3607a604.png"},d998:function(t,e,i){var a=i("342f");t.exports=/MSIE|Trident/.test(a)},e16c:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));i("ac1f"),i("1276"),i("fb6a"),i("841c"),i("5319");var a=function(t){var e=t?t.split("?")[1]:window.location.search.slice(1),i={};if(e){e=e.split("#")[0];for(var a=e.split("&"),n=0;n<a.length;n++){var r=a[n].split("="),s=void 0,o=r[0].replace(/\[\d*\]/,(function(t){return s=t.slice(1,-1),""})),l="undefined"===typeof r[1]||r[1];i[o]?("string"===typeof i[o]&&(i[o]=[i[o]]),"undefined"===typeof s?i[o].push(l):i[o][s]=l):i[o]=l}}return i}},f83b:function(t,e,i){}}]);
- //# sourceMappingURL=chunk-65ed85e2.01330a69.js.map
|