1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-scap-index"],{"011d":function(t,i,e){"use strict";e("7a82");var a=e("4ea4").default;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,e("a9e3"),e("14d9");var s=a(e("8947")),n={data:function(){return{zjlist:[],animate:!1,showNum:3,ismask:!1,ismask2:!1,jiang:"",istrue:!1,prizeList:[],acid:"",noq:!1,isscap:!1,imgUrl:""}},components:{scrap:s.default},onLoad:function(t){this.acid=t.id,this.imgUrl=this.api.imgUrl,this.getData()},created:function(){setInterval(this.showMarquee,2e3)},mounted:function(){this.$refs.marquee_box.style.height=30*this.showNum+"px"},methods:{getData:function(t){var i=this;uni.showLoading({title:"加载中..."}),this.api.getdatas({id:this.acid}).then((function(t){console.log(t),200==t.data.code?(i.zjlist=t.data.data.win_list,i.prizeList=t.data.data.prizes,i.istrue=!0,i.getover()):(uni.hideLoading(),i.istrue=!0,uni.showToast({title:t.data.message,icon:"none"}))}))},getover:function(){var t=this,i=this;i.api.getover({id:i.acid}).then((function(e){if(console.log(e),200==e.data.code){if(0==e.data.data.length)uni.setStorageSync("good","很遗憾,未中奖"),uni.setStorageSync("good2","很遗憾,未中奖"),t.jiang="很遗憾,未中奖";else for(var a=0;a<i.prizeList.length;a++)i.prizeList[a].prize_id==e.data.data.prize_id&&(t.jiang=e.data.data.name,uni.setStorageSync("good",Number(a+1)+"等奖"),setTimeout((function(){uni.hideLoading(),i.istrue=!0}),1800));t.isscap=!0}else i.istrue=!0,t.noq=!0,uni.showToast({title:e.data.message,icon:"none"})}))},showMarquee:function(){var t=this;this.animate=!0,this.zjlist.push(this.zjlist[0]),setTimeout((function(){t.zjlist.shift(),t.animate=!1}),1e3)},closemsk:function(){this.ismask=!1,this.ismask2=!1},openmask:function(){this.ismask=!0},gomyp:function(){uni.navigateTo({url:"/pages/my/prizes?acid="+this.acid})},zhong:function(t){console.log(t),this.ismask2=!0}}};i.default=n},"1a36":function(t,i,e){var a=e("77fe");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var s=e("4f06").default;s("036f7ee3",a,!0,{sourceMap:!1,shadowMode:!1})},"35c3":function(t,i,e){var a=e("f05b");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var s=e("4f06").default;s("5f3bd6da",a,!0,{sourceMap:!1,shadowMode:!1})},4534:function(t,i,e){"use strict";e.r(i);var a=e("011d"),s=e.n(a);for(var n in a)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return a[t]}))}(n);i["default"]=s.a},"54cb":function(t,i,e){"use strict";e("7a82"),Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,e("14d9");var a={data:function(){return{ctx:null,width:556,height:292,disabled:!1,readyState:!1,endState:!1,watermark:"刮一刮",watermarkColor:"#c5c5c5",watermarkSize:14,title:"快来刮我",titleColor:"#888",titleSize:24,startX:0,startY:0,touchSize:20,percentage:20,prizeList:[],istrue:!0,good:uni.getStorageSync("good"),good2:uni.getStorageSync("good2"),pid:uni.getStorageSync("pid"),noq:!1}},mounted:function(){var t=this;this.$nextTick((function(){uni.createSelectorQuery().select(".content");t.ctx=uni.createCanvasContext("myCanvas",t),setTimeout((function(i){t.init()}),20)}))},methods:{init:function(){this.endState=!1,this.readyState=!1,this.ctx.clearRect(0,0,this.width,this.height),this.ctx.setFillStyle("#ddd"),this.ctx.fillRect(0,0,this.width,this.height);var t=this.watermark.length*this.watermarkSize;this.ctx.save(),this.ctx.rotate(-10*Math.PI/180);var i=0,e=0,a=0;while((i<=5*this.width||e<=5*this.height)&&a<300)this.ctx.setFillStyle(this.watermarkColor),this.ctx.setFontSize(this.watermarkSize),this.ctx.fillText(this.watermark,i,e),i+=t+1.6*t,i>this.width&&e<=this.height&&(i=100*-Math.random(),e+=3*this.watermarkSize),a++;this.ctx.restore(),this.ctx.setTextAlign("center"),this.ctx.setTextBaseline("middle"),this.ctx.setFillStyle(this.titleColor),this.ctx.setFontSize(this.titleSize),this.ctx.fillText(this.title,this.width/4,this.height/4),this.ctx.draw(),this.readyState=!0},touchstart:function(t){this.disabled||this.en
|