(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-turntable-index"],{"068f":function(t,e,i){t.exports=i.p+"static/img/ttchou.f95fa510.png"},"1a9d":function(t,e,i){"use strict";var a=i("581e"),n=i.n(a);n.a},"3ca6":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.almost-lottery[data-v-1140081a]{display:flex;flex-direction:column;justify-content:center;align-items:center}.almost-lottery__canvas[data-v-1140081a]{position:absolute;left:-9999px;opacity:0;display:flex;justify-content:center;align-items:center}.lottery-action[data-v-1140081a],\r\n.str-margin-outside[data-v-1140081a],\r\n.img-margin-str[data-v-1140081a],\r\n.img-size[data-v-1140081a]{position:absolute;left:0;top:0;z-index:-1}.almost-lottery__measureText[data-v-1140081a]{position:absolute;left:0;top:0;white-space:nowrap;font-size:12px;opacity:0}.almost-lottery__wrap[data-v-1140081a]{position:relative}.almost-lottery__bg[data-v-1140081a],\r\n.almost-lottery__canvas-img[data-v-1140081a],\r\n.almost-lottery__action-bg[data-v-1140081a]{position:absolute;left:0;top:0}.almost-lottery__canvas-img-other[data-v-1140081a]{transition:-webkit-transform cubic-bezier(.34,.12,.05,.95);transition:transform cubic-bezier(.34,.12,.05,.95);transition:transform cubic-bezier(.34,.12,.05,.95),-webkit-transform cubic-bezier(.34,.12,.05,.95)}@-webkit-keyframes selfRotate-data-v-1140081a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes selfRotate-data-v-1140081a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}100%{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.almost-lottery__canvas-img-self[data-v-1140081a]{transition:-webkit-transform ease-in;transition:transform ease-in;transition:transform ease-in,-webkit-transform ease-in;-webkit-animation:selfRotate-data-v-1140081a .6s linear infinite;animation:selfRotate-data-v-1140081a .6s linear infinite}',""]),t.exports=e},"4daf":function(t,e,i){"use strict";var a=i("997c"),n=i.n(a);n.a},"581e":function(t,e,i){var a=i("a14f");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("4f06").default;n("6b2bde86",a,!0,{sourceMap:!1,shadowMode:!1})},"728d":function(t,e,i){"use strict";i.r(e);var a=i("7e3a"),n=i("b707");for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);i("4daf");var s=i("f0c5"),o=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"1140081a",null,!1,a["a"],void 0);e["default"]=o.exports},"7a24":function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("d3b7"),i("159b"),i("14d9");var n=a(i("c7eb")),r=a(i("1da1")),s=a(i("728d")),o=(i("b1ba"),{name:"Home",components:{AlmostLottery:s.default},data:function(){return{isDev:!1,lotteryConfig:{lotterySize:600,actionSize:200},lotteryBg:i("a8ae"),prizeList:[],prizeIndex:-1,prizeing:!1,freeNum:0,loading:!1,rules:[],acid:"",dizuo:i("d49e"),jiang:"",ismask2:!1,ismask:!1,isz:1,imgUrl:"",zjlist:[],animate:!1,showNum:6}},onLoad:function(t){this.acid=t.id,this.imgUrl=this.api.imgUrl,this.prizeList=[],this.getPrizeList()},created:function(){setInterval(this.showMarquee,2e3)},mounted:function(){this.$refs.marquee_box.style.height=53*this.showNum+"px"},onShow:function(){},onUnload:function(){uni.hideLoading()},methods:{getPrizeList:function(){var t=this;return(0,r.default)((0,n.default)().mark((function e(){return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:uni.showLoading({title:"奖品准备中..."}),t.api.getdatas({id:t.acid}).then((function(e){console.log(e),200==e.data.code?(t.zjlist=e.data.data.win_list,e.data.data.left_num.limit?t.freeNum=e.data.data.left_num.num:t.freeNum=9999,e.data.data.prizes.forEach((function(e){-1==e.prize_id?t.prizeList.push({prizeId:e.prize_id,prizeName:"谢谢参与",name:e.name}):t.prizeList.push({prizeId:e.prize_id,prizeName:e.name,name:e.name})})),uni.hideLoading()):(uni.hideLoading(),t.istrue=!0,uni.showToast({title:e.data.message,icon:"none"}))}));case 2:case"end":return e.stop()}}),e)})))()},handleDrawBefore:function(t){this.freeNum>0?this.handleDrawStart():uni.showToast({title:"抽奖次数已用完",icon:"error"})},handleDrawStart:function(){if(console.log("触发抽奖按钮"),this.prizeing)return uni.showToast({title:"抽奖还未结束",icon:"none"}),!1;this.prizeing=!0,this.tryLotteryDraw()},tryLotteryDraw:function(){var t=this;t.api.getover({id:t.acid}).then((function(e){console.log(e),200==e.data.code?(t.freeNum--,0==e.data.data.length?t.prizeList.forEach((function(e,i){-1==e.prizeId&&(t.prizeIndex=i)})):t.prizeList.forEach((function(i,a){i.prizeId==e.data.data.prize_id&&(t.prizeIndex=a)}))):uni.showToast({title:e.data.message,icon:"none"})}))},handleDrawEnd:function(){console.log("旋转结束,执行拿到结果后到逻辑");var t=this.prizeList[this.prizeIndex].name,e="";"谢谢参与"===t||"未中奖"===t?(e="很遗憾,没有中奖,请再接再厉!",this.isz=0):(this.isz=1,e="恭喜您,获得 ".concat(t," !")),this.jiang=e,this.prizeing=!1,this.ismask2=!0},handleDrawFinish:function(t){console.log("抽奖转盘绘制完成",t),t.ok&&console.timeEnd&&console.timeEnd("绘制转盘用时");setTimeout((function(){null,uni.hideLoading(),uni.showToast({title:t.msg,mask:!0,icon:"none"})}),50)},submit:function(){this.freeNum>0?this.handleDrawStart():uni.showToast({title:"抽奖次数已用完",icon:"error"})},showMarquee:function(){var t=this;this.animate=!0,this.zjlist.push(this.zjlist[0]),setTimeout((function(){t.zjlist.shift(),t.animate=!1}),1e3)},mypre:function(){uni.navigateTo({url:"/pages/my/prizes?acid="+this.acid})},closemsk:function(){this.ismask=!1,this.ismask2=!1},openmask:function(){this.ismask=!0}}});e.default=o},"7e3a":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"almost-lottery"},[i("v-uni-view",{staticClass:"almost-lottery__wrap",style:{width:t.lotterySize+"rpx",height:t.lotterySize+"rpx"}},[i("v-uni-view",{staticClass:"lottery-action",style:{width:t.actionSize+"rpx",height:t.actionSize+"rpx",left:t.canvasMarginOutside+"rpx"}}),i("v-uni-view",{staticClass:"str-margin-outside",style:{left:t.strMarginOutside+"rpx"}}),i("v-uni-view",{staticClass:"img-margin-str",style:{left:t.imgMarginStr+"rpx"}}),i("v-uni-view",{staticClass:"img-size",style:{width:t.imgWidth+"rpx",height:t.imgHeight+"rpx"}}),t.lotteryImg?[i("v-uni-image",{staticClass:"almost-lottery__bg",style:{width:t.lotteryPxSize+"px",height:t.lotteryPxSize+"px"},attrs:{mode:"widthFix",src:t.lotteryBg}}),i("v-uni-image",{class:["almost-lottery__canvas-img",{"almost-lottery__canvas-img-other":!t.selfRotaty},{"almost-lottery__canvas-img-self":t.selfRotated}],style:{width:t.canvasImgPxSize+"px",height:t.canvasImgPxSize+"px",left:t.canvasImgToLeftPx+"px",top:t.canvasImgToLeftPx+"px",transform:"rotate("+(t.canvasAngle+t.targetAngle)+"deg)",transitionDuration:t.transitionDuration+"s"},attrs:{mode:"widthFix",src:t.lotteryImg}}),i("v-uni-image",{staticClass:"almost-lottery__action-bg",style:{width:t.actionPxSize+"px",height:t.actionPxSize+"px",left:t.actionBgToLeftPx+"px",top:t.actionBgToLeftPx+"px",transform:"rotate("+(t.actionAngle+t.targetActionAngle)+"deg)",transitionDuration:t.transitionDuration+"s"},attrs:{mode:"widthFix",src:t.actionBg},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleActionStart.apply(void 0,arguments)}}})]:t._e()],2),i("v-uni-text",{staticClass:"almost-lottery__measureText",style:{fontSize:t.higtFontSize+"px"}},[t._v(t._s(t.measureText))]),i("v-uni-canvas",{class:t.className,style:{width:t.higtCanvasSize+"px",height:t.higtCanvasSize+"px"},attrs:{"canvas-id":t.canvasId,width:t.higtCanvasSize,height:t.higtCanvasSize}})],1)},n=[]},"997c":function(t,e,i){var a=i("3ca6");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("4f06").default;n("1b40f596",a,!0,{sourceMap:!1,shadowMode:!1})},a14f:function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.index[data-v-5d9e53a4]{height:100vh;background:url(https://pfapi.86698.cn/static/images/bg.png) no-repeat 0 0 #d8231c;background-size:100% 100%;position:fixed;left:0;top:0;width:100%;overflow:auto}.index .navRight[data-v-5d9e53a4]{width:%?144?%;height:%?46?%;background:rgba(0,0,0,.1);border-radius:%?40?% %?0?% %?0?% %?40?%;padding-left:%?20?%;display:flex;align-items:center}.index .navRight uni-text[data-v-5d9e53a4]{font-size:%?24?%;color:#fff}.index .navRight uni-image[data-v-5d9e53a4]{width:%?10?%;height:%?17?%;margin-left:%?4?%}.index .t2[data-v-5d9e53a4]{width:%?540?%;height:%?62?%;background-image:url(https://pfapi.86698.cn/static/images/k1.png);background-size:100% 100%}.index .tagr[data-v-5d9e53a4]{width:%?159?%;height:%?44?%;background:linear-gradient(180deg,#fff9de,#ffd96e);border-radius:%?22?% %?0?% %?0?% %?22?%}.index .banner[data-v-5d9e53a4]{display:block;width:%?586?%;height:%?93?%;margin:%?20?% auto %?40?%}.index .title[data-v-5d9e53a4]{text-align:center;font-size:%?48?%;font-weight:700;color:#fff;margin-bottom:%?20?%}.index .btn[data-v-5d9e53a4]{width:%?596?%;height:%?120?%;background:url(https://pfapi.86698.cn/static/images/zhi.png) no-repeat 50%;background-size:%?596?% %?120?%;margin:%?40?% auto %?35?%;font-size:%?40?%;color:#bf3100;font-weight:700}.index .mk[data-v-5d9e53a4]{background-image:url(https://pfapi.86698.cn/static/images/mk.png);background-size:100% 100%;width:%?550?%;height:%?900?%}.index .mk2[data-v-5d9e53a4]{background-image:url(https://pfapi.86698.cn/static/images/zj.png);background-size:100% 100%;width:%?494?%;height:%?684?%}.index .mask[data-v-5d9e53a4]{background:rgba(0,0,0,.6);width:100%;height:100vh;position:fixed;left:0;top:0;z-index:10}.index .marquee[data-v-5d9e53a4]{width:100%;align-items:center;color:#3a3a3a;display:flex;box-sizing:border-box;overflow:hidden}.index .marquee_title[data-v-5d9e53a4]{padding:0 20px;height:21px;font-size:14px;border-right:1px solid #d8d8d8;align-items:center}.index .marquee_box[data-v-5d9e53a4]{display:block;position:relative;width:100%;overflow:hidden;margin:0 auto;height:%?500?%}.index .marquee_list[data-v-5d9e53a4]{display:block;position:absolute;top:0;left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);width:calc(100% - %?150?%)}.index .marquee_top[data-v-5d9e53a4]{transition:all 1s;margin-top:-53px}.index .tips[data-v-5d9e53a4]{padding:%?30?% %?30?%}.index .tips .til[data-v-5d9e53a4]{font-size:%?28?%;color:#fff;margin-bottom:%?30?%}.index .tips .text[data-v-5d9e53a4]{line-height:1.6;margin-bottom:%?10?%;font-size:%?26?%;color:#fff}',""]),t.exports=e},a8ae:function(t,e,i){t.exports=i.p+"static/img/panpan.e620390e.png"},abe2:function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(i("c7eb")),r=a(i("1da1"));i("a9e3"),i("cb29"),i("14d9"),i("ac1f"),i("00b4"),i("c975"),i("d3b7"),i("fb6a"),i("e9c4");var s=i("b1ba"),o={name:"AlmostLottery",props:{pixelRatio:{type:Number,default:2},canvasId:{type:String,default:"almostLottery"},renderDelay:{type:Number,default:0},lotterySize:{type:Number,default:600},actionSize:{type:Number,default:200},canvasMarginOutside:{type:Number,default:90},prizeList:{type:Array,required:!0,validator:function(t){return t.length>1}},prizeIndex:{type:Number,required:!0},colors:{type:Array,default:function(){return["#FFFFFF","#FFBF05"]}},lotteryBg:{type:String,default:"/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__bg2x.png"},actionBg:{type:String,default:"/uni_modules/almost-lottery/static/almost-lottery/almost-lottery__action2x.png"},prizeNameDrawed:{type:Boolean,default:!0},stroked:{type:Boolean,default:!1},strokeColor:{type:String,default:"#FFBF05"},rotateType:{type:String,default:"roulette"},selfRotaty:{type:Boolean,default:!1},selfTime:{type:Number,default:1e3},duration:{type:Number,default:8},ringCount:{type:Number,default:8},pointerPosition:{type:String,default:"edge",validator:function(t){return"edge"===t||"middle"===t}},strDirection:{type:String,default:"horizontal",validator:function(t){return"horizontal"===t||"vertical"===t}},strFontColors:{type:Array,default:function(){return["#FFBF05","#FFFFFF"]}},strFontSize:{type:Number,default:24},strMarginOutside:{type:Number,default:0},imgMarginStr:{type:Number,default:60},strLineHeight:{type:Number,default:1.2},strMaxLen:{type:Number,default:12},strLineLen:{type:Number,default:6},imgWidth:{type:Number,default:50},imgHeight:{type:Number,default:50},imgDrawed:{type:Boolean,default:!0},imgCircled:{type:Boolean,default:!1},successMsg:{type:String,default:"奖品准备就绪,快来参与抽奖吧"},failMsg:{type:String,default:"奖品仍在准备中,请稍后再来..."},canvasCached:{type:Boolean,default:!1}},data:function(){return{className:"almost-lottery__canvas",systemPixelRatio:2,lotteryPxSize:0,canvasImgPxSize:0,actionPxSize:0,strMarginPxOutside:0,imgMarginPxStr:0,imgPxWidth:0,imgPxHeight:0,lotteryImg:"",targetAngle:0,targetActionAngle:0,selfRotated:!1,selfRotatyStartTime:null,isRotate:!1,stayIndex:0,targetIndex:0,isCacheImg:!1,oldLotteryImg:"",measureText:""}},computed:{higtCanvasSize:function(){return this.canvasImgPxSize*this.systemPixelRatio},higtFontSize:function(){return Math.round(this.strFontSize/this.pixelRatio)*this.systemPixelRatio},higtHeightMultiple:function(){return Math.round(this.strFontSize/this.pixelRatio)*this.strLineHeight*this.systemPixelRatio},canvasImgToLeftPx:function(){return(this.lotteryPxSize-this.canvasImgPxSize)/2},actionBgToLeftPx:function(){return(this.lotteryPxSize-this.actionPxSize)/2},canvasAngle:function(){var t=0,e=this.prizeList.length,i=360/e,a=90/i;return t="edge"===this.pointerPosition||"pointer"===this.rotateType?-i*a:-(i*a+i/2),t},actionAngle:function(){return 0},outsideRadius:function(){return this.higtCanvasSize/2},insideRadius:function(){return 20*this.systemPixelRatio},textRadius:function(){return this.strMarginPxOutside*this.systemPixelRatio||this.higtFontSize/2},textDistance:function(){var t=Math.round(this.outsideRadius-this.insideRadius/2);return t-this.textRadius},transitionDuration:function(){return this.selfRotaty?2:this.duration}},watch:{prizeIndex:function(t,e){var i=this;if(t>-1)if(this.selfRotaty){var a=Date.now()-this.selfRotatyStartTime,n=a=2.5?console.warn("当前每一圈的旋转可能过慢,请检查 duration 和 ringCount 这 2 个参数是否设置合理"):i<1&&console.warn("当前每一圈的旋转可能过快,请检查 duration 和 ringCount 这 2 个参数是否设置合理"),t.selfRotaty&&(t.isRotate=!0,t.selfRotated=!0,t.selfRotatyStartTime=Date.now()),t.$emit("draw-start")}})))},onCreateCanvas:function(){var t=this;return(0,r.default)((0,n.default)().mark((function e(){var i,a,r,o,l,c,d,u,f,g,h,m,p,x,v,y,w,b,z,S,_,k,C,F,I,P,T,L,R,M,D,A,E,B,N,O,j,U,$,H;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=t.canvasId,a=uni.createCanvasContext(i,t),r=t.higtCanvasSize,o=t.higtCanvasSize,l=t.prizeList.length,c=2*Math.PI/l,a.setFontSize(t.higtFontSize),d=0;case 8:if(!(dt.strLineLen,!x){e.next=54;break}for(v=0,y="",w=[],b=0;b=2*t.strLineLen||m.length-1===b)&&(w.push(y),v=0,y="");z=0;case 34:if(!(z0)){e.next=41;break}S=a.measureText(w[z]),_=-(S.width/2).toFixed(2),a.fillText(w[z],_,z*t.higtHeightMultiple),e.next=49;break;case 41:return t.measureText=w[z],e.next=44,t.$nextTick();case 44:return e.next=46,t.getTextWidth();case 46:k=e.sent,C=-(k/2).toFixed(2),a.fillText(w[z],C,z*t.higtHeightMultiple);case 49:z++,e.next=34;break;case 52:e.next=68;break;case 54:if(!(a.measureText&&a.measureText(m).width>0)){e.next=60;break}F=a.measureText(m),I=-(F.width/2).toFixed(2),a.fillText(m,I,0),e.next=68;break;case 60:return t.measureText=m,e.next=63,t.$nextTick();case 63:return e.next=65,t.getTextWidth();case 65:P=e.sent,T=-(P/2).toFixed(2),a.fillText(m,T,0);case 68:e.next=90;break;case 70:L=m.split(""),R=0;case 72:if(!(R0)){e.next=79;break}M=a.measureText(L[R]),D=-(M.width/2).toFixed(2),a.fillText(L[R],D,R*t.higtHeightMultiple),e.next=87;break;case 79:return t.measureText=L[R],e.next=82,t.$nextTick();case 82:return e.next=84,t.getTextWidth();case 84:A=e.sent,E=-(A/2).toFixed(2),a.fillText(L[R],E,R*t.higtHeightMultiple);case 87:R++,e.next=72;break;case 90:if(!t.imgDrawed||!u.prizeImage||"vertical"===t.strDirection){e.next=121;break}if(B=/^(https|http)/g,!B.test(u.prizeImage)){e.next=110;break}return"","需要处理好跨域问题,",console.warn("###当前数据列表中的奖品图片为网络图片,".concat("需要处理好跨域问题,","开始尝试下载图片...###")),e.next=98,(0,s.downloadFile)(u.prizeImage);case 98:if(N=e.sent,console.log("处理远程图片",N),!N.ok){e.next=107;break}return O=N.tempFilePath,e.next=104,(0,s.pathToBase64)(O);case 104:u.prizeImage=e.sent,e.next=108;break;case 107:t.handlePrizeImgSuc({ok:!1,data:N.data,msg:N.msg});case 108:e.next=116;break;case 110:if(-1!==u.prizeImage.indexOf(";base64,")){e.next=116;break}return console.log("开始处理本地图片",u.prizeImage),e.next=114,(0,s.pathToBase64)(u.prizeImage);case 114:u.prizeImage=e.sent,console.log("处理本地图片结束",u.prizeImage);case 116:j=-t.imgPxWidth*t.systemPixelRatio/2,U=t.imgMarginPxStr*t.systemPixelRatio,$=t.imgPxWidth*t.systemPixelRatio,H=t.imgPxHeight*t.systemPixelRatio,t.imgCircled?(2===t.colors.length?a.setFillStyle(t.colors[d%2]):a.setFillStyle(t.colors[d]),(0,s.circleImg)(a,u.prizeImage,j,U,$,H)):a.drawImage(u.prizeImage,j,U,$,H);case 121:a.restore();case 122:d++,e.next=8;break;case 125:a.draw(!0,(function(){var e=setTimeout((function(){clearTimeout(e),e=null,uni.canvasToTempFilePath({canvasId:t.canvasId,destWidth:t.higtCanvasSize,destHeight:t.higtCanvasSize,success:function(e){t.handlePrizeImg({ok:!0,data:e.tempFilePath,msg:"画布导出生成图片成功"})},fail:function(e){t.handlePrizeImg({ok:!1,data:e,msg:"画布导出生成图片失败"})}},t)}),500)}));case 126:case"end":return e.stop()}}),e)})))()},handlePrizeImg:function(t){if(t.ok){var e=t.data;if(!this.canvasCached)return this.lotteryImg=e,void this.handlePrizeImgSuc(t);(0,s.setStore)("".concat(this.canvasId,"LotteryImg"),e),this.lotteryImg=e,this.handlePrizeImgSuc(t);var i=this.isCacheImg?"缓存":"导出";console.info("当前为 H5 端,使用".concat(i,"中的 base64 图"))}else console.error(t.msg,t),console.error("###当前为 H5 端,下载网络图片需要后端配置允许跨域###")},handlePrizeImgSuc:function(t){this.$emit("finish",{ok:t.ok,data:t.data,msg:t.ok?this.successMsg:this.failMsg})},getTextWidth:function(){console.warn("正在采用兼容方式获取文本的 size 信息");var t=uni.createSelectorQuery().in(this),e=t.select(".almost-lottery__measureText");return new Promise((function(t,i){e.fields({size:!0},(function(e){t(e.width)})).exec()}))},strLimit:function(t){var e=this.strMaxLen;return t&&e&&(0,s.clacTextLen)(t).realLen>e?t.slice(0,e-1)+"..":t},checkCacheImg:function(){console.log("检查本地缓存中是否存在转盘图"),this.oldLotteryImg=(0,s.getStore)("".concat(this.canvasId,"LotteryImg"));var t=(0,s.getStore)("".concat(this.canvasId,"PrizeList")),e=JSON.stringify(this.prizeList);if(this.oldLotteryImg&&(console.log("经查,本地缓存中存在转盘图 => ".concat(this.oldLotteryImg,",继续判断这张缓存图是否可用")),t===e))return this.isCacheImg=!0,console.log("缓存图可用"),void this.handlePrizeImg({ok:!0,data:this.oldLotteryImg,msg:"画布导出生成图片成功"});this.initCanvasDraw()},initCanvasDraw:function(){console.log("开始初始化转盘绘制"),this.isCacheImg=!1,this.lotteryImg="",(0,s.clearStore)("".concat(this.canvasId,"LotteryImg")),(0,s.setStore)("".concat(this.canvasId,"PrizeList"),this.prizeList),this.onCreateCanvas()},beforeInit:function(){var t=this;return(0,r.default)((0,n.default)().mark((function e(){var i,a,r,s,o,l,c;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=uni.createSelectorQuery().in(t),e.next=3,new Promise((function(t){i.select(".almost-lottery__wrap").boundingClientRect((function(e){t(e)})).exec()}));case 3:return a=e.sent,e.next=6,new Promise((function(t){i.select(".lottery-action").boundingClientRect((function(e){t(e)})).exec()}));case 6:return r=e.sent,e.next=9,new Promise((function(t){i.select(".str-margin-outside").boundingClientRect((function(e){t(e)})).exec()}));case 9:return s=e.sent,e.next=12,new Promise((function(t){i.select(".img-margin-str").boundingClientRect((function(e){t(e)})).exec()}));case 12:return o=e.sent,e.next=15,new Promise((function(t){i.select(".img-size").boundingClientRect((function(e){t(e)})).exec()}));case 15:l=e.sent,t.lotteryPxSize=Math.floor(a.width),t.canvasImgPxSize=t.lotteryPxSize-Math.floor(r.left)+Math.floor(a.left),t.actionPxSize=Math.floor(r.width),t.strMarginPxOutside=Math.floor(s.left)-Math.floor(a.left),t.imgMarginPxStr=Math.floor(o.left)-Math.floor(a.left),t.imgPxWidth=Math.floor(l.width),t.imgPxHeight=Math.floor(l.height),c=setTimeout((function(){clearTimeout(c),c=null,t.canvasCached?t.checkCacheImg():t.initCanvasDraw()}),50);case 24:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this;this.$nextTick((function(){var e=50+t.renderDelay,i=setTimeout((function(){clearTimeout(i),i=null,t.beforeInit()}),e)}))}};e.default=o},b1ba:function(t,e,i){"use strict";i("7a82");var a=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.setStore=e.pathToBase64=e.getStore=e.downloadFile=e.clearStore=e.clearCacheFile=e.clacTextLen=e.circleImg=e.base64ToPath=void 0;var n=a(i("53ca"));i("e9c4"),i("cb29"),i("d3b7"),i("c975"),i("d9e2"),i("d401"),i("ac1f"),i("466d"),i("81b2"),i("0eb6"),i("b7ef"),i("8bd4"),i("ace4"),i("5cc6"),i("907a"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("986a"),i("1d02"),i("d5d6"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("b39a"),i("72f7"),i("3ca3"),i("ddb0"),i("2b3d"),i("9861"),i("5319");e.setStore=function(t,e){t&&("string"!==typeof e&&(e=JSON.stringify(e)),uni.setStorageSync(t,e))};e.getStore=function(t){if(t)return uni.getStorageSync(t)};e.clearStore=function(t){t?uni.removeStorageSync(t):(console.log("清理本地全部缓存"),uni.clearStorageSync())};e.circleImg=function(t,e,i,a,n,r){var s=Math.floor(n/2),o=i+s,l=a+s;t.save(),t.beginPath(),t.arc(o,l,s,0,2*Math.PI),t.fill(),t.clip(),t.drawImage(e,i,a,n,r),t.restore()};e.clacTextLen=function(t){if(!t)return{byteLen:0,realLen:0};t+="";for(var e=0,i=0;i255?e+=2:e+=1;return{byteLen:e,realLen:e/2}};e.downloadFile=function(t){return new Promise((function(e){uni.downloadFile({url:t,success:function(t){e({ok:!0,data:t.errMsg,tempFilePath:t.tempFilePath})},fail:function(t){e({ok:!1,data:t.errMsg,msg:"图片下载失败"})}})}))};e.clearCacheFile=function(){};e.pathToBase64=function(t){return new Promise((function(e,i){if("object"===("undefined"===typeof window?"undefined":(0,n.default)(window))&&"document"in window){if("function"===typeof FileReader){var a=new XMLHttpRequest;return a.open("GET",t,!0),a.responseType="blob",a.onload=function(){if(200===this.status){var t=new FileReader;t.onload=function(t){e(t.target.result)},t.onerror=i,t.readAsDataURL(this.response)}},a.onerror=i,void a.send()}var r=document.createElement("canvas"),s=r.getContext("2d"),o=new Image;return o.onload=function(){r.width=o.width,r.height=o.height,s.drawImage(o,0,0),e(r.toDataURL()),r.height=r.width=0},o.onerror=i,void(o.src=t)}if("object"!==("undefined"===typeof plus?"undefined":(0,n.default)(plus)))"object"===("undefined"===typeof wx?"undefined":(0,n.default)(wx))&&wx.canIUse("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:t,encoding:"base64",success:function(t){e("data:image/png;base64,"+t.data)},fail:function(t){i(t)}}):i(new Error("not support"));else{var l=function(t){if(0===t.indexOf("_www")||0===t.indexOf("_doc")||0===t.indexOf("_documents")||0===t.indexOf("_downloads"))return t;if(0===t.indexOf("/storage/emulated/0/"))return t;if(0===t.indexOf("/storage/sdcard0/"))return t;if(0===t.indexOf("/var/mobile/"))return t;if(0===t.indexOf("file://"))return t;if(0===t.indexOf("/")){var e="iOS"===plus.os.name?t:plus.io.convertLocalFileSystemURL(t);if(e!==t)return e;t=t.substring(1)}return"_www/"+t}(t);plus.io.resolveLocalFileSystemURL(l,(function(t){t.file((function(t){var a=new plus.io.FileReader;a.onload=function(t){e(t.target.result)},a.onerror=function(t){console.log(t),i(t)},a.readAsDataURL(t)}),(function(t){i(t)}))}),(function(t){i(t)}))}}))};e.base64ToPath=function(t){return new Promise((function(e,i){if("object"===("undefined"===typeof window?"undefined":(0,n.default)(window))&&"document"in window){t=t.split(",");var a=t[0].match(/:(.*?);/)[1],r=atob(t[1]),s=r.length,o=new Uint8Array(s);while(s--)o[s]=r.charCodeAt(s);return e((window.URL||window.webkitURL).createObjectURL(new Blob([o],{type:a})))}var l=t.match(/data\:\S+\/(\S+);/);l?l=l[1]:i(new Error("base64 error"));var c=Date.now()+"."+l;if("object"!==("undefined"===typeof plus?"undefined":(0,n.default)(plus)))if("object"===("undefined"===typeof wx?"undefined":(0,n.default)(wx))&&wx.canIUse("getFileSystemManager")){var d=wx.env.USER_DATA_PATH+"/"+c;wx.getFileSystemManager().writeFile({filePath:d,data:t.replace(/^data:\S+\/\S+;base64,/,""),encoding:"base64",success:function(){e(d)},fail:function(t){i(t)}})}else i(new Error("not support"));else{var u=new plus.nativeObj.Bitmap("bitmap"+Date.now());u.loadBase64Data(t,(function(){var t="_doc/uniapp_temp/"+c;u.save(t,{},(function(){u.clear(),e(t)}),(function(t){u.clear(),i(t)}))}),(function(t){u.clear(),i(t)}))}}))}},b707:function(t,e,i){"use strict";i.r(e);var a=i("abe2"),n=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(r);e["default"]=n.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")},cff2:function(t,e,i){"use strict";i.r(e);var a=i("ebb7"),n=i("e504");for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);i("1a9d");var s=i("f0c5"),o=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"5d9e53a4",null,!1,a["a"],void 0);e["default"]=o.exports},d49e:function(t,e,i){t.exports=i.p+"static/img/dizuo.a11f0f91.png"},e504:function(t,e,i){"use strict";i.r(e);var a=i("7a24"),n=i.n(a);for(var r in a)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(r);e["default"]=n.a},ebb7:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return a}));var a={almostLottery:i("728d").default},n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"index",staticStyle:{border:"1px solid transparent"}},[t.ismask2?a("v-uni-view",{staticClass:"mask flex_items flex_center"},[a("v-uni-view",{staticClass:"mk2 plr50 flex_column flex_items"},[a("v-uni-view",{staticClass:"flex_between flex_items",staticStyle:{width:"100%"}},[a("v-uni-text",{staticStyle:{opacity:"0"}},[t._v("站位")]),1==t.isz?a("v-uni-text",{staticClass:"f36 bold",staticStyle:{color:"#003A6E","margin-top":"150rpx"}},[t._v("恭喜您获得")]):t._e(),0==t.isz?a("v-uni-text",{staticClass:"f36 bold",staticStyle:{color:"#003A6E","margin-top":"150rpx"}}):t._e(),a("v-uni-image",{staticStyle:{width:"36rpx",height:"36rpx","margin-top":"150rpx"},attrs:{src:t.imgUrl+"guan.png",mode:""},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.closemsk.apply(void 0,arguments)}}})],1),a("v-uni-text",{staticClass:"f40 mt20",staticStyle:{color:"#003A6E"}},[t._v(t._s(t.jiang))]),a("v-uni-text",{staticClass:"f24 mt10",staticStyle:{color:"#003A6E"}},[t._v("请到【我的奖品】中查看")]),1==t.isz?a("v-uni-view",{staticClass:"mt50 f-center f28",staticStyle:{width:"336rpx",height:"72rpx","line-height":"72rpx",background:"#DB8267","border-radius":"68rpx",color:"#fff"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.mypre.apply(void 0,arguments)}}},[t._v("去查看")]):t._e()],1)],1):t._e(),t.ismask?a("v-uni-view",{staticClass:"mask flex_items flex_center",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.closemsk.apply(void 0,arguments)}}},[a("v-uni-view",{staticClass:"mk plr50"},[a("v-uni-view",{staticClass:"flex_between flex_items mt40 mlr30"},[a("v-uni-view"),a("v-uni-text",{staticClass:"f30 bold",staticStyle:{color:"#003A6E"}},[t._v("活动规则")]),a("v-uni-image",{staticStyle:{width:"36rpx",height:"36rpx"},attrs:{src:t.imgUrl+"guan.png",mode:""},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.closemsk.apply(void 0,arguments)}}})],1),a("v-uni-view",{staticClass:"f24 mt30 mlr30",staticStyle:{color:"#2B6DA8"}},[a("v-uni-view",[t._v("1.【活动时间】2023年11月1日至2023年12月\n\t\t\t\t\t31日")]),a("v-uni-view",{staticClass:"mt20"},[t._v("2.【活动内容】此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容。")]),a("v-uni-view",{staticClass:"mt20"},[t._v("3.【活动细则】此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容此为文字内容。")])],1)],1)],1):t._e(),a("v-uni-view",{staticClass:"pos flex_center flex_items",staticStyle:{"margin-top":"100rpx"}},[a("v-uni-image",{staticClass:"banner",attrs:{src:i("068f"),mode:""}}),a("v-uni-view",{staticClass:"abs flex_items flex_center",staticStyle:{width:"254rpx",height:"77rpx",left:"50rpx",top:"-68rpx"}},[a("v-uni-text",{staticClass:"f22 pos mb20",staticStyle:{color:"#FF5F14","z-index":"2"}},[t._v("抽奖机会 每日8点刷新")]),a("v-uni-image",{staticClass:"abs",staticStyle:{width:"100%",height:"77rpx",left:"0",top:"0"},attrs:{src:t.imgUrl+"qp.png",mode:""}})],1)],1),a("v-uni-view",{staticClass:"flex_items flex_center"},[a("v-uni-view",{staticClass:"t2 flex_items flex_center"},[a("v-uni-text",{staticClass:"f22",staticStyle:{color:"#FAFDE2"}},[t._v("每天分享一位好友获取一次抽奖资格")])],1)],1),a("v-uni-view",{staticClass:"flex_between"},[a("v-uni-view"),a("v-uni-view",{staticClass:"flex_column flex_items mt30"},[a("v-uni-view",{staticClass:"tagr flex_items flex_center",staticStyle:{color:"#F67B24","z-index":"8"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.openmask.apply(void 0,arguments)}}},[a("v-uni-text",{staticClass:"f24"},[t._v("活动规则")]),a("v-uni-image",{staticClass:"ml10",staticStyle:{width:"22rpx",height:"20rpx"},attrs:{src:t.imgUrl+"right.png",mode:""}})],1),a("v-uni-view",{staticClass:"tagr flex_items flex_center mt20",staticStyle:{color:"#F67B24","z-index":"8"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.mypre.apply(void 0,arguments)}}},[a("v-uni-text",{staticClass:"f24"},[t._v("我的奖品")]),a("v-uni-image",{staticClass:"ml10",staticStyle:{width:"22rpx",height:"20rpx"},attrs:{src:t.imgUrl+"right.png",mode:""}})],1)],1)],1),a("v-uni-view",{staticClass:"pos"},[t.prizeList.length?a("almost-lottery",{attrs:{lotteryBg:t.lotteryBg,actionBg:t.imgUrl+"zhi.png",colors:["#fff","#FFDFD4"],strFontColors:["#FF4100","#FF4100"],strMarginOutside:30,imgMarginStr:50,imgWidth:62,imgHeight:38,imgCircled:!1,"lottery-size":t.lotteryConfig.lotterySize,"action-size":t.lotteryConfig.actionSize,"ring-count":6,duration:4,"self-rotaty":!1,"img-circled":!0,canvasCached:!0,"prize-list":t.prizeList,"prize-index":t.prizeIndex},on:{"reset-index":function(e){arguments[0]=e=t.$handleEvent(e),t.prizeIndex=-1},"draw-before":function(e){arguments[0]=e=t.$handleEvent(e),t.handleDrawBefore.apply(void 0,arguments)},"draw-start":function(e){arguments[0]=e=t.$handleEvent(e),t.handleDrawStart.apply(void 0,arguments)},"draw-end":function(e){arguments[0]=e=t.$handleEvent(e),t.handleDrawEnd.apply(void 0,arguments)},finish:function(e){arguments[0]=e=t.$handleEvent(e),t.handleDrawFinish.apply(void 0,arguments)}}}):t._e(),a("v-uni-view",{staticClass:"flex_items flex_center pos"},[a("v-uni-view",{staticClass:"abs",staticStyle:{width:"176rpx",height:"80rpx","z-index":"2",left:"50%",transform:"translate(-50%)",top:"100rpx"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.submit.apply(void 0,arguments)}}}),a("v-uni-image",{staticClass:"abs",staticStyle:{width:"80%",left:"50%",transform:"translate(-50%)",top:"-700rpx"},attrs:{src:t.dizuo,mode:"widthFix"}})],1)],1),a("v-uni-view",{staticClass:"flex_items flex_center",staticStyle:{"margin-top":"290rpx"}},[a("v-uni-view",{staticClass:"f28 f-center",staticStyle:{color:"#fff",width:"300rpx",height:"72rpx","line-height":"72rpx",background:"linear-gradient(135deg, #E9533B 0%, #F8A797 100%)","border-radius":"16rpx"}},[t._v("剩余抽奖次数: "+t._s(t.freeNum)+"次")])],1),a("v-uni-view",{staticClass:"flex_items flex_center"},[a("v-uni-view",{staticClass:"mt100 ptb30 flex_column flex_items",staticStyle:{width:"calc(100% - 60rpx)",background:"linear-gradient(180deg, #FFFFFF 0%, #FFEED8 100%)","border-radius":"24rpx"}},[a("v-uni-text",{staticClass:"bold f28 mt10",staticStyle:{color:"#FF3C00"}},[t._v("中奖名单")]),a("v-uni-view",{staticClass:"marquee mt50"},[a("v-uni-view",{ref:"marquee_box",staticClass:"marquee_box"},[a("v-uni-view",{staticClass:"marquee_list",class:{marquee_top:t.animate}},[a("v-uni-view",{},t._l(t.zjlist,(function(e,i){return a("v-uni-view",{key:i,staticClass:"mt30 flex_between flex_items pb30 bbe9s",staticStyle:{width:"100%"}},[a("v-uni-view",{staticClass:"flex_start flex_items"},[a("v-uni-image",{staticStyle:{width:"74rpx",height:"74rpx","border-radius":"50%"},attrs:{src:t.imgUrl+"txx.png",mode:""}}),a("v-uni-text",{staticClass:"f24 ml10",staticStyle:{color:"#531719"}},[t._v(t._s(e.user_name))])],1),a("v-uni-text",{staticClass:"f28",staticStyle:{color:"#808080"}},[t._v(t._s(e.win_time))])],1)})),1)],1)],1)],1)],1)],1),a("v-uni-view",{staticStyle:{width:"100%",height:"40rpx"}}),a("Ywatermark",{attrs:{info:"蓝色兄弟"}})],1)},r=[]}}]);