Commit 9c7eb919d6fda78a6d0a673d6568f87c023d790e

Authored by taiyuan
1 parent cc856530

幸运大转盘

app.wxss
... ... @@ -177,6 +177,7 @@
177 177 margin-left: 20rpx;
178 178 }
179 179  
  180 +
180 181 .mgb20 {
181 182 margin-bottom: 20rpx;
182 183 }
... ... @@ -191,6 +192,10 @@
191 192 margin-right: 20rpx;
192 193 }
193 194  
  195 +.mgt30 {
  196 + margin-top: 30rpx;
  197 +}
  198 +
194 199 .h68 {
195 200 height: 68rpx;
196 201 }
... ... @@ -573,9 +578,7 @@ background: #b9b9b9;
573 578 color: #333;
574 579 }
575 580  
576   -.xc-black3{
577   -color: #333;
578   -}
  581 +
579 582  
580 583 .xc-fixed{
581 584 position: fixed;
... ... @@ -639,6 +642,9 @@ background: #ffe3e2;
639 642 .fs40 {
640 643 font-size: 40rpx !important;
641 644 }
  645 +.fs50 {
  646 + font-size: 50rpx !important;
  647 +}
642 648 .ai_c {
643 649 align-items: center;
644 650 }
... ... @@ -683,9 +689,9 @@ background: #ffe3e2;
683 689 /* 图标字体(ty) */
684 690 @font-face {
685 691 font-family: 'iconfont'; /* Project id 2054717 */
686   - src: url('//at.alicdn.com/t/font_2054717_c7o0udng1e4.woff2?t=1625824560076') format('woff2'),
687   - url('//at.alicdn.com/t/font_2054717_c7o0udng1e4.woff?t=1625824560076') format('woff'),
688   - url('//at.alicdn.com/t/font_2054717_c7o0udng1e4.ttf?t=1625824560076') format('truetype');
  692 + src: url('//at.alicdn.com/t/font_2054717_l5nx11noek8.woff2?t=1626055955086') format('woff2'),
  693 + url('//at.alicdn.com/t/font_2054717_l5nx11noek8.woff?t=1626055955086') format('woff'),
  694 + url('//at.alicdn.com/t/font_2054717_l5nx11noek8.ttf?t=1626055955086') format('truetype');
689 695 }
690 696  
691 697 .iconfont {
... ... @@ -696,6 +702,14 @@ background: #ffe3e2;
696 702 -moz-osx-font-smoothing: grayscale;
697 703 }
698 704  
  705 +.icon-zhuanpan:before {
  706 + content: "\e642";
  707 +}
  708 +
  709 +.icon-tel:before {
  710 + content: "\e610";
  711 +}
  712 +
699 713 .icon-liwu:before {
700 714 content: "\e64e";
701 715 }
... ...
packageB/images/luckDraw/badge.png 0 → 100644

2.86 KB

packageB/images/luckDraw/bg.png 0 → 100644

739 KB

packageB/images/luckDraw/coupon.png 0 → 100644

4.83 KB

packageB/images/luckDraw/czz.png 0 → 100644

7.21 KB

packageB/images/luckDraw/gift.png 0 → 100644

14.1 KB

packageB/images/luckDraw/jf.png 0 → 100644

23.8 KB

packageB/images/luckDraw/lb.png 0 → 100644

60 KB

packageB/images/luckDraw/logo.png 0 → 100644

1.51 KB

packageB/images/luckDraw/money.png 0 → 100644

6.63 KB

packageB/images/luckDraw/mr.png 0 → 100644

27.7 KB

packageB/images/luckDraw/mr1.png 0 → 100644

18.5 KB

packageB/images/luckDraw/pointer.png 0 → 100644

23.3 KB

packageB/images/luckDraw/weel.png 0 → 100644

69.5 KB

packageB/images/luckDraw/yhq.png 0 → 100644

19.1 KB

packageB/images/luckDraw/zp.png 0 → 100644

33.2 KB

packageB/miniprogram_npm/lucky-canvas/index.js 0 → 100644
  1 +module.exports = (function() {
  2 +var __MODS__ = {};
  3 +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
  4 +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
  5 +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
  6 +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
  7 +__DEFINE__(1625793648862, function(require, module, exports) {
  8 +module.exports = require('./dist/lucky-canvas.cjs.min.js')
  9 +
  10 +}, function(modId) {var map = {"./dist/lucky-canvas.cjs.min.js":1625793648863}; return __REQUIRE__(map[modId], modId); })
  11 +__DEFINE__(1625793648863, function(require, module, exports) {
  12 +Object.defineProperty(exports,"__esModule",{value:!0});
  13 +/*! *****************************************************************************
  14 +Copyright (c) Microsoft Corporation.
  15 +
  16 +Permission to use, copy, modify, and/or distribute this software for any
  17 +purpose with or without fee is hereby granted.
  18 +
  19 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  20 +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  21 +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  22 +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  23 +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  24 +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  25 +PERFORMANCE OF THIS SOFTWARE.
  26 +***************************************************************************** */
  27 +var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return"\n"!==t})).join("")},u=function(t){if("string"!=typeof t)return!1;if("transparent"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\s,]+)\)$/.exec(t);if(0===(null===(i=e)?0:"object"==typeof i?NaN:"number"==typeof i?i:"string"==typeof i?"%"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c="__proto__"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);["push","pop","shift","unshift","sort","splice","reverse"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return["push","unshift","splice"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,"__luckyOb__",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&"object"==typeof t)return"__luckyOb__"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter="function"==typeof e?e:function(t){t+=".";for(var e=[],i="",n=0;n<t.length;n++){var r=t[n];if(/\[|\./.test(r))e.push(i),i="";else{if(/\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,"array","object")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),"string"==typeof t?t={el:t}:1===t.nodeType&&(t={el:"",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag="WEB"),Object.prototype.hasOwnProperty.call(t,"ob")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement("canvas"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext("2d"),t.canvasElement.setAttribute("package","lucky-canvas@1.5.4"),t.canvasElement.addEventListener("click",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener("mousemove",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener("mousedown",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener("mouseup",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error("无法获取到宽度或高度"):console.error("无法获取到 CanvasContext2D")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,"未传入 dpr 可能会导致绘制异常"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow="hidden",t.divElement.style.width=this.boxWidth+"px",t.divElement.style.height=this.boxHeight+"px")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+"px",i.style.height=s+"px",i.style.transform="scale("+1/n+") translate("+-a(o)+"%, "+-a(s)+"%)",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i="$resolve"),new Promise((function(r,o){if(t||o("=> '"+e.src+"' 不能为空或不合法"),"WEB"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o("=> '"+e.src+"' 图片加载失败")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return["WEB","MP-WX"].includes(s.flag)?o=t:["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,"number")?t:s(t,"string")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={"%":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&"object"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),"object"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf("MP")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){return i({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,"_defaultStyle",(function(){return i({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(" ")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+" "+(r>>0)+"px "+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,"wordWrap")?t.wordWrap:h.wordWrap){p=a(p);for(var g="",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split("\n");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+" "+(s>>0)+"px "+a,String(t.text).split("\n").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},r.activeStyle={},r._activeStyle={background:"#ffce98",shadow:"",fontStyle:"",fontWeight:"",fontSize:"",lineHeight:"",fontColor:""},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols)||3),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"button",t.button),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"activeStyle",t.activeStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,"_defaultStyle",(function(){return i({borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})),this.$computed(this,"_activeStyle",(function(){return i({background:"#ffce98",shadow:""},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch("button",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch("rows",(function(){return t.init({})})),this.$watch("cols",(function(){return t.init({})})),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("activeStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||("function"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],"buttons"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,"$activeResolve")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,"").split(" ").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],"string","number")?~~String(t[h]).replace(/px/g,""):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,"").split(",")[0].split(" ").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor="rgba(0, 0, 0, 0)",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v="prizeImgs";e>=i.prizes.length&&(v="btnImgs",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+" "+(u>>0)+"px "+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,"wordWrap")?e.wordWrap:l.wordWrap){g=a(g);for(var m="",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split("\n");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes("linear-gradient")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\((.+)\)/.exec(o)[1].split(",").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes("deg")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes("top")?u=[e,i+r,e,i]:a.includes("bottom")?u=[e,i,e,i+r]:a.includes("left")?u=[e+n,i,e,i]:a.includes("right")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(" ");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;
  28 +
  29 +}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
  30 +return __REQUIRE__(1625793648862);
  31 +})()
  32 +//miniprogram-npm-outsideDeps=[]
  33 +//# sourceMappingURL=index.js.map
0 34 \ No newline at end of file
... ...
packageB/miniprogram_npm/lucky-canvas/index.js.map 0 → 100644
  1 +{"version":3,"sources":["index.js","dist/lucky-canvas.cjs.min.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["module.exports = require('./dist/lucky-canvas.cjs.min.js')\r\n","Object.defineProperty(exports,\"__esModule\",{value:!0});\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if(\"function\"!=typeof i&&null!==i)throw new TypeError(\"Class extends value \"+String(i)+\" is not a constructor or null\");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return\"number\"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,\"find\",{value:function(t){if(null==this)throw new TypeError('\"this\" is null or not defined');var e=Object(this),i=e.length>>>0;if(\"function\"!=typeof t)throw new TypeError(\"predicate must be a function\");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return\"\\n\"!==t})).join(\"\")},u=function(t){if(\"string\"!=typeof t)return!1;if(\"transparent\"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\\s,]+)\\)$/.exec(t);if(0===(null===(i=e)?0:\"object\"==typeof i?NaN:\"number\"==typeof i?i:\"string\"==typeof i?\"%\"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c=\"__proto__\"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);[\"push\",\"pop\",\"shift\",\"unshift\",\"sort\",\"splice\",\"reverse\"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return[\"push\",\"unshift\",\"splice\"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,\"__luckyOb__\",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&\"object\"==typeof t)return\"__luckyOb__\"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter=\"function\"==typeof e?e:function(t){t+=\".\";for(var e=[],i=\"\",n=0;n<t.length;n++){var r=t[n];if(/\\[|\\./.test(r))e.push(i),i=\"\";else{if(/\\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,\"array\",\"object\")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),\"string\"==typeof t?t={el:t}:1===t.nodeType&&(t={el:\"\",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag=\"WEB\"),Object.prototype.hasOwnProperty.call(t,\"ob\")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement(\"canvas\"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext(\"2d\"),t.canvasElement.setAttribute(\"package\",\"lucky-canvas@1.5.4\"),t.canvasElement.addEventListener(\"click\",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener(\"mousemove\",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener(\"mousedown\",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener(\"mouseup\",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error(\"无法获取到宽度或高度\"):console.error(\"无法获取到 CanvasContext2D\")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,\"未传入 dpr 可能会导致绘制异常\"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow=\"hidden\",t.divElement.style.width=this.boxWidth+\"px\",t.divElement.style.height=this.boxHeight+\"px\")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+\"px\",i.style.height=s+\"px\",i.style.transform=\"scale(\"+1/n+\") translate(\"+-a(o)+\"%, \"+-a(s)+\"%)\",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i=\"$resolve\"),new Promise((function(r,o){if(t||o(\"=> '\"+e.src+\"' 不能为空或不合法\"),\"WEB\"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o(\"=> '\"+e.src+\"' 图片加载失败\")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return[\"WEB\",\"MP-WX\"].includes(s.flag)?o=t:[\"UNI-H5\",\"UNI-MP\",\"TARO-H5\",\"TARO-MP\"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={\"%\":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&\"object\"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),\"object\"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf(\"MP\")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){return i({gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,\"_defaultStyle\",(function(){return i({fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(\" \")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+\" \"+(r>>0)+\"px \"+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,\"wordWrap\")?t.wordWrap:h.wordWrap){p=a(p);for(var g=\"\",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split(\"\\n\");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+\" \"+(s>>0)+\"px \"+a,String(t.text).split(\"\\n\").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},r.activeStyle={},r._activeStyle={background:\"#ffce98\",shadow:\"\",fontStyle:\"\",fontWeight:\"\",fontSize:\"\",lineHeight:\"\",fontColor:\"\"},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,\"rows\",Number(t.rows)||3),this.$set(this,\"cols\",Number(t.cols)||3),this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"button\",t.button),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"activeStyle\",t.activeStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,\"_defaultStyle\",(function(){return i({borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)})),this.$computed(this,\"_activeStyle\",(function(){return i({background:\"#ffce98\",shadow:\"\"},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch(\"button\",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch(\"rows\",(function(){return t.init({})})),this.$watch(\"cols\",(function(){return t.init({})})),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"activeStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||(\"function\"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],\"buttons\"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,\"$activeResolve\")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,\"\").split(\" \").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],\"string\",\"number\")?~~String(t[h]).replace(/px/g,\"\"):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,\"\").split(\",\")[0].split(\" \").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor=\"rgba(0, 0, 0, 0)\",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v=\"prizeImgs\";e>=i.prizes.length&&(v=\"btnImgs\",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+\" \"+(u>>0)+\"px \"+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,\"wordWrap\")?e.wordWrap:l.wordWrap){g=a(g);for(var m=\"\",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split(\"\\n\");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes(\"linear-gradient\")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\\((.+)\\)/.exec(o)[1].split(\",\").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes(\"deg\")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes(\"top\")?u=[e,i+r,e,i]:a.includes(\"bottom\")?u=[e,i,e,i+r]:a.includes(\"left\")?u=[e+n,i,e,i]:a.includes(\"right\")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(\" \");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;\n"]}
0 2 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js 0 → 100644
  1 +module.exports =
  2 +/******/ (function(modules) { // webpackBootstrap
  3 +/******/ // The module cache
  4 +/******/ var installedModules = {};
  5 +/******/
  6 +/******/ // The require function
  7 +/******/ function __webpack_require__(moduleId) {
  8 +/******/
  9 +/******/ // Check if module is in cache
  10 +/******/ if(installedModules[moduleId]) {
  11 +/******/ return installedModules[moduleId].exports;
  12 +/******/ }
  13 +/******/ // Create a new module (and put it into the cache)
  14 +/******/ var module = installedModules[moduleId] = {
  15 +/******/ i: moduleId,
  16 +/******/ l: false,
  17 +/******/ exports: {}
  18 +/******/ };
  19 +/******/
  20 +/******/ // Execute the module function
  21 +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22 +/******/
  23 +/******/ // Flag the module as loaded
  24 +/******/ module.l = true;
  25 +/******/
  26 +/******/ // Return the exports of the module
  27 +/******/ return module.exports;
  28 +/******/ }
  29 +/******/
  30 +/******/
  31 +/******/ // expose the modules object (__webpack_modules__)
  32 +/******/ __webpack_require__.m = modules;
  33 +/******/
  34 +/******/ // expose the module cache
  35 +/******/ __webpack_require__.c = installedModules;
  36 +/******/
  37 +/******/ // define getter function for harmony exports
  38 +/******/ __webpack_require__.d = function(exports, name, getter) {
  39 +/******/ if(!__webpack_require__.o(exports, name)) {
  40 +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41 +/******/ }
  42 +/******/ };
  43 +/******/
  44 +/******/ // define __esModule on exports
  45 +/******/ __webpack_require__.r = function(exports) {
  46 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48 +/******/ }
  49 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
  50 +/******/ };
  51 +/******/
  52 +/******/ // create a fake namespace object
  53 +/******/ // mode & 1: value is a module id, require it
  54 +/******/ // mode & 2: merge all properties of value into the ns
  55 +/******/ // mode & 4: return value when already ns object
  56 +/******/ // mode & 8|1: behave like require
  57 +/******/ __webpack_require__.t = function(value, mode) {
  58 +/******/ if(mode & 1) value = __webpack_require__(value);
  59 +/******/ if(mode & 8) return value;
  60 +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61 +/******/ var ns = Object.create(null);
  62 +/******/ __webpack_require__.r(ns);
  63 +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64 +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65 +/******/ return ns;
  66 +/******/ };
  67 +/******/
  68 +/******/ // getDefaultExport function for compatibility with non-harmony modules
  69 +/******/ __webpack_require__.n = function(module) {
  70 +/******/ var getter = module && module.__esModule ?
  71 +/******/ function getDefault() { return module['default']; } :
  72 +/******/ function getModuleExports() { return module; };
  73 +/******/ __webpack_require__.d(getter, 'a', getter);
  74 +/******/ return getter;
  75 +/******/ };
  76 +/******/
  77 +/******/ // Object.prototype.hasOwnProperty.call
  78 +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79 +/******/
  80 +/******/ // __webpack_public_path__
  81 +/******/ __webpack_require__.p = "";
  82 +/******/
  83 +/******/
  84 +/******/ // Load entry module and return exports
  85 +/******/ return __webpack_require__(__webpack_require__.s = 2);
  86 +/******/ })
  87 +/************************************************************************/
  88 +/******/ ([
  89 +/* 0 */
  90 +/***/ (function(module, exports, __webpack_require__) {
  91 +
  92 +"use strict";
  93 +Object.defineProperty(exports,"__esModule",{value:!0});
  94 +/*! *****************************************************************************
  95 +Copyright (c) Microsoft Corporation.
  96 +
  97 +Permission to use, copy, modify, and/or distribute this software for any
  98 +purpose with or without fee is hereby granted.
  99 +
  100 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  101 +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  102 +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  103 +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  104 +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  105 +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  106 +PERFORMANCE OF THIS SOFTWARE.
  107 +***************************************************************************** */
  108 +var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return"\n"!==t})).join("")},u=function(t){if("string"!=typeof t)return!1;if("transparent"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\s,]+)\)$/.exec(t);if(0===(null===(i=e)?0:"object"==typeof i?NaN:"number"==typeof i?i:"string"==typeof i?"%"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c="__proto__"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);["push","pop","shift","unshift","sort","splice","reverse"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return["push","unshift","splice"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,"__luckyOb__",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&"object"==typeof t)return"__luckyOb__"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter="function"==typeof e?e:function(t){t+=".";for(var e=[],i="",n=0;n<t.length;n++){var r=t[n];if(/\[|\./.test(r))e.push(i),i="";else{if(/\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,"array","object")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),"string"==typeof t?t={el:t}:1===t.nodeType&&(t={el:"",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag="WEB"),Object.prototype.hasOwnProperty.call(t,"ob")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement("canvas"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext("2d"),t.canvasElement.setAttribute("package","lucky-canvas@1.5.4"),t.canvasElement.addEventListener("click",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener("mousemove",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener("mousedown",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener("mouseup",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error("无法获取到宽度或高度"):console.error("无法获取到 CanvasContext2D")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,"未传入 dpr 可能会导致绘制异常"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow="hidden",t.divElement.style.width=this.boxWidth+"px",t.divElement.style.height=this.boxHeight+"px")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+"px",i.style.height=s+"px",i.style.transform="scale("+1/n+") translate("+-a(o)+"%, "+-a(s)+"%)",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i="$resolve"),new Promise((function(r,o){if(t||o("=> '"+e.src+"' 不能为空或不合法"),"WEB"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o("=> '"+e.src+"' 图片加载失败")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return["WEB","MP-WX"].includes(s.flag)?o=t:["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,"number")?t:s(t,"string")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={"%":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&"object"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),"object"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf("MP")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){return i({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,"_defaultStyle",(function(){return i({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(" ")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+" "+(r>>0)+"px "+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,"wordWrap")?t.wordWrap:h.wordWrap){p=a(p);for(var g="",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split("\n");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+" "+(s>>0)+"px "+a,String(t.text).split("\n").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,"number")?t:s(t,"string")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",lineHeight:"",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},r.activeStyle={},r._activeStyle={background:"#ffce98",shadow:"",fontStyle:"",fontWeight:"",fontSize:"",lineHeight:"",fontColor:""},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols)||3),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"button",t.button),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"activeStyle",t.activeStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,"_defaultStyle",(function(){return i({borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})),this.$computed(this,"_activeStyle",(function(){return i({background:"#ffce98",shadow:""},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch("blocks",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("prizes",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch("buttons",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch("button",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch("rows",(function(){return t.init({})})),this.$watch("cols",(function(){return t.init({})})),this.$watch("defaultConfig",(function(){return t.draw()}),{deep:!0}),this.$watch("defaultStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("activeStyle",(function(){return t.draw()}),{deep:!0}),this.$watch("startCallback",(function(){return t.init({})})),this.$watch("endCallback",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:"blocks",prizeImgs:"prizes",btnImgs:"buttons"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||("function"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],"buttons"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,"$activeResolve")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+"["+e+"].imgs["+o+"] "+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,"").split(" ").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],"string","number")?~~String(t[h]).replace(/px/g,""):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,"").split(",")[0].split(" ").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor="rgba(0, 0, 0, 0)",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v="prizeImgs";e>=i.prizes.length&&(v="btnImgs",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+" "+(u>>0)+"px "+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,"wordWrap")?e.wordWrap:l.wordWrap){g=a(g);for(var m="",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split("\n");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes("linear-gradient")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\((.+)\)/.exec(o)[1].split(",").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes("deg")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes("top")?u=[e,i+r,e,i]:a.includes("bottom")?u=[e,i,e,i+r]:a.includes("left")?u=[e+n,i,e,i]:a.includes("right")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(" ");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,"number")?t:s(t,"string")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;
  109 +
  110 +
  111 +/***/ }),
  112 +/* 1 */
  113 +/***/ (function(module, exports, __webpack_require__) {
  114 +
  115 +"use strict";
  116 +
  117 +
  118 +exports.__esModule = true;
  119 +exports.getImage = getImage;
  120 +var windowWidth = wx.getSystemInfoSync().windowWidth;
  121 +
  122 +var rpx2px = exports.rpx2px = function rpx2px(value) {
  123 + if (typeof value === 'string') value = Number(value.replace(/[a-z]*/g, ''));
  124 + return windowWidth / 750 * value;
  125 +};
  126 +
  127 +var changeUnits = exports.changeUnits = function changeUnits(value) {
  128 + return Number(value.replace(/^(\-*[0-9.]*)([a-z%]*)$/, function (value, num, unit) {
  129 + switch (unit) {
  130 + case 'px':
  131 + num *= 1;
  132 + break;
  133 + case 'rpx':
  134 + num = rpx2px(num);
  135 + break;
  136 + default:
  137 + num *= 1;
  138 + break;
  139 + }
  140 + return num;
  141 + }));
  142 +};
  143 +
  144 +var resolveImage = exports.resolveImage = function resolveImage(e, img, canvas) {
  145 + var srcName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'src';
  146 + var resolveName = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '$resolve';
  147 +
  148 + var imgObj = canvas.createImage();
  149 + imgObj.onload = function () {
  150 + img[resolveName](imgObj);
  151 + };
  152 + imgObj.src = img[srcName];
  153 +};
  154 +
  155 +function getImage() {
  156 + var _this = this;
  157 +
  158 + return new Promise(function (resolve, reject) {
  159 + wx.canvasToTempFilePath({
  160 + canvas: _this.canvas,
  161 + success: function success(res) {
  162 + return resolve(res);
  163 + },
  164 + fail: function fail(err) {
  165 + return reject(err);
  166 + }
  167 + });
  168 + });
  169 +}
  170 +
  171 +/***/ }),
  172 +/* 2 */
  173 +/***/ (function(module, exports, __webpack_require__) {
  174 +
  175 +"use strict";
  176 +
  177 +
  178 +var _luckyCanvasCjs = __webpack_require__(0);
  179 +
  180 +var _utils = __webpack_require__(1);
  181 +
  182 +Component({
  183 + properties: {
  184 + width: { type: String, value: '600rpx' },
  185 + height: { type: String, value: '600rpx' },
  186 + blocks: { type: Array, value: [] },
  187 + prizes: { type: Array, value: [] },
  188 + buttons: { type: Array, value: [] },
  189 + defaultConfig: { type: Object, value: {} },
  190 + defaultStyle: { type: Object, value: {} },
  191 + start: { type: Function, value: function value() {} },
  192 + end: { type: Function, value: function value() {} }
  193 + },
  194 + data: {
  195 + isShow: false,
  196 + luckyImg: '',
  197 + showCanvas: true
  198 + },
  199 + observers: {
  200 + 'blocks.**': function blocks(newData, oldData) {
  201 + this.$lucky && (this.$lucky.blocks = newData);
  202 + },
  203 + 'prizes.**': function prizes(newData, oldData) {
  204 + this.$lucky && (this.$lucky.prizes = newData);
  205 + },
  206 + 'buttons.**': function buttons(newData, oldData) {
  207 + this.$lucky && (this.$lucky.buttons = newData);
  208 + }
  209 + },
  210 + ready: function ready() {
  211 + var _this = this;
  212 +
  213 + wx.createSelectorQuery().in(this).select('#lucky-wheel').fields({
  214 + node: true, size: true
  215 + }).exec(function (res) {
  216 + if (!res[0] || !res[0].node) {
  217 + return console.error('lucky-canvas 获取不到 canvas 标签');
  218 + }
  219 + var canvas = _this.canvas = res[0].node;
  220 + var dpr = _this.dpr = wx.getSystemInfoSync().pixelRatio;
  221 + var ctx = _this.ctx = canvas.getContext('2d');
  222 + var data = _this.data;
  223 + canvas.width = res[0].width * dpr;
  224 + canvas.height = res[0].height * dpr;
  225 + ctx.scale(dpr, dpr);
  226 + _this.$lucky = new _luckyCanvasCjs.LuckyWheel({
  227 + flag: 'MP-WX',
  228 + ctx: ctx,
  229 + dpr: dpr,
  230 + width: res[0].width,
  231 + height: res[0].height,
  232 + // rAF: canvas.requestAnimationFrame, // 帧动画真机调试会报错!
  233 + setTimeout: setTimeout,
  234 + clearTimeout: clearTimeout,
  235 + setInterval: setInterval,
  236 + clearInterval: clearInterval,
  237 + beforeCreate: function beforeCreate() {
  238 + var Radius = Math.min(this.config.width, this.config.height) / 2;
  239 + // 设置坐标轴
  240 + ctx.translate(Radius, Radius);
  241 + },
  242 + beforeInit: function beforeInit() {
  243 + // 重置坐标轴
  244 + ctx.translate(-this.Radius, -this.Radius);
  245 + },
  246 + unitFunc: function unitFunc(num, unit) {
  247 + return (0, _utils.changeUnits)(num + unit);
  248 + }
  249 + }, {
  250 + blocks: data.blocks,
  251 + prizes: data.prizes,
  252 + buttons: data.buttons,
  253 + defaultConfig: data.defaultConfig,
  254 + defaultStyle: data.defaultStyle,
  255 + start: function start() {
  256 + for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
  257 + rest[_key] = arguments[_key];
  258 + }
  259 +
  260 + _this.triggerEvent.apply(_this, ['start'].concat(rest));
  261 + },
  262 + end: function end() {
  263 + for (var _len2 = arguments.length, rest = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  264 + rest[_key2] = arguments[_key2];
  265 + }
  266 +
  267 + _this.triggerEvent.apply(_this, ['end'].concat(rest));
  268 + _utils.getImage.call(_this).then(function (res) {
  269 + _this.setData({ luckyImg: res.tempFilePath });
  270 + });
  271 + }
  272 + });
  273 + // 为了保证 onload 回调准确
  274 + _this.setData({ isShow: true });
  275 + });
  276 + },
  277 +
  278 + methods: {
  279 + imgBindload: function imgBindload(e) {
  280 + var _e$currentTarget$data = e.currentTarget.dataset,
  281 + name = _e$currentTarget$data.name,
  282 + index = _e$currentTarget$data.index,
  283 + i = _e$currentTarget$data.i;
  284 +
  285 + var img = this.data[name][index].imgs[i];
  286 + (0, _utils.resolveImage)(e, img, this.canvas);
  287 + },
  288 + luckyImgLoad: function luckyImgLoad() {
  289 + this.showCanvas = false;
  290 + },
  291 + handleClickOfImg: function handleClickOfImg(e) {
  292 + var _this2 = this;
  293 +
  294 + var _e$changedTouches$ = e.changedTouches[0],
  295 + x = _e$changedTouches$.clientX,
  296 + y = _e$changedTouches$.clientY;
  297 +
  298 + wx.createSelectorQuery().in(this).select('.lucky-img').fields({
  299 + rect: true
  300 + }).exec(function (res) {
  301 + var _res$ = res[0],
  302 + left = _res$.left,
  303 + top = _res$.top;
  304 +
  305 + _this2.toPlay(x - left, y - top);
  306 + });
  307 + },
  308 + handleClickOfCanvas: function handleClickOfCanvas(e) {
  309 + var _e$changedTouches$2 = e.changedTouches[0],
  310 + x = _e$changedTouches$2.x,
  311 + y = _e$changedTouches$2.y;
  312 +
  313 + this.toPlay(x, y);
  314 + },
  315 + toPlay: function toPlay(x, y) {
  316 + var ctx = this.ctx;
  317 + ctx.beginPath();
  318 + ctx.arc(0, 0, this.$lucky.maxBtnRadius, 0, Math.PI * 2, false);
  319 + if (!ctx.isPointInPath(x * this.dpr, y * this.dpr)) return;
  320 + // 隐藏图片并显示canvas
  321 + this.showCanvas = true;
  322 + this.setData({ luckyImg: '' });
  323 + // 触发 lucky-canvas 的抽奖逻辑
  324 + this.$lucky.startCallback();
  325 + },
  326 + play: function play() {
  327 + var _$lucky;
  328 +
  329 + (_$lucky = this.$lucky).play.apply(_$lucky, arguments);
  330 + },
  331 + stop: function stop() {
  332 + var _$lucky2;
  333 +
  334 + (_$lucky2 = this.$lucky).stop.apply(_$lucky2, arguments);
  335 + }
  336 + }
  337 +});
  338 +
  339 +/***/ })
  340 +/******/ ]);
  341 +//# sourceMappingURL=index.js.map
0 342 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.js.map 0 → 100644
  1 +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/lucky-canvas/dist/lucky-canvas.cjs.min.js","webpack:///./src/utils.js","webpack:///./src/lucky-wheel/index.js"],"names":["getImage","windowWidth","wx","getSystemInfoSync","rpx2px","value","Number","replace","changeUnits","num","unit","resolveImage","e","img","canvas","srcName","resolveName","imgObj","createImage","onload","src","Promise","resolve","reject","canvasToTempFilePath","success","res","fail","err","Component","properties","width","type","String","height","blocks","Array","prizes","buttons","defaultConfig","Object","defaultStyle","start","Function","end","data","isShow","luckyImg","showCanvas","observers","newData","oldData","$lucky","ready","createSelectorQuery","in","select","fields","node","size","exec","console","error","dpr","pixelRatio","ctx","getContext","scale","LuckyWheel","flag","setTimeout","clearTimeout","setInterval","clearInterval","beforeCreate","Radius","Math","min","config","translate","beforeInit","unitFunc","rest","triggerEvent","call","then","setData","tempFilePath","methods","imgBindload","currentTarget","dataset","name","index","i","imgs","luckyImgLoad","handleClickOfImg","changedTouches","x","clientX","y","clientY","rect","left","top","toPlay","handleClickOfCanvas","beginPath","arc","maxBtnRadius","PI","isPointInPath","startCallback","play","stop"],"mappings":"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","file":"lucky-wheel\\index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0});\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){if(\"function\"!=typeof i&&null!==i)throw new TypeError(\"Class extends value \"+String(i)+\" is not a constructor or null\");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t}String.prototype.includes||(String.prototype.includes=function(t,e){return\"number\"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),Array.prototype.find||Object.defineProperty(Array.prototype,\"find\",{value:function(t){if(null==this)throw new TypeError('\"this\" is null or not defined');var e=Object(this),i=e.length>>>0;if(\"function\"!=typeof t)throw new TypeError(\"predicate must be a function\");for(var n=arguments[1],r=0;r<i;){var o=e[r];if(t.call(n,o,r,e))return o;r++}}});var s=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.some((function(e){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e}))},a=function(t){return[].filter.call(t,(function(t){return\"\\n\"!==t})).join(\"\")},u=function(t){if(\"string\"!=typeof t)return!1;if(\"transparent\"===(t=t.toLocaleLowerCase().trim()))return!1;if(/^rgba/.test(t)){var e=/([^\\s,]+)\\)$/.exec(t);if(0===(null===(i=e)?0:\"object\"==typeof i?NaN:\"number\"==typeof i?i:\"string\"==typeof i?\"%\"===i[i.length-1]?Number(i.slice(0,-1))/100:Number(i):NaN))return!1}var i;return!0},h=function(){function t(){this.subs=[]}return t.prototype.addSub=function(t){this.subs.includes(t)||this.subs.push(t)},t.prototype.notify=function(){this.subs.forEach((function(t){t.update()}))},t}(),c=\"__proto__\"in{};function l(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var f=Array.prototype,d=Object.create(f);[\"push\",\"pop\",\"shift\",\"unshift\",\"sort\",\"splice\",\"reverse\"].forEach((function(t){d[t]=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=f[t].apply(this,e),r=this.__luckyOb__;return[\"push\",\"unshift\",\"splice\"].includes(t)&&r.walk(this),r.dep.notify(),n}}));var p=function(){function t(t){this.dep=new h,l(t,\"__luckyOb__\",this),Array.isArray(t)&&(c?t.__proto__=d:Object.getOwnPropertyNames(d).forEach((function(e){l(t,e,d[e])}))),this.walk(t)}return t.prototype.walk=function(t){Object.keys(t).forEach((function(e){m(t,e,t[e])}))},t}();function g(t){if(t&&\"object\"==typeof t)return\"__luckyOb__\"in t?t.__luckyOb__:new p(t)}function m(t,e,i){var n=new h,r=Object.getOwnPropertyDescriptor(t,e);if(!r||!1!==r.configurable){var o=r&&r.get,s=r&&r.set;o&&!s||2!==arguments.length||(i=t[e]);var a=g(i);Object.defineProperty(t,e,{get:function(){var e=o?o.call(t):i;return h.target&&(n.addSub(h.target),a&&a.dep.addSub(h.target)),e},set:function(e){e!==i&&(i=e,o&&!s||(s?s.call(t,e):i=e,a=g(e),n.notify()))}})}}var v=0,b=function(){function t(t,e,i,n){void 0===n&&(n={}),this.id=v++,this.$lucky=t,this.expr=e,this.deep=!!n.deep,this.getter=\"function\"==typeof e?e:function(t){t+=\".\";for(var e=[],i=\"\",n=0;n<t.length;n++){var r=t[n];if(/\\[|\\./.test(r))e.push(i),i=\"\";else{if(/\\W/.test(r))continue;i+=r}}return function(t){return e.reduce((function(t,e){return t[e]}),t)}}(e),this.cb=i,this.value=this.get()}return t.prototype.get=function(){h.target=this;var t=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var e=function(t){s(t,\"array\",\"object\")&&Object.keys(t).forEach((function(i){var n=t[i];e(n)}))};e(t)}(t),h.target=null,t},t.prototype.update=function(){var t=this.get(),e=this.value;this.value=t,this.cb.call(this.$lucky,t,e)},t}(),y=function(){function t(t){var e=this;this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,this.setHTMLFontSize(),\"string\"==typeof t?t={el:t}:1===t.nodeType&&(t={el:\"\",divElement:t}),t=t,this.config=t,this.setDpr(),this.initWindowFunction(),t.flag||(t.flag=\"WEB\"),Object.prototype.hasOwnProperty.call(t,\"ob\")||(t.ob=!0),t.el&&(t.divElement=document.querySelector(t.el)),t.divElement&&(t.canvasElement=document.createElement(\"canvas\"),t.divElement.appendChild(t.canvasElement)),this.resetWidthAndHeight(),t.canvasElement&&(t.ctx=t.canvasElement.getContext(\"2d\"),t.canvasElement.setAttribute(\"package\",\"lucky-canvas@1.5.4\"),t.canvasElement.addEventListener(\"click\",(function(t){return e.handleClick(t)})),t.canvasElement.addEventListener(\"mousemove\",(function(t){return e.handleMouseMove(t)})),t.canvasElement.addEventListener(\"mousedown\",(function(t){return e.handleMouseDown(t)})),t.canvasElement.addEventListener(\"mouseup\",(function(t){return e.handleMouseUp(t)}))),this.ctx=t.ctx,t.ctx?this.boxWidth&&this.boxHeight||console.error(\"无法获取到宽度或高度\"):console.error(\"无法获取到 CanvasContext2D\")}return t.prototype.init=function(t){this.setDpr(),this.setHTMLFontSize(),this.resetWidthAndHeight(),this.zoomCanvas()},t.prototype.handleClick=function(t){},t.prototype.handleMouseDown=function(t){},t.prototype.handleMouseUp=function(t){},t.prototype.handleMouseMove=function(t){},t.prototype.conversionAxis=function(t,e){return[0,0]},t.prototype.setDpr=function(){var t=this.config;t.dpr||(window?window.dpr=t.dpr=window.devicePixelRatio||1:t.dpr||console.error(t,\"未传入 dpr 可能会导致绘制异常\"))},t.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},t.prototype.resetWidthAndHeight=function(){var t=this.config,e=0,i=0;t.divElement&&(e=t.divElement.offsetWidth,i=t.divElement.offsetHeight),this.boxWidth=this.getLength(t.width)||e,this.boxHeight=this.getLength(t.height)||i,t.divElement&&(t.divElement.style.overflow=\"hidden\",t.divElement.style.width=this.boxWidth+\"px\",t.divElement.style.height=this.boxHeight+\"px\")},t.prototype.initWindowFunction=function(){var t=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},t.setTimeout=window.setTimeout,t.setInterval=window.setInterval,t.clearTimeout=window.clearTimeout,void(t.clearInterval=window.clearInterval);if(t.rAF)this.rAF=t.rAF;else if(t.setTimeout){var e=t.setTimeout;this.rAF=function(t){return e(t,16.7)}}else this.rAF=function(t){return setTimeout(t,16.7)}},t.prototype.zoomCanvas=function(){var t=this.config,e=this.ctx,i=t.canvasElement,n=t.dpr,r=[this.boxWidth*n,this.boxHeight*n],o=r[0],s=r[1],a=function(t){return(t*n-t)/(t*n)*(n/2)*100};i&&(i.width=o,i.height=s,i.style.width=o+\"px\",i.style.height=s+\"px\",i.style.transform=\"scale(\"+1/n+\") translate(\"+-a(o)+\"%, \"+-a(s)+\"%)\",e.scale(n,n))},t.prototype.loadImg=function(t,e,i){var n=this;return void 0===i&&(i=\"$resolve\"),new Promise((function(r,o){if(t||o(\"=> '\"+e.src+\"' 不能为空或不合法\"),\"WEB\"===n.config.flag){var s=new Image;s.src=t,s.onload=function(){return r(s)},s.onerror=function(){return o(\"=> '\"+e.src+\"' 图片加载失败\")}}else e[i]=r}))},t.prototype.drawImage=function(t,e,i,n,r){var o,s=this.config,a=this.ctx;return[\"WEB\",\"MP-WX\"].includes(s.flag)?o=t:[\"UNI-H5\",\"UNI-MP\",\"TARO-H5\",\"TARO-MP\"].includes(s.flag)&&(o=t.path),a.drawImage(o,e,i,n,r)},t.prototype.getLength=function(t){return s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t):0},t.prototype.changeUnits=function(t,e){var i=this;return void 0===e&&(e=1),Number(t.replace(/^([-]*[0-9.]*)([a-z%]*)$/,(function(t,n,r){var o={\"%\":function(t){return t*(e/100)},px:function(t){return 1*t},rem:function(t){return t*i.htmlFontSize}}[r];if(o)return o(n);var s=i.config.unitFunc;return s?s(n,r):n})))},t.prototype.$set=function(t,e,i){t&&\"object\"==typeof t&&m(t,e,i)},t.prototype.$computed=function(t,e,i){var n=this;Object.defineProperty(t,e,{get:function(){return i.call(n)}})},t.prototype.$watch=function(t,e,i){void 0===i&&(i={}),\"object\"==typeof e&&(e=(i=e).handler);var n=new b(this,t,e,i);return i.immediate&&e.call(this,n.value),function(){}},t}(),w=function(t){return Math.PI/180*t},x=function(t,e){return[+(Math.cos(t)*e).toFixed(8),+(Math.sin(t)*e).toFixed(8)]},z=function(t,e){var i=-t/e;return[i,-i*t+e]},I=function(t,e,i,n,r,o){var s;if(void 0===o&&(o=!0),Math.abs(r-n).toFixed(8)>=w(180).toFixed(8)){var a=(r+n)/2;return o?(I(t,e,i,n,a,o),I(t,e,i,a,r,o)):(I(t,e,i,a,r,o),I(t,e,i,n,a,o)),!1}o||(n=(s=[r,n])[0],r=s[1]);var u=x(n,i),h=u[0],c=u[1],l=x(r,i),f=l[0],d=l[1],p=z(h,c),g=p[0],m=p[1],v=z(f,d),b=v[0],y=v[1],k=(y-m)/(g-b),S=(b*m-g*y)/(b-g);isNaN(k)&&(Math.abs(h)===+i.toFixed(8)&&(k=h),Math.abs(f)===+i.toFixed(8)&&(k=f)),g===1/0||g===-1/0?S=b*k+y:b!==1/0&&b!==-1/0||(S=g*k+m),e.lineTo(h,c),t.indexOf(\"MP\")>0?e.quadraticCurveTo(k,S,f,d):e.arcTo(k,S,f,d,i)},k=function(t,e,i,n,r,o,s,a){i||(i=s);var u=w(90/Math.PI/n*s),h=w(90/Math.PI/i*s),c=r+u,l=o-u,f=r+h,d=o-h;e.beginPath(),e.fillStyle=a,e.moveTo.apply(e,x(c,n)),I(t,e,n,c,l,!0),d>f?I(t,e,i,f,d,!1):e.lineTo.apply(e,x((r+o)/2,s/2/Math.abs(Math.sin((r-o)/2)))),e.closePath(),e.fill()},S=function(t,e,i,n,r,o,s){var a=Math.min(n,r);o>a/2&&(o=a/2),t.beginPath(),t.fillStyle=s,t.moveTo(e+o,i),t.lineTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill()},C={easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*(t/=n)*(t-2)+e}},T={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sin(t/n*(Math.PI/2))+e}},W={easeIn:function(t,e,i,n){return t>=n&&(t=n),0==t?e:i*Math.pow(2,10*(t/n-1))+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),t==n?e+i:i*(1-Math.pow(2,-10*t/n))+e}},O={easeIn:function(t,e,i,n){return t>=n&&(t=n),-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*Math.sqrt(1-(t=t/n-1)*t)+e}},_=Object.freeze({__proto__:null,quad:C,cubic:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t+1)+e}},quart:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),-i*((t=t/n-1)*t*t*t-1)+e}},quint:{easeIn:function(t,e,i,n){return t>=n&&(t=n),i*(t/=n)*t*t*t*t+e},easeOut:function(t,e,i,n){return t>=n&&(t=n),i*((t=t/n-1)*t*t*t*t+1)+e}},sine:T,expo:W,circ:O}),E=function(t){function o(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;return r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},r.defaultStyle={},r._defaultStyle={fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},r.Radius=0,r.prizeRadius=0,r.prizeDeg=0,r.prizeRadian=0,r.rotateDeg=0,r.maxBtnRadius=0,r.startTime=0,r.endTime=0,r.stopDeg=0,r.endDeg=0,r.FPS=16.6,r.blockImgs=[[]],r.prizeImgs=[[]],r.btnImgs=[[]],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:r.buttons.map((function(t){return t.imgs}))}),r}return e(o,t),o.prototype.initData=function(t){this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},o.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){return i({gutter:\"0px\",offsetDegree:0,speed:20,speedFunction:\"quad\",accelerationTime:2500,decelerationTime:2500,stopRange:.8},t.defaultConfig)})),this.$computed(this,\"_defaultStyle\",(function(){return i({fontSize:\"18px\",fontColor:\"#000\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)}))},o.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){return t.init({btnImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},o.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this.config,s=this.ctx;this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,null===(i=o.beforeInit)||void 0===i||i.call(this),s.translate(this.Radius,this.Radius),this.draw(),this.draw(),Object.keys(e).forEach((function(t){var i=t,n={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i],o=e[i];o&&o.forEach((function(t,e){t&&t.forEach((function(t,o){r.loadAndCacheImg(n,e,i,o,(function(){r.draw()}))}))}))})),null===(n=o.afterInit)||void 0===n||n.call(this)},o.prototype.handleClick=function(t){var e,i=this.ctx;i.beginPath(),i.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),i.isPointInPath(t.offsetX,t.offsetY)&&(this.startTime||null===(e=this.startCallback)||void 0===e||e.call(this,t))},o.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u=this;return r(this,(function(r){return(n=this[t][e])&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),this.loadImg(a.src,a).then((function(t){u[i][e][o]=t,s.call(u)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},o.prototype.computedWidthAndHeight=function(t,e,i,n){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var r=this.getWidth(e.width,i);return[r,t.height*(r/t.width)]}if(!e.width&&e.height){var o=this.getHeight(e.height,n);return[t.width*(o/t.height),o]}return[this.getWidth(e.width,i),this.getHeight(e.height,n)]},o.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,o=n.ctx,s=n._defaultConfig,h=n._defaultStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce((function(t,e,n){return u(e.background)&&(o.beginPath(),o.fillStyle=e.background,o.arc(0,0,t,0,2*Math.PI,!1),o.fill()),e.imgs&&e.imgs.forEach((function(e,r){if(i.blockImgs[n]){var s=i.blockImgs[n][r];if(s){var a=i.computedWidthAndHeight(s,e,2*t,2*t),u=a[0],h=a[1],c=[i.getOffsetX(u),i.getHeight(e.top,2*t)-t],l=c[0],f=c[1];o.save(),e.rotate&&o.rotate(w(i.rotateDeg)),i.drawImage(s,l,f,u,h),o.restore()}}})),t-i.getLength(e.padding&&e.padding.split(\" \")[0])}),this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeRadian=w(this.prizeDeg);var c=w(-90+this.rotateDeg+s.offsetDegree),l=function(t){return i.getOffsetX(o.measureText(t).width)},f=function(t,e,n){var r=t.lineHeight||h.lineHeight||t.fontSize||h.fontSize;return i.getHeight(t.top,e)+(n+1)*i.getLength(r)};o.save(),this.prizes.forEach((function(t,e){var n=c+e*i.prizeRadian,d=i.prizeRadius-i.maxBtnRadius,p=t.background||h.background;u(p)&&function(t,e,i,n,r,o,s,a){s?k(t,e,i,n,r,o,s,a):(e.beginPath(),e.fillStyle=a,e.moveTo(0,0),e.arc(0,0,n,r,o,!1),e.closePath(),e.fill())}(r.flag,o,i.maxBtnRadius,i.prizeRadius,n-i.prizeRadian/2,n+i.prizeRadian/2,i.getLength(s.gutter),p);var g=Math.cos(n)*i.prizeRadius,m=Math.sin(n)*i.prizeRadius;o.translate(g,m),o.rotate(n+w(90)),t.imgs&&t.imgs.forEach((function(t,n){if(i.prizeImgs[e]){var r=i.prizeImgs[e][n];if(r){var o=i.computedWidthAndHeight(r,t,i.prizeRadian*i.prizeRadius,d),s=o[0],a=o[1],u=[i.getOffsetX(s),i.getHeight(t.top,d)],h=u[0],c=u[1];i.drawImage(r,h,c,s,a)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,n=t.fontWeight||h.fontWeight,r=i.getLength(t.fontSize||h.fontSize),u=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=n+\" \"+(r>>0)+\"px \"+u;var c=[],p=String(t.text);if(Object.prototype.hasOwnProperty.call(t,\"wordWrap\")?t.wordWrap:h.wordWrap){p=a(p);for(var g=\"\",m=0;m<p.length;m++){g+=p[m];var v=o.measureText(g).width,b=(i.prizeRadius-f(t,d,c.length))*Math.tan(i.prizeRadian/2)*2-i.getLength(s.gutter);v>i.getWidth(t.lengthLimit||h.lengthLimit,b)&&(c.push(g.slice(0,-1)),g=p[m])}g&&c.push(g),c.length||c.push(p)}else c=p.split(\"\\n\");c.filter((function(t){return!!t})).forEach((function(e,i){o.fillText(e,l(e),f(t,d,i))}))})),o.rotate(w(360)-n-w(90)),o.translate(-g,-m)})),o.restore(),this.buttons.forEach((function(t,e){var n=i.getHeight(t.radius);i.maxBtnRadius=Math.max(i.maxBtnRadius,n),u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.arc(0,0,n,0,2*Math.PI,!1),o.fill()),t.pointer&&u(t.background)&&(o.beginPath(),o.fillStyle=t.background,o.moveTo(-n,0),o.lineTo(n,0),o.lineTo(0,2*-n),o.closePath(),o.fill()),t.imgs&&t.imgs.forEach((function(t,r){if(i.btnImgs[e]){var o=i.btnImgs[e][r];if(o){var s=i.computedWidthAndHeight(o,t,2*n,2*n),a=s[0],u=s[1],h=[i.getOffsetX(a),i.getHeight(t.top,n)],c=h[0],l=h[1];i.drawImage(o,c,l,a,u)}}})),t.fonts&&t.fonts.forEach((function(t){var e=t.fontColor||h.fontColor,r=t.fontWeight||h.fontWeight,s=i.getLength(t.fontSize||h.fontSize),a=t.fontStyle||h.fontStyle;o.fillStyle=e,o.font=r+\" \"+(s>>0)+\"px \"+a,String(t.text).split(\"\\n\").forEach((function(e,i){o.fillText(e,l(e),f(t,n,i))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,o)},o.prototype.play=function(){this.startTime||(this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},o.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.rotateDeg=this.prizeDeg/2-this._defaultConfig.offsetDegree,this.draw())},o.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.prizeFlag,r=e.prizeDeg,o=e.rotateDeg,s=e._defaultConfig,a=Date.now()-this.startTime;if(a>=s.accelerationTime&&void 0!==n){this.FPS=a/t,this.endTime=Date.now(),this.stopDeg=o;for(var u=(Math.random()*r-r/2)*this.getLength(s.stopRange),h=0;++h;){var c=360*h-n*r-o-s.offsetDegree+u;if(_[s.speedFunction].easeOut(this.FPS,this.stopDeg,c,s.decelerationTime)-this.stopDeg>s.speed){this.endDeg=c;break}}return this.slowDown()}this.rotateDeg=(o+_[s.speedFunction].easeIn(a,0,s.speed,s.accelerationTime))%360,this.draw(),i(this.run.bind(this,t+1))},o.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopDeg,a=e.endDeg,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>=u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.rotateDeg=_[u.speedFunction].easeOut(h,s,a,u.decelerationTime)%360,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},o.prototype.getWidth=function(t,e){return void 0===e&&(e=this.prizeRadian*this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getHeight=function(t,e){return void 0===e&&(e=this.prizeRadius),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,e):0},o.prototype.getOffsetX=function(t){return-t/2},o.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr-this.Radius,e/i.dpr-this.Radius]},o}(y),P=function(t){function h(e,i){var n;void 0===i&&(i={});var r=t.call(this,e)||this;r.rows=3,r.cols=3,r.blocks=[],r.prizes=[],r.buttons=[],r.defaultConfig={},r._defaultConfig={gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},r.defaultStyle={},r._defaultStyle={borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",lineHeight:\"\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},r.activeStyle={},r._activeStyle={background:\"#ffce98\",shadow:\"\",fontStyle:\"\",fontWeight:\"\",fontSize:\"\",lineHeight:\"\",fontColor:\"\"},r.cellWidth=0,r.cellHeight=0,r.startTime=0,r.endTime=0,r.currIndex=0,r.stopIndex=0,r.endIndex=0,r.demo=!1,r.timer=0,r.FPS=16.6,r.prizeFlag=-1,r.cells=[],r.blockImgs=[[]],r.btnImgs=[[]],r.prizeImgs=[],e.ob&&(r.initData(i),r.initWatch()),r.initComputed(),null===(n=e.beforeCreate)||void 0===n||n.call(r);var o=r.buttons.map((function(t){return t.imgs}));return r.button&&o.push(r.button.imgs),r.init({blockImgs:r.blocks.map((function(t){return t.imgs})),prizeImgs:r.prizes.map((function(t){return t.imgs})),btnImgs:o}),r}return e(h,t),h.prototype.initData=function(t){this.$set(this,\"rows\",Number(t.rows)||3),this.$set(this,\"cols\",Number(t.cols)||3),this.$set(this,\"blocks\",t.blocks||[]),this.$set(this,\"prizes\",t.prizes||[]),this.$set(this,\"buttons\",t.buttons||[]),this.$set(this,\"button\",t.button),this.$set(this,\"defaultConfig\",t.defaultConfig||{}),this.$set(this,\"defaultStyle\",t.defaultStyle||{}),this.$set(this,\"activeStyle\",t.activeStyle||{}),this.$set(this,\"startCallback\",t.start),this.$set(this,\"endCallback\",t.end)},h.prototype.initComputed=function(){var t=this;this.$computed(this,\"_defaultConfig\",(function(){var e=i({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return e.gutter=t.getLength(e.gutter),e.speed=e.speed/40,e})),this.$computed(this,\"_defaultStyle\",(function(){return i({borderRadius:20,fontColor:\"#000\",fontSize:\"18px\",fontStyle:\"sans-serif\",fontWeight:\"400\",background:\"rgba(0,0,0,0)\",shadow:\"\",wordWrap:!0,lengthLimit:\"90%\"},t.defaultStyle)})),this.$computed(this,\"_activeStyle\",(function(){return i({background:\"#ffce98\",shadow:\"\"},t.activeStyle)}))},h.prototype.initWatch=function(){var t=this;this.$watch(\"blocks\",(function(e){return t.init({blockImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"prizes\",(function(e){return t.init({prizeImgs:e.map((function(t){return t.imgs}))})}),{deep:!0}),this.$watch(\"buttons\",(function(e){var i=e.map((function(t){return t.imgs}));return t.button&&i.push(t.button.imgs),t.init({btnImgs:i})}),{deep:!0}),this.$watch(\"button\",(function(){var e=t.buttons.map((function(t){return t.imgs}));return t.button&&e.push(t.button.imgs),t.init({btnImgs:e})}),{deep:!0}),this.$watch(\"rows\",(function(){return t.init({})})),this.$watch(\"cols\",(function(){return t.init({})})),this.$watch(\"defaultConfig\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"defaultStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"activeStyle\",(function(){return t.draw()}),{deep:!0}),this.$watch(\"startCallback\",(function(){return t.init({})})),this.$watch(\"endCallback\",(function(){return t.init({})}))},h.prototype.init=function(e){var i,n,r=this;t.prototype.init.call(this);var o=this,s=o.config;o.ctx,o.button,null===(i=s.beforeInit)||void 0===i||i.call(this),this.draw(),Object.keys(e).forEach((function(t){var i=t,n=e[i],o={blockImgs:\"blocks\",prizeImgs:\"prizes\",btnImgs:\"buttons\"}[i];n&&n.forEach((function(t,e){t&&t.forEach((function(t,n){r.loadAndCacheImg(o,e,i,n,(function(){r.draw()}))}))}))})),null===(n=s.afterInit)||void 0===n||n.call(this)},h.prototype.handleClick=function(t){var e=this,i=this.ctx;o(o([],this.buttons),[this.button]).forEach((function(n){var r;if(n){var o=e.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),s=o[0],a=o[1],u=o[2],h=o[3];i.beginPath(),i.rect(s,a,u,h),i.isPointInPath(t.offsetX,t.offsetY)&&(e.startTime||(\"function\"==typeof n.callback&&n.callback.call(e,n),null===(r=e.startCallback)||void 0===r||r.call(e,t,n)))}}))},h.prototype.loadAndCacheImg=function(t,e,i,o,s){return n(this,void 0,void 0,(function(){var n,a,u,h=this;return r(this,(function(r){return n=this[t][e],\"buttons\"===t&&!this.buttons.length&&this.button&&(n=this.button),n&&n.imgs&&(a=n.imgs[o])?(this[i][e]||(this[i][e]=[]),u=[this.loadImg(a.src,a),a.activeSrc&&this.loadImg(a.activeSrc,a,\"$activeResolve\")],Promise.all(u).then((function(t){var n=t[0],r=t[1];h[i][e][o]={defaultImg:n,activeImg:r},s.call(h)})).catch((function(i){console.error(t+\"[\"+e+\"].imgs[\"+o+\"] \"+i)})),[2]):[2]}))}))},h.prototype.computedWidthAndHeight=function(t,e,i){if(!e.width&&!e.height)return[t.width,t.height];if(e.width&&!e.height){var n=this.getWidth(e.width,i.col);return[n,t.height*(n/t.width)]}if(!e.width&&e.height){var r=this.getHeight(e.height,i.row);return[t.width*(r/t.height),r]}return[this.getWidth(e.width,i.col),this.getHeight(e.height,i.row)]},h.prototype.draw=function(){var t,e,i=this,n=this,r=n.config,h=n.ctx,c=n._defaultConfig,l=n._defaultStyle,f=n._activeStyle;null===(t=r.beforeDraw)||void 0===t||t.call(this,h),h.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=o(o([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach((function(t){t.col=t.col||1,t.row=t.row||1})),this.prizeArea=this.blocks.reduce((function(t,e){var n=t.x,r=t.y,o=t.w,a=t.h,c=function(t){var e,i=(null===(e=t.padding)||void 0===e?void 0:e.replace(/px/g,\"\").split(\" \").map((function(t){return~~t})))||[0],n=0,r=0,o=0,a=0;switch(i.length){case 1:n=r=o=a=i[0];break;case 2:n=r=i[0],o=a=i[1];break;case 3:n=i[0],o=a=i[1],r=i[2];break;default:n=i[0],r=i[1],o=i[2],a=i[3]}var u={paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:a};for(var h in u)u[h]=Object.prototype.hasOwnProperty.call(t,h)&&s(t[h],\"string\",\"number\")?~~String(t[h]).replace(/px/g,\"\"):u[h];return[n,r,o,a]}(e),f=c[0],d=c[1],p=c[2],g=c[3],m=e.borderRadius?i.getLength(e.borderRadius):0,v=e.background||l.background;return u(v)&&S(h,n,r,o,a,m,i.handleBackground(n,r,o,a,v)),{x:n+p,y:r+f,w:o-p-g,h:a-f-d}}),{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-c.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-c.gutter*(this.rows-1))/this.rows,this.cells.forEach((function(t,e){var n=i.getGeometricProperty([t.x,t.y,t.col,t.row]),o=n[0],s=n[1],c=n[2],d=n[3],p=!1;(void 0===i.prizeFlag||i.prizeFlag>-1)&&(p=e===i.currIndex%i.prizes.length>>0);var g=p?f.background:t.background||l.background;if(u(g)){var m=(p?f.shadow:t.shadow||l.shadow).replace(/px/g,\"\").split(\",\")[0].split(\" \").map((function(t,e){return e<3?Number(t):t}));4===m.length&&(h.shadowColor=m[3],h.shadowOffsetX=m[0]*r.dpr,h.shadowOffsetY=m[1]*r.dpr,h.shadowBlur=m[2],m[0]>0?c-=m[0]:(c+=m[0],o-=m[0]),m[1]>0?d-=m[1]:(d+=m[1],s-=m[1])),S(h,o,s,c,d,i.getLength(t.borderRadius?t.borderRadius:l.borderRadius),i.handleBackground(o,s,c,d,g)),h.shadowColor=\"rgba(0, 0, 0, 0)\",h.shadowOffsetX=0,h.shadowOffsetY=0,h.shadowBlur=0}var v=\"prizeImgs\";e>=i.prizes.length&&(v=\"btnImgs\",e-=i.prizes.length),t.imgs&&t.imgs.forEach((function(n,r){if(i[v][e]){var a=i[v][e][r];if(a){var u=p&&a.activeImg||a.defaultImg;if(u){var h=i.computedWidthAndHeight(u,n,t),c=h[0],l=h[1],f=[o+i.getOffsetX(c,t.col),s+i.getHeight(n.top,t.row)],d=f[0],g=f[1];i.drawImage(u,d,g,c,l)}}}})),t.fonts&&t.fonts.forEach((function(e){var n=p&&f.fontStyle?f.fontStyle:e.fontStyle||l.fontStyle,r=p&&f.fontWeight?f.fontWeight:e.fontWeight||l.fontWeight,u=p&&f.fontSize?i.getLength(f.fontSize):i.getLength(e.fontSize||l.fontSize),c=p&&f.lineHeight?f.lineHeight:e.lineHeight||l.lineHeight||e.fontSize||l.fontSize;h.font=r+\" \"+(u>>0)+\"px \"+n,h.fillStyle=p&&f.fontColor?f.fontColor:e.fontColor||l.fontColor;var d=[],g=String(e.text);if(Object.prototype.hasOwnProperty.call(e,\"wordWrap\")?e.wordWrap:l.wordWrap){g=a(g);for(var m=\"\",v=0;v<g.length;v++){m+=g[v],h.measureText(m).width>i.getWidth(e.lengthLimit||l.lengthLimit,t.col)&&(d.push(m.slice(0,-1)),m=g[v])}m&&d.push(m),d.length||d.push(g)}else d=g.split(\"\\n\");d.forEach((function(n,r){h.fillText(n,o+i.getOffsetX(h.measureText(n).width,t.col),s+i.getHeight(e.top,t.row)+(r+1)*i.getLength(c))}))}))})),null===(e=r.afterDraw)||void 0===e||e.call(this,h)},h.prototype.handleBackground=function(t,e,i,n,r){var o=this.ctx;return r.includes(\"linear-gradient\")&&(r=function(t,e,i,n,r,o){var s=/linear-gradient\\((.+)\\)/.exec(o)[1].split(\",\").map((function(t){return t.trim()})),a=s.shift(),u=[0,0,0,0];if(a.includes(\"deg\")){var h=function(t){return Math.tan(t/180*Math.PI)};(a=a.slice(0,-3)%360)>=0&&a<45?u=[e,i+r,e+n,i+r-n*h(a-0)]:a>=45&&a<90?u=[e,i+r,e+n-r*h(a-45),i]:a>=90&&a<135?u=[e+n,i+r,e+n-r*h(a-90),i]:a>=135&&a<180?u=[e+n,i+r,e,i+n*h(a-135)]:a>=180&&a<225?u=[e+n,i,e,i+n*h(a-180)]:a>=225&&a<270?u=[e+n,i,e+r*h(a-225),i+r]:a>=270&&a<315?u=[e,i,e+r*h(a-270),i+r]:a>=315&&a<360&&(u=[e,i,e+n,i+r-n*h(a-315)])}else a.includes(\"top\")?u=[e,i+r,e,i]:a.includes(\"bottom\")?u=[e,i,e,i+r]:a.includes(\"left\")?u=[e+n,i,e,i]:a.includes(\"right\")&&(u=[e,i,e+n,i]);var c=t.createLinearGradient.apply(t,u.map((function(t){return t>>0})));return s.reduce((function(t,e,i){var n=e.split(\" \");return 1===n.length?t.addColorStop(i,n[0]):2===n.length&&t.addColorStop.apply(t,n),t}),c)}(o,t,e,i,n,r)),r},h.prototype.play=function(){var t=this.config.clearInterval;this.startTime||(t(this.timer),this.startTime=Date.now(),this.prizeFlag=void 0,this.run())},h.prototype.stop=function(t){this.prizeFlag=t<0?-1:t%this.prizes.length,-1===this.prizeFlag&&(this.currIndex=0,this.draw())},h.prototype.run=function(t){void 0===t&&(t=0);var e=this,i=e.rAF,n=e.currIndex,r=e.prizes,o=e.prizeFlag,s=e.startTime,a=e._defaultConfig,u=Date.now()-s;if(u>=a.accelerationTime&&void 0!==o){this.FPS=u/t,this.endTime=Date.now(),this.stopIndex=n;for(var h=0;++h;){var c=r.length*h+o-(n>>0);if(C.easeOut(this.FPS,this.stopIndex,c,a.decelerationTime)-this.stopIndex>a.speed){this.endIndex=c;break}}return this.slowDown()}this.currIndex=(n+C.easeIn(u,.1,a.speed,a.accelerationTime))%r.length,this.draw(),i(this.run.bind(this,t+1))},h.prototype.slowDown=function(){var t,e=this,n=e.rAF,r=e.prizes,o=e.prizeFlag,s=e.stopIndex,a=e.endIndex,u=e._defaultConfig,h=Date.now()-this.endTime;if(-1!==o){if(h>u.decelerationTime)return this.startTime=0,void(null===(t=this.endCallback)||void 0===t||t.call(this,i({},r.find((function(t,e){return e===o})))));this.currIndex=C.easeOut(h,s,a,u.decelerationTime)%r.length,this.draw(),n(this.slowDown.bind(this))}else this.startTime=0},h.prototype.walk=function(){var t=this,e=this.config,i=e.setInterval;(0,e.clearInterval)(this.timer),this.timer=i((function(){t.currIndex+=1,t.draw()}),1300)},h.prototype.getGeometricProperty=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=this.cellWidth,s=this.cellHeight,a=this._defaultConfig.gutter,u=[this.prizeArea.x+(o+a)*e,this.prizeArea.y+(s+a)*i];return n&&r&&u.push(o*n+a*(n-1),s*r+a*(r-1)),u},h.prototype.getWidth=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellWidth*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getHeight=function(t,e){return void 0===e&&(e=1),s(t,\"number\")?t:s(t,\"string\")?this.changeUnits(t,this.cellHeight*e+this._defaultConfig.gutter*(e-1)):0},h.prototype.getOffsetX=function(t,e){return void 0===e&&(e=1),(this.cellWidth*e+this._defaultConfig.gutter*(e-1)-t)/2},h.prototype.conversionAxis=function(t,e){var i=this.config;return[t/i.dpr,e/i.dpr]},h}(y);exports.LuckyGrid=P,exports.LuckyWheel=E;\n","const windowWidth = wx.getSystemInfoSync().windowWidth\r\n\r\nexport const rpx2px = (value) => {\r\n if (typeof value === 'string') value = Number(value.replace(/[a-z]*/g, ''))\r\n return windowWidth / 750 * value\r\n}\r\n\r\nexport const changeUnits = (value) => {\r\n return Number(value.replace(/^(\\-*[0-9.]*)([a-z%]*)$/, (value, num, unit) => {\r\n switch (unit) {\r\n case 'px':\r\n num *= 1\r\n break\r\n case 'rpx':\r\n num = rpx2px(num)\r\n break\r\n default:\r\n num *= 1\r\n break\r\n }\r\n return num\r\n }))\r\n}\r\n\r\nexport const resolveImage = (e, img, canvas, srcName = 'src', resolveName = '$resolve') => {\r\n let imgObj = canvas.createImage()\r\n imgObj.onload = () => {\r\n img[resolveName](imgObj)\r\n }\r\n imgObj.src = img[srcName]\r\n}\r\n\r\nexport function getImage () {\r\n return new Promise((resolve, reject) => {\r\n wx.canvasToTempFilePath({\r\n canvas: this.canvas,\r\n success: res => resolve(res),\r\n fail: err => reject(err)\r\n });\r\n })\r\n}\r\n","import { LuckyWheel } from '../../node_modules/lucky-canvas/dist/lucky-canvas.cjs.min'\r\nimport { changeUnits, resolveImage, getImage } from '../utils'\r\n\r\nComponent({\r\n properties: {\r\n width: { type: String, value: '600rpx' },\r\n height: { type: String, value: '600rpx' },\r\n blocks: { type: Array, value: [] },\r\n prizes: { type: Array, value: [] },\r\n buttons: { type: Array, value: [] },\r\n defaultConfig: { type: Object, value: {} },\r\n defaultStyle: { type: Object, value: {} },\r\n start: { type: Function, value: () => {} },\r\n end: { type: Function, value: () => {} },\r\n },\r\n data: {\r\n isShow: false,\r\n luckyImg: '',\r\n showCanvas: true,\r\n },\r\n observers: {\r\n 'blocks.**': function(newData, oldData) {\r\n this.$lucky && (this.$lucky.blocks = newData)\r\n },\r\n 'prizes.**': function(newData, oldData) {\r\n this.$lucky && (this.$lucky.prizes = newData)\r\n },\r\n 'buttons.**': function(newData, oldData) {\r\n this.$lucky && (this.$lucky.buttons = newData)\r\n },\r\n },\r\n ready() {\r\n wx.createSelectorQuery().in(this).select('#lucky-wheel').fields({\r\n node: true, size: true\r\n }).exec((res) => {\r\n if (!res[0] || !res[0].node) {\r\n return console.error('lucky-canvas 获取不到 canvas 标签')\r\n }\r\n const canvas = this.canvas = res[0].node\r\n const dpr = this.dpr = wx.getSystemInfoSync().pixelRatio\r\n const ctx = this.ctx = canvas.getContext('2d')\r\n const data = this.data\r\n canvas.width = res[0].width * dpr\r\n canvas.height = res[0].height * dpr\r\n ctx.scale(dpr, dpr)\r\n this.$lucky = new LuckyWheel({\r\n flag: 'MP-WX',\r\n ctx,\r\n dpr,\r\n width: res[0].width,\r\n height: res[0].height,\r\n // rAF: canvas.requestAnimationFrame, // 帧动画真机调试会报错!\r\n setTimeout,\r\n clearTimeout,\r\n setInterval,\r\n clearInterval,\r\n beforeCreate: function () {\r\n const Radius = Math.min(this.config.width, this.config.height) / 2\r\n // 设置坐标轴\r\n ctx.translate(Radius, Radius)\r\n },\r\n beforeInit: function () {\r\n // 重置坐标轴\r\n ctx.translate(-this.Radius, -this.Radius)\r\n },\r\n unitFunc: (num, unit) => changeUnits(num + unit),\r\n }, {\r\n blocks: data.blocks,\r\n prizes: data.prizes,\r\n buttons: data.buttons,\r\n defaultConfig: data.defaultConfig,\r\n defaultStyle: data.defaultStyle,\r\n start: (...rest) => {\r\n this.triggerEvent('start', ...rest)\r\n },\r\n end: (...rest) => {\r\n this.triggerEvent('end', ...rest)\r\n getImage.call(this).then(res => {\r\n this.setData({ luckyImg: res.tempFilePath })\r\n })\r\n },\r\n })\r\n // 为了保证 onload 回调准确\r\n this.setData({ isShow: true })\r\n })\r\n },\r\n methods: {\r\n imgBindload (e) {\r\n const { name, index, i } = e.currentTarget.dataset\r\n const img = this.data[name][index].imgs[i]\r\n resolveImage(e, img, this.canvas)\r\n },\r\n luckyImgLoad () {\r\n this.showCanvas = false\r\n },\r\n handleClickOfImg (e) {\r\n const { clientX: x, clientY: y } = e.changedTouches[0]\r\n wx.createSelectorQuery().in(this).select('.lucky-img').fields({\r\n rect: true\r\n }).exec((res) => {\r\n const { left, top } = res[0]\r\n this.toPlay(x - left, y - top)\r\n })\r\n },\r\n handleClickOfCanvas (e) {\r\n const { x, y } = e.changedTouches[0]\r\n this.toPlay(x, y)\r\n },\r\n toPlay (x, y) {\r\n const ctx = this.ctx\r\n ctx.beginPath()\r\n ctx.arc(0, 0, this.$lucky.maxBtnRadius, 0, Math.PI * 2, false)\r\n if (!ctx.isPointInPath(x * this.dpr, y * this.dpr)) return\r\n // 隐藏图片并显示canvas\r\n this.showCanvas = true\r\n this.setData({ luckyImg: '' })\r\n // 触发 lucky-canvas 的抽奖逻辑\r\n this.$lucky.startCallback()\r\n },\r\n play(...rest) {\r\n this.$lucky.play(...rest)\r\n },\r\n stop(...rest) {\r\n this.$lucky.stop(...rest)\r\n },\r\n },\r\n})\r\n"],"sourceRoot":""}
0 2 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.wxml 0 → 100644
  1 +<view class="lucky-box" style="width: {{width}}; height: {{height}}">
  2 +
  3 + <canvas
  4 + type="2d"
  5 + id="lucky-wheel"
  6 + canvas-id="lucky-wheel"
  7 + bindtouchstart="handleClickOfCanvas"
  8 + style="width: {{width}}; height: {{height}}; visibility: {{showCanvas ? 'visible' : 'hidden'}}; "
  9 + ></canvas>
  10 + <image
  11 + wx:if="{{luckyImg}}"
  12 + src="{{luckyImg}}"
  13 + class="lucky-img"
  14 + mode="scaleToFill"
  15 + bindload="luckyImgLoad"
  16 + bindtouchstart="handleClickOfImg"
  17 + style="width: {{width}}; height: {{height}}"
  18 + ></image>
  19 +
  20 +
  21 + <view>
  22 + <view wx:if="{{isShow}}" wx:for="{{blocks}}" wx:key="index" wx:for-index="index" wx:for-item="block" style="visibility: hidden; height: 0">
  23 + <view wx:for="{{block.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  24 + <image src="{{img.src}}" data-name="blocks" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  25 + </view>
  26 + </view>
  27 + </view>
  28 + <view>
  29 + <view wx:if="{{isShow}}" wx:for="{{prizes}}" wx:key="index" wx:for-index="index" wx:for-item="prize" style="visibility: hidden; height: 0">
  30 + <view wx:for="{{prize.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  31 + <image src="{{img.src}}" data-name="prizes" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  32 + </view>
  33 + </view>
  34 + </view>
  35 + <view>
  36 + <view wx:if="{{isShow}}" wx:for="{{buttons}}" wx:key="index" wx:for-index="index" wx:for-item="button" style="visibility: hidden; height: 0">
  37 + <view wx:for="{{button.imgs}}" wx:key="i" wx:for-index="i" wx:for-item="img">
  38 + <image src="{{img.src}}" data-name="buttons" data-index="{{index}}" data-i="{{i}}" bindload="imgBindload"></image>
  39 + </view>
  40 + </view>
  41 + </view>
  42 +</view>
... ...
packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index.wxss 0 → 100644
  1 +/* mini-luck-draw/lucky-wheel/index.wxss */
  2 +.lucky-box {
  3 + position: relative;
  4 + /* overflow: hidden; */
  5 + margin: 0 auto;
  6 +}
  7 +.lucky-img {
  8 + position: absolute;
  9 + left: 0;
  10 + top: 0;
  11 + z-index: 100;
  12 +}
  13 +#lucky-wheel {
  14 + /* position: relative;
  15 + z-index: 99; */
  16 +}
... ...
packageB/pages/luckactivity/index/index.js 0 → 100644
  1 +// packageA//pages/myGift/myGift.js
  2 +const app = getApp();
  3 +let self = null;
  4 +var os = app.globalData.setting;
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + tabArr: ['抽奖列表', '历史抽奖'],
  13 + currentIndex: 0,
  14 +
  15 + list: null,
  16 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  17 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  18 + pageNum: 1, // 当前页数
  19 + },
  20 +
  21 + clickTab(e) {
  22 + let index = e.target.dataset.index;
  23 + let url = '/api/weshop/marketing/marketingLuckForm/page';
  24 + let data = {
  25 + store_id: app.globalData.setting.stoid,
  26 + };
  27 +
  28 + this.setData({
  29 + list: null,
  30 + pageNum: 1,
  31 + noMore: false,
  32 + currentIndex: index,
  33 + });
  34 +
  35 + if(index == 0) {
  36 + data.is_end = 0;
  37 + } else if(index == 1) {
  38 + data.is_end = 1;
  39 + };
  40 +
  41 + this.getData(true, url, data).then(function() {
  42 + self.setData({
  43 + currentData: data,
  44 + });
  45 + });
  46 + },
  47 +
  48 + /**
  49 + * 生命周期函数--监听页面加载
  50 + */
  51 + onLoad: function (options) {
  52 + self = this;
  53 +
  54 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  55 + self.setData({
  56 + userInfo: data,
  57 + });
  58 + });
  59 + },
  60 +
  61 + /**
  62 + * 生命周期函数--监听页面初次渲染完成
  63 + */
  64 + onReady: function () {},
  65 +
  66 + /**
  67 + * 生命周期函数--监听页面显示
  68 + */
  69 + onShow: function () {
  70 + if(app.globalData.userInfo) {
  71 + if(!this.data.isLogin) {
  72 + this.setData({
  73 + userInfo: app.globalData.userInfo,
  74 + imghost: app.globalData.setting.imghost,
  75 + isLogin: true,
  76 + });
  77 +
  78 +
  79 + let url = '/api/weshop/marketing/marketingLuckForm/page';
  80 + let data = {
  81 + store_id: app.globalData.setting.stoid,
  82 + is_end: 0,
  83 + };
  84 +
  85 + this.setData({
  86 + list: null,
  87 + pageNum: 1,
  88 + noMore: false,
  89 + });
  90 +
  91 + this.getData(true, url, data).then(function() {
  92 + self.setData({
  93 + currentData: data,
  94 + });
  95 + });
  96 + };
  97 + };
  98 + },
  99 +
  100 + /**
  101 + * 生命周期函数--监听页面隐藏
  102 + */
  103 + onHide: function () {
  104 +
  105 + },
  106 +
  107 + /**
  108 + * 生命周期函数--监听页面卸载
  109 + */
  110 + onUnload: function () {
  111 +
  112 + },
  113 +
  114 + /**
  115 + * 页面相关事件处理函数--监听用户下拉动作
  116 + */
  117 + onPullDownRefresh: function () {
  118 +
  119 + },
  120 +
  121 + /**
  122 + * 页面上拉触底事件的处理函数
  123 + */
  124 + onReachBottom: function () {
  125 + let data = this.data.currentData;
  126 + console.log('触底!', data);
  127 + this.scrollToLower('/api/weshop/marketing/marketingLuckForm/page', data);
  128 + },
  129 +
  130 + /**
  131 + * 用户点击右上角分享
  132 + */
  133 + onShareAppMessage: function () {
  134 +
  135 + },
  136 +
  137 + /**
  138 + * 请求数据
  139 + */
  140 + getData: function(isInit, url, data) {
  141 + let p = app.request.promiseGet(url, {
  142 + data: data,
  143 + isShowLoading: true,
  144 + })
  145 + .then(function(res) {
  146 + if(res.data.code == 0) {
  147 +
  148 + self.setData({
  149 + isLoading: false
  150 + });
  151 +
  152 + if(isInit) {// 第一次加载
  153 + self.setData({
  154 + list: res.data.data
  155 + });
  156 + } else {
  157 + self.setData({
  158 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  159 + });
  160 + };
  161 +
  162 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  163 + self.setData({
  164 + noMore: true
  165 + });
  166 + };
  167 +
  168 + } else {
  169 + self.setData({
  170 + 'list.pageData': []
  171 + });
  172 + };
  173 +
  174 + });
  175 +
  176 + return p;
  177 + },
  178 +
  179 +
  180 + /**
  181 + * 上拉加载
  182 + */
  183 + scrollToLower(url, requestData) {
  184 + // 数据总量
  185 + let total = this.data.list.total;
  186 + // 单页最大数据量
  187 + let pageSize = this.data.list.pageSize;
  188 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  189 + if((total != 0)&&(total <= pageSize)) {
  190 + this.setData({
  191 + noMore: true
  192 + });
  193 + };
  194 +
  195 + if(!this.data.isLoading && !this.data.noMore) {
  196 + this.setData({
  197 + isLoading: true,
  198 + pageNum: this.data.pageNum + 1
  199 + });
  200 + requestData.page = this.data.pageNum;
  201 + this.getData(false, url, requestData);
  202 + };
  203 + },
  204 +
  205 + /**
  206 + * 点击跳转
  207 + */
  208 + goto(e) {
  209 + // let url = '';
  210 + // if(e.target.dataset.url) {
  211 + // url = e.target.dataset.url;
  212 + // } else {
  213 + // url = e.currentTarget.dataset.url;
  214 + // }
  215 + let id = e.currentTarget.dataset.id;
  216 + let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}`;
  217 + app.goto(url);
  218 + },
  219 +
  220 +
  221 +
  222 +})
0 223 \ No newline at end of file
... ...
packageB/pages/luckactivity/index/index.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "幸运大转盘",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn",
  6 + "nav_b": "/components/nav_b/nav_b",
  7 + "my_confirm": "/components/my_confirm/my_confirm",
  8 + "nodata": "/components/nodata/nodata"
  9 + }
  10 +}
0 11 \ No newline at end of file
... ...
packageB/pages/luckactivity/index/index.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
  2 +<view>
  3 + <!-- <view class="img-container"><image src="../../../images/luckDraw/weel.png" class="img" mode="aspectFit"></image></view> -->
  4 + <view class="tab-title" bindtap="clickTab">
  5 + <view class="tab-title-item {{currentIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
  6 + </view>
  7 + <view class="tab-content">
  8 +
  9 +
  10 + <view class="tab-item" wx:for="{{list.pageData}}">
  11 + <text class="iconfont icon-zhuanpan"></text>
  12 + <view class="desc-container">
  13 + <view class="">
  14 + <!-- 标题 -->
  15 + <view class="ellipsis-1x taj">{{item.act_name}}</view>
  16 + <!-- 时间 -->
  17 + <view class="date pdt10 pdb20" wx:if="{{currentIndex == 0}}">活动时间:{{filter.format_time(item.begindate) + ' 至 ' + filter.format_time(item.enddate)}}</view>
  18 + <view class="date pdt10 pdb20" wx:else>兑换时间:{{filter.format_time(item.begindate) + ' 至 ' + filter.format_time(item.enddate)}}</view>
  19 + </view>
  20 + <!-- 按钮 -->
  21 + <view class="btn-container">
  22 + <view bindtap="goto" data-id="{{item.id}}" class="btn red" wx:if="{{currentIndex == 0}}">立即参与</view>
  23 + <view bindtap="goto" data-id="{{item.id}}" class="btn red" wx:else>去兑换</view>
  24 + </view>
  25 + </view>
  26 + </view>
  27 +
  28 +
  29 + <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
  30 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view>
  31 + </view>
  32 +</view>
  33 +
  34 +<!-- 引入提示组件 -->
  35 +<warn id="warn"></warn>
  36 +<my_confirm id="my_confirm"></my_confirm>
... ...
packageB/pages/luckactivity/index/index.wxss 0 → 100644
  1 +@charset "utf-8";
  2 +
  3 +.c-a4 {
  4 + color: #a4a4a4;
  5 +}
  6 +
  7 +.c-red {
  8 + color: #FF6768;
  9 +}
  10 +
  11 +.h88 {
  12 + height: 88rpx;
  13 +}
  14 +
  15 +
  16 +page {
  17 + background-color: #f0f0f0;
  18 +}
  19 +
  20 +.tab-title {
  21 + display: flex;
  22 + position: sticky;
  23 + background-color: white;
  24 + top: 0;
  25 + font-size: 30rpx;
  26 + z-index: 999;
  27 +}
  28 +
  29 +.tab-title::after {
  30 + position: absolute;
  31 + content: '';
  32 + width: 2rpx;
  33 + height: 40%;
  34 + background-color: #f0f0f0;
  35 + top: 0;
  36 + bottom: 0;
  37 + left: 0;
  38 + right: 0;
  39 + margin: auto;
  40 +}
  41 +
  42 +.tab-title-item {
  43 + flex: 1;
  44 + text-align: center;
  45 + padding-top: 20rpx;
  46 + padding-bottom: 20rpx;
  47 + position: relative;
  48 +}
  49 +
  50 +.tab-title-item.active {
  51 + color: #FF6768;
  52 + font-weight: bold;
  53 +
  54 +}
  55 +
  56 +.tab-title-item::after {
  57 + position: absolute;
  58 + content: '';
  59 + left: 100%;
  60 + bottom: 0;
  61 + width: 0;
  62 + border-bottom: 2rpx solid #FF6768;
  63 + /* height: 3rpx; */
  64 + transition: 0.2s all linear;
  65 +}
  66 +
  67 +.tab-title-item.active::after {
  68 + /* left: 100%; */
  69 + width: 100%;
  70 + left: 0;
  71 + /* background-color: #FF6768; */
  72 + /* transition-delay: 0.1s; */
  73 +}
  74 +
  75 +.tab-title-item.active ~ .tab-title-item::after {
  76 + /* width: 100%; */
  77 + left: 0;
  78 +}
  79 +
  80 +.tab-content {
  81 + padding-top: 20rpx;
  82 + padding-left: 20rpx;
  83 + padding-right: 20rpx;
  84 +}
  85 +
  86 +.tab-item {
  87 + padding: 20rpx;
  88 + background-color: white;
  89 + border-radius: 10rpx;
  90 + overflow: hidden;
  91 + display: flex;
  92 + align-items: center;
  93 +}
  94 +
  95 +.tab-item ~ .tab-item {
  96 + margin-top: 20rpx;
  97 +}
  98 +
  99 +.icon-zhuanpan {
  100 + font-size: 120rpx;
  101 + color: #FF6768;
  102 +}
  103 +
  104 +.img-container {
  105 + /* background-color: #dedede; */
  106 + /* height: 300rpx; */
  107 + width: 100%;
  108 + height: 200rpx;
  109 +}
  110 +
  111 +.img-container2 {
  112 + width: 200rpx;
  113 + height: 200rpx;
  114 + background-color: #dedede;
  115 + margin-right: 20rpx;
  116 + flex-shrink: 0;
  117 + display: flex;
  118 + align-items: center;
  119 + position: relative;
  120 +}
  121 +
  122 +.img-container2.error::before {
  123 + font-family: iconfont;
  124 + position: absolute;
  125 + content: '\e8c1';
  126 +}
  127 +
  128 +.img {
  129 + display: block;
  130 + width: 100%;
  131 + height: 100%;
  132 +}
  133 +
  134 +.desc-container {
  135 + /* padding: 20rpx; */
  136 + padding-left: 20rpx;
  137 + flex: 1;
  138 +}
  139 +
  140 +
  141 +
  142 +.rmb::before {
  143 + content: '¥';
  144 +}
  145 +
  146 +.date {
  147 + color: #a4a4a4;
  148 + font-size: 24rpx;
  149 +}
  150 +
  151 +.btn-container {
  152 + display: flex;
  153 + justify-content: flex-end;
  154 + font-size: 26rpx;
  155 +}
  156 +
  157 +.btn {
  158 + font-size: 24rpx;
  159 + padding: 12rpx 30rpx;
  160 + border-radius: 8rpx;
  161 + text-align: center;
  162 + display: inline-block;
  163 + text-align: right;
  164 +}
  165 +
  166 +.btn.red {
  167 + background-color: #FF6768;
  168 + color: white;
  169 +}
  170 +
  171 +.btn.pink {
  172 + background-color: #FACAD6;
  173 + color: #FF6768;
  174 +}
  175 +
  176 +.noMore {
  177 + padding: 20rpx;
  178 + color: #bbb;
  179 + text-align: center;
  180 + font-size: 22rpx;
  181 +}
0 182 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.js 0 → 100644
  1 +const app = getApp();
  2 +let self = null;
  3 +
  4 +Page({
  5 + data: {
  6 + prizes: [
  7 + { fonts: [{ text: '积分', top: '18%', wordWrap:false, fontColor: 'transparent'}],
  8 + imgs: [
  9 + {
  10 + src: '../../../images/luckDraw/jf.png',
  11 + width: '135rpx',
  12 + height: '107rpx',
  13 + top: '15%',
  14 + }
  15 + ],
  16 + },
  17 + { fonts: [{ text: '优惠券', top: '18%', wordWrap:false, fontColor: 'transparent'}],
  18 + imgs: [
  19 + {
  20 + src: '../../../images/luckDraw/yhq.png',
  21 + width: '135rpx',
  22 + height: '107rpx',
  23 + top: '15%',
  24 + }
  25 + ],
  26 + },
  27 + { fonts: [{ text: '美容', top: '18%', wordWrap:false, fontColor: 'transparent'}],
  28 + imgs: [
  29 + {
  30 + src: '../../../images/luckDraw/mr1.png',
  31 + width: '135rpx',
  32 + height: '107rpx',
  33 + top: '15%',
  34 + }
  35 + ],
  36 + },
  37 + { fonts: [{ text: '谢谢\n参与', top: '18%', wordWrap:false, fontColor: 'white'}]},
  38 + { fonts: [{ text: '积分', top: '18%', wordWrap:false, fontColor: 'transparent'}],
  39 + imgs: [
  40 + {
  41 + src: '../../../images/luckDraw/jf.png',
  42 + width: '135rpx',
  43 + height: '107rpx',
  44 + top: '15%',
  45 + }
  46 + ],
  47 + },
  48 + { fonts: [{ text: '优惠券', top: '18%', wordWrap:false, fontColor: 'transparent'}],
  49 + imgs: [
  50 + {
  51 + src: '../../../images/luckDraw/yhq.png',
  52 + width: '135rpx',
  53 + height: '107rpx',
  54 + top: '15%',
  55 + }
  56 + ],
  57 + },
  58 + { fonts: [{ text: '美容', top: '18%', wordWrap:false, fontColor: 'transparent'}],
  59 + imgs: [
  60 + {
  61 + src: '../../../images/luckDraw/mr1.png',
  62 + width: '135rpx',
  63 + height: '107rpx',
  64 + top: '15%',
  65 + }
  66 + ],
  67 + },
  68 + { fonts: [{ text: '谢谢\n参与', top: '18%', wordWrap:false, fontColor: 'white'}], },
  69 + ],
  70 + defaultConfig: {
  71 + offsetDegree: 22.5,
  72 + },
  73 + // defaultStyle: {
  74 + // fontColor: '#d64737',
  75 + // fontSize: '14px'
  76 + // },
  77 + blocks: [ //背景图
  78 + // { padding: '13px', background: '#d64737', top: '20rpx' }
  79 + {
  80 + padding: '76rpx',
  81 + // background: 'pink',
  82 + imgs: [{
  83 + src: 'http://201442.image.myqcloud.com/201442/0/1c825ca4-f155-453c-9f85-2cb0381824fe/original',
  84 + width: '700rpx',
  85 + height: '700rpx',
  86 + rotate: true,
  87 + }]
  88 + }
  89 + ],
  90 + buttons: [
  91 + // { radius: '50px', background: '#d64737' },
  92 + // { radius: '45px', background: '#fff' },
  93 + // { radius: '41px', background: '#f6c66f', pointer: true },
  94 + // {
  95 + // radius: '35px', background: '#ffdea0',
  96 + // fonts: [{ text: '开始\n抽奖', fontSize: '18px', top: -18 }]
  97 + // }
  98 + {
  99 + radius: '60rpx',
  100 + background: 'black',
  101 + pointer: true,
  102 + imgs: [{
  103 + src: 'http://201442.image.myqcloud.com/201442/0/b29290ec-aeb3-40e9-9444-8f15fd9acda3/original',
  104 + width: '188rpx',
  105 + height: '230rpx',
  106 + top: '-130rpx',
  107 + }],
  108 + }
  109 + ],
  110 + },
  111 +
  112 + onLoad(options) {
  113 + console.log('options', options);
  114 + self = this;
  115 + this.data.options = options;
  116 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  117 + self.setData({
  118 + userInfo: data,
  119 + });
  120 + });
  121 + },
  122 +
  123 + onShow() {
  124 + if(app.globalData.userInfo) {
  125 + if(!this.data.isLogin) {
  126 +
  127 + console.log('gl', app.globalData);
  128 +
  129 + this.setData({
  130 + userInfo: app.globalData.userInfo,
  131 + imghost: app.globalData.setting.imghost,
  132 + isLogin: true,
  133 + });
  134 +
  135 + let user_id = app.globalData.userInfo.user_id;
  136 + let store_id = app.globalData.setting.stoid;
  137 + let id = this.data.options.id;
  138 + let url = `/api/weshop/marketing/marketingLuckForm/getLuckInfo/${store_id}/${id}/${user_id}`;
  139 + console.log('url', url);
  140 + app.request.get(url, {
  141 + success: function(res) {
  142 + // self.setData({
  143 + // details: res.data.data
  144 + // });
  145 + console.log('res****', res.data.data);
  146 + // let basic = res.data.data;
  147 +
  148 + // self.setData({
  149 + // basic,
  150 + // });
  151 +
  152 + // if(basic.template_type == 1) { //获取模板
  153 + // let url = `/api/weshop/marketing/marketingLuckTemplate/get/${store_id}/${basic.template_id}`;
  154 + // app.request.get(url, {
  155 +
  156 + // success: function(res) {
  157 + // // console.log('prizes//////', res.data.data);
  158 + // // self.setData({
  159 + // // prizes: res.data.data.pageData
  160 + // // });
  161 + // },
  162 +
  163 + // });
  164 + // };
  165 + },
  166 + });
  167 +
  168 + // 获取奖品展示的奖品
  169 + app.request.get('/api/weshop/marketing/marketingLuckList/page', {
  170 + data: {
  171 + store_id,
  172 + luck_formid: id,
  173 + },
  174 + success: function(res) {
  175 + // console.log('res//////', res.data.data.pageData);
  176 + self.setData({
  177 + prizes: res.data.data.pageData
  178 + });
  179 + },
  180 +
  181 + });
  182 + };
  183 + };
  184 + },
  185 +
  186 + start () {
  187 + // 获取抽奖组件实例
  188 + const $lucky = this.selectComponent('#myLucky')
  189 + // 调用play方法开始旋转
  190 + $lucky.play()
  191 + // 用定时器模拟请求接口
  192 + setTimeout(() => {
  193 + // 3s 后得到中奖索引
  194 + const index = Math.random() * 6 >> 0
  195 + // 调用stop方法然后缓慢停止
  196 + $lucky.stop(index)
  197 + }, 3000)
  198 + },
  199 + end (event) {
  200 + // 中奖奖品详情
  201 + console.log(event.detail)
  202 + },
  203 +
  204 + showPopup() {
  205 + this.setData({
  206 + showPopup: true,
  207 + });
  208 + },
  209 +
  210 + closePopup() {
  211 + this.setData({
  212 + showPopup: false,
  213 + });
  214 + },
  215 +})
0 216 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "lucky-wheel":"/packageB/miniprogram_npm/mini-luck-draw/lucky-wheel/index"
  4 + },
  5 + "enablePullDownRefresh": false,
  6 + "navigationBarTitleText": "幸运大转盘"
  7 +}
0 8 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.wxml 0 → 100644
  1 +<view class="luck-container" style="background: url('http://201442.image.myqcloud.com/201442/0/d7d0fc88-7e87-478e-a1a1-496198001521/original') no-repeat;">
  2 + <!-- 大转盘 -->
  3 + <view class="weel-container">
  4 + <!-- <lucky-wheel
  5 + class="myLucky"
  6 + id="myLucky"
  7 + width="700rpx"
  8 + height="700rpx"
  9 + blocks="{{blocks}}"
  10 + prizes="{{prizes}}"
  11 + buttons="{{buttons}}"
  12 + defaultConfig="{{defaultConfig}}"
  13 + defaultStyle="{{defaultStyle}}"
  14 + bindstart="start"
  15 + bindend="end"
  16 + /> -->
  17 + <view class="fs28 white t-c pdv20">今天你还有 <text class="fs50 c-yellow">3</text> 次抽奖机会</view>
  18 + <view class="tip-to-down expand-transition">
  19 + <text></text>
  20 + <text></text>
  21 + </view>
  22 + </view>
  23 + <!-- 奖品展示 -->
  24 + <view wx:if="{{prizes.length != 0}}">
  25 + <view class="badge-container"><image src="../../../images/luckDraw/badge.png" class="badge prizes"></image></view>
  26 + <view class="list br12 bg-white">
  27 + <view class="list-item" wx:for="{{prizes}}">
  28 + <view class="img-container">
  29 + <image wx:if="{{item.luck_goods_img}}" src="{{item.luck_goods_img}}" class="img" mode="aspectFit"></image>
  30 + <image wx:else src="{{imghost + 'miniapp/images/default_g_img.gif'}}" class="img" mode="aspectFit"></image>
  31 + </view>
  32 + <view class="item-r">
  33 + <view class="fs26">{{item.luck_goods_name}}</view>
  34 + <view class="flex jc_sb fs24 c9">
  35 + <view>价值:<text class="rmb">{{item.luck_goods_price}}</text></view>
  36 + <view>数量:{{item.luck_goods_qty}}</view>
  37 + </view>
  38 + </view>
  39 + </view>
  40 + </view>
  41 + </view>
  42 + <!-- 活动展示 -->
  43 + <view wx:if="{{basic.remark}}">
  44 + <view class="badge-container"><image src="../../../images/luckDraw/badge.png" class="badge activity"></image></view>
  45 + <view class="bg-white br12 pd20">
  46 + {{basic.remark}}
  47 + <!-- 时间 -->
  48 + <!-- <view class="bdb">
  49 + <view class="">
  50 + <view class="txt-red">活动时间:</view>
  51 + <view class="fs28 pdv20">187606546456</view>
  52 + </view>
  53 + <view>
  54 + <view class="txt-red">兑换时间:</view>
  55 + <view class="fs28 pdv20">-</view>
  56 + </view>
  57 + </view> -->
  58 + <!-- 规则 -->
  59 + <!-- <view class="bdb">
  60 + <view class="txt-red pdt20">活动规则:</view>
  61 + <view class="fs28 pdv20">-</view>
  62 + </view> -->
  63 + <!-- 电话 -->
  64 + <!-- <view class="bdb">
  65 + <view class="txt-red pdt20">联系电话:</view>
  66 + <view class="fs28 pdv20">-</view>
  67 + </view> -->
  68 + <!-- 地址 -->
  69 + <!-- <view>
  70 + <view class="txt-red pdv20">门店兑换地址:</view>
  71 + <view class="pdv20">
  72 + <view class="fs28">化妆门店2(芊婕化妆品)</view>
  73 + <view class="pdt10 fs24">福建泉州市田安北路明鑫花苑110号</view>
  74 + <view class="tel pdt10">
  75 + <text class="iconfont icon-tel"></text>
  76 + <text class="text-underline">1380000000</text>
  77 + </view>
  78 + </view>
  79 + <view class="pdv20">
  80 + <view class="fs28">化妆门店2(芊婕化妆品)</view>
  81 + <view class="pdt10 fs24">福建泉州市田安北路明鑫花苑110号</view>
  82 + <view class="tel pdt10">
  83 + <text class="iconfont icon-tel"></text>
  84 + <text class="text-underline">1380000000</text>
  85 + </view>
  86 + </view>
  87 + </view> -->
  88 + </view>
  89 + </view>
  90 + <!-- 二维码 -->
  91 + <!-- <view class="qrcode-container">
  92 + <image src="../../../images/luckDraw/badge.png" class="qrcode"></image>
  93 + <view class="pdt20 fs24 c-7b">
  94 + <view>长按二维码关注我们订阅更多优惠</view>
  95 + <view>信息更多优惠等你来拿哦</view>
  96 + </view>
  97 + </view> -->
  98 + <!-- 技术支持 -->
  99 + <view class="t-c">
  100 + <!-- <view class="pdt20 fs26 text-underline">帮美店免费开通这个玩法</view> -->
  101 + <view class="flex ai_c fs24 jc-center pdv20"><image src="../../../images/luckDraw/logo.png" class="logo"></image>提供技术支持</view>
  102 + </view>
  103 +</view>
  104 +
  105 +<!-- 悬浮按钮 -->
  106 +<view class="gift-container active" bindtap="showPopup"><text class="iconfont icon-liwu"></text></view>
  107 +
  108 +<!-- 弹窗 -->
  109 +<view class="popup-container" wx:if="{{showPopup}}">
  110 + <view class="popup-list">
  111 + <view class="popup-item">
  112 + <view class="img-container"><image src="../../../images/luckDraw/badge.png" class="img"></image></view>
  113 + <view class="flex fdc">
  114 + <view class="ellipsis-2">我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题我是标题</view>
  115 + <view class="pdt20">
  116 + <view class="fs26 xc-black3">价值:<text class="rmb">1800</text></view>
  117 + <view class="flex ai_c jc_sb fs26 xc-black3">
  118 + <view>兑换状态:未兑换</view>
  119 + <view class="btn">兑换</view>
  120 + </view>
  121 + </view>
  122 + </view>
  123 + </view>
  124 + </view>
  125 + <view class="close-container" bindtap="closePopup"><text class="iconfont icon-close"></text></view>
  126 +</view>
  127 +
  128 +
  129 +<view class="popup-container2">
  130 + <view class="t-r"><text class="iconfont icon-close white"></text></view>
  131 + <view class="popup">
  132 + <view class="t-c">
  133 + <view class="bold c-tb">恭喜你获得</view>
  134 + <view class="pdt10">奖品名称</view>
  135 + </view>
  136 + <view class="img-container2"><image src="../../../images/luckDraw/gift.png" class="img"></image></view>
  137 + <view class="flex jc-center mgt30 mgb20">
  138 + <view class="btn btn2">立即领取</view>
  139 + </view>
  140 + <view class="note">注:未领取就关闭弹窗视为主动放弃奖品。</view>
  141 + </view>
  142 +</view>
  143 +
  144 +
  145 +<!-- 遮罩层 -->
  146 +<view class="mask" wx:if="{{showPopup}}"></view>
0 147 \ No newline at end of file
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.wxss 0 → 100644
  1 +/* packageB//pages/luckactivity/index/index.wxss */
  2 +
  3 +page {
  4 + background-color: rgb(129, 2, 253);
  5 +}
  6 +
  7 +page,
  8 +.luck-container {
  9 + /* height: 100%; */
  10 +}
  11 +
  12 +
  13 +
  14 +.luck-container {
  15 + background-size: 100% auto !important;
  16 + padding: 50% 20rpx 0;
  17 +}
  18 +
  19 +.weel-container {
  20 + padding-bottom: 80rpx;
  21 +}
  22 +
  23 +.badge {
  24 + display: block;
  25 + width: 362rpx;
  26 + height: 57rpx;
  27 + margin: 30rpx auto;
  28 + position: relative;
  29 + font-size: 26rpx;
  30 + color: white;
  31 +}
  32 +
  33 +.badge::before {
  34 + position: absolute;
  35 + top: 50%;
  36 + left: 50%;
  37 + transform: translate(-50%, -50%);
  38 +}
  39 +
  40 +.badge.prizes::before {
  41 + content: '奖品展示';
  42 +}
  43 +
  44 +.badge.activity::before {
  45 + content: '活动展示';
  46 +}
  47 +
  48 +.prize-container {
  49 + width: 62rpx;
  50 + height: 64rpx;
  51 + border: 2rpx solid #eeedf0;
  52 +}
  53 +
  54 +.list {
  55 + /* padding: 0 20rpx; */
  56 +}
  57 +
  58 +.list-item {
  59 + display: flex;
  60 + padding: 20rpx;
  61 +}
  62 +
  63 +.list-item ~ .list-item {
  64 + border-top: 2rpx solid #ebedf0;
  65 +}
  66 +
  67 +.img-container {
  68 + width: 140rpx;
  69 + height: 140rpx;
  70 + margin-right: 20rpx;
  71 + background-color: gray;
  72 +}
  73 +
  74 +.img {
  75 + display: block;
  76 + width: 100%;
  77 + height: 100%;
  78 +}
  79 +
  80 +.item-r {
  81 + display: flex;
  82 + flex-direction: column;
  83 + justify-content: space-between;
  84 + flex: 1;
  85 +}
  86 +
  87 +.tel {
  88 + display: flex;
  89 + align-items: center;
  90 + color: #00a0e0;
  91 + font-size: 28rpx;
  92 +}
  93 +.icon-tel {
  94 + font-size: 28rpx;
  95 + margin-right: 6rpx;
  96 +}
  97 +
  98 +.qrcode-container {
  99 + background-color: white;
  100 + border-radius: 12rpx;
  101 + margin-top: 40rpx;
  102 + padding: 20rpx;
  103 + text-align: center;
  104 + /* display: block;
  105 + width: 100%;
  106 + height: 100%; */
  107 +}
  108 +
  109 +.qrcode {
  110 + width: 200rpx;
  111 + height: 200rpx;
  112 + background-color: gray;
  113 +}
  114 +
  115 +.logo {
  116 + width: 120rpx;
  117 + height: 40rpx;
  118 + margin-right: 10rpx;
  119 +}
  120 +
  121 +.gift-container {
  122 + background-color: rgba(44, 44, 44, 0.2);
  123 + width: 100rpx;
  124 + height: 100rpx;
  125 + border-radius: 50%;
  126 + color: white;
  127 + position: fixed;
  128 + right: 20rpx;
  129 + bottom: 20rpx;
  130 + display: flex;
  131 + justify-content: center;
  132 + align-items: center;
  133 + z-index: 1;
  134 +}
  135 +
  136 +.gift-container.active::after {
  137 + content: '';
  138 + position: absolute;
  139 + width: 14rpx;
  140 + height: 14rpx;
  141 + background-color: #f74c31;
  142 + border: 2rpx solid #fff;
  143 + border-radius: 50%;
  144 + top: 6rpx;
  145 + right: 10rpx;
  146 +}
  147 +
  148 +.icon-liwu {
  149 + font-size: 40rpx;
  150 +}
  151 +
  152 +
  153 +
  154 +
  155 +.tip-to-down {
  156 + position: relative;
  157 + /* display: block;
  158 + text-align: center;
  159 + margin: auto;
  160 + margin-top: .4rem;
  161 + width: 6rem;
  162 + z-index: 2;
  163 + -webkit-transform: translate(0, -50%); */
  164 + transform: translate(0, -50%);
  165 + /* color: #fff;
  166 + font: normal 400 20px/1 'Josefin Sans', sans-serif;
  167 + letter-spacing: .1em;
  168 + text-decoration: none;
  169 + -webkit-transition: opacity .3s; */
  170 + transition: opacity .3s;
  171 +}
  172 +.tip-to-down text {
  173 + position: absolute;
  174 + top: 0;
  175 + left: 50%;
  176 + width: 1rem;
  177 + height: 1rem;
  178 + margin-left: -12px;
  179 + border-left: 1px solid #fff;
  180 + border-bottom: 1px solid #fff;
  181 + -webkit-transform: rotate(-45deg);
  182 + transform: rotate(-45deg);
  183 + -webkit-animation: sdb07 2s infinite;
  184 + animation: sdb07 2s infinite;
  185 + opacity: 0;
  186 + box-sizing: border-box;
  187 +}
  188 +.tip-to-down text:nth-of-type(1) {
  189 + -webkit-animation-delay: 0s;
  190 + animation-delay: 0s;
  191 +}
  192 +.tip-to-down text:nth-of-type(2) {
  193 + top: 16px;
  194 + -webkit-animation-delay: .15s;
  195 + animation-delay: .15s;
  196 +}
  197 +
  198 +@-webkit-keyframes sdb07 {
  199 + 0% {
  200 + opacity: 0;
  201 + }
  202 + 50% {
  203 + opacity: 1;
  204 + }
  205 + 100% {
  206 + opacity: 0;
  207 + }
  208 +}
  209 +@keyframes sdb07 {
  210 + 0% {
  211 + opacity: 0;
  212 + }
  213 + 50% {
  214 + opacity: 1;
  215 + }
  216 + 100% {
  217 + opacity: 0;
  218 + }
  219 +}
  220 +
  221 +
  222 +.popup-container {
  223 + position: fixed;
  224 + width: 100%;
  225 + bottom: 0;
  226 + background-color: white;
  227 + z-index: 1;
  228 + padding: 0 20rpx;
  229 + box-sizing: border-box;
  230 +}
  231 +
  232 +.popup-container .img-container {
  233 + width: 200rpx;
  234 + height: 200rpx;
  235 + flex-shrink: 0;
  236 +}
  237 +
  238 +.popup-list {
  239 + max-height: 79vh;
  240 + overflow: auto;
  241 +}
  242 +
  243 +.popup-item {
  244 + padding: 20rpx 0;
  245 + display: flex;
  246 + align-items: center;
  247 + /* flex: 1; */
  248 +}
  249 +
  250 +.popup-item ~ .popup-item {
  251 + border-top: 2rpx solid #ebedf0;
  252 +}
  253 +
  254 +.rmb::before {
  255 + content: '¥';
  256 + font-size: 24rpx;
  257 +}
  258 +
  259 +.btn {
  260 + color: #ff2d4b;
  261 + border: 2rpx solid #ff2d4b;
  262 + border-radius: 8rpx;
  263 + padding: 6rpx 20rpx;
  264 +}
  265 +
  266 +.btn2 {
  267 + font-size: 26rpx;
  268 + color: white;
  269 + background-color: #ff2d4b;
  270 + padding: 10rpx 40rpx;
  271 +}
  272 +
  273 +.close-container {
  274 + color: white;
  275 + position: absolute;
  276 + right: 20rpx;
  277 + top: -80rpx;
  278 +}
  279 +.icon-close {
  280 + font-size: 40rpx;
  281 +}
  282 +
  283 +.close-container::after {
  284 + content: '';
  285 + position: absolute;
  286 + width: 2rpx;
  287 + height: 40rpx;
  288 + background-color: white;
  289 + left: 50%;
  290 + top: 42rpx;
  291 + transform: translateX(-50%);
  292 +}
  293 +
  294 +
  295 +
  296 +
  297 +
  298 +
  299 +
  300 +.br12 {
  301 + border-radius: 12rpx;
  302 +}
  303 +
  304 +.text-underline {
  305 + text-decoration:underline;
  306 +}
  307 +
  308 +.txt-red {
  309 + color: #ff2d4b;
  310 +}
  311 +
  312 +.bdb {
  313 + border-bottom: 2rpx solid #ebedf0;
  314 +}
  315 +
  316 +.c-yellow {
  317 + color: yellow;
  318 +}
  319 +
  320 +
  321 +
  322 +
  323 +.mask {
  324 + position: fixed;
  325 + width: 100%;
  326 + height: 100%;
  327 + top: 0;
  328 + background-color: rgba(0,0,0,.5);
  329 + /* z-index: 999; */
  330 +}
  331 +
  332 +
  333 +.popup-container2 {
  334 + display: none;
  335 + position: fixed;
  336 + top: 50%;
  337 + left: 50%;
  338 + transform: translate(-50%, -50%);
  339 +}
  340 +
  341 +.popup {
  342 + background-color: white;
  343 + border-radius: 12rpx;
  344 + padding: 20rpx 40rpx;
  345 + margin-top: 20rpx;
  346 +}
  347 +
  348 +.block {
  349 + display: block;
  350 +}
  351 +
  352 +.img-container2 {
  353 + width: 300rpx;
  354 + height: 200rpx;
  355 + margin: 20rpx auto 0;
  356 +}
  357 +
  358 +.note {
  359 + font-size: 24rpx;
  360 + white-space: nowrap;
  361 + color: #7b7b7b;
  362 +}
  363 +
  364 +.c-tb {
  365 + color: #ff6200;
  366 +}
0 367 \ No newline at end of file
... ...
project.config.json 0 → 100644
  1 +{
  2 + "description": "项目配置文件",
  3 + "packOptions": {
  4 + "ignore": []
  5 + },
  6 + "setting": {
  7 + "urlCheck": false,
  8 + "es6": true,
  9 + "enhance": true,
  10 + "postcss": true,
  11 + "preloadBackgroundData": false,
  12 + "minified": true,
  13 + "newFeature": true,
  14 + "coverView": true,
  15 + "nodeModules": true,
  16 + "autoAudits": false,
  17 + "showShadowRootInWxmlPanel": true,
  18 + "scopeDataCheck": false,
  19 + "uglifyFileName": false,
  20 + "checkInvalidKey": true,
  21 + "checkSiteMap": true,
  22 + "uploadWithSourceMap": true,
  23 + "compileHotReLoad": false,
  24 + "useMultiFrameRuntime": true,
  25 + "useApiHook": true,
  26 + "useApiHostProcess": false,
  27 + "babelSetting": {
  28 + "ignore": [],
  29 + "disablePlugins": [],
  30 + "outputPath": ""
  31 + },
  32 + "useIsolateContext": true,
  33 + "useCompilerModule": false,
  34 + "userConfirmedUseCompilerModuleSwitch": false,
  35 + "userConfirmedBundleSwitch": false,
  36 + "packNpmManually": false,
  37 + "packNpmRelationList": [],
  38 + "minifyWXSS": true
  39 + },
  40 + "compileType": "miniprogram",
  41 + "libVersion": "2.16.0",
  42 + "appid": "wx2ea7cdd3ef52cdff",
  43 + "projectname": "MShopWeApp",
  44 + "debugOptions": {
  45 + "hidedInDevtools": []
  46 + },
  47 + "isGameTourist": false,
  48 + "simulatorType": "wechat",
  49 + "simulatorPluginLibVersion": {},
  50 + "condition": {
  51 + "search": {
  52 + "list": []
  53 + },
  54 + "conversation": {
  55 + "list": []
  56 + },
  57 + "plugin": {
  58 + "list": []
  59 + },
  60 + "game": {
  61 + "currentL": -1,
  62 + "list": []
  63 + },
  64 + "gamePlugin": {
  65 + "list": []
  66 + },
  67 + "miniprogram": {
  68 + "list": [
  69 + {
  70 + "id": 0,
  71 + "name": "启动直播列表页",
  72 + "pathName": "pages/justTest/justTest",
  73 + "query": "",
  74 + "scene": null
  75 + },
  76 + {
  77 + "id": 1,
  78 + "name": "liveStreamDetails",
  79 + "pathName": "packageA/pages/liveStreamDetails/liveStreamDetails",
  80 + "query": "",
  81 + "scene": null
  82 + },
  83 + {
  84 + "id": 2,
  85 + "name": "justTest",
  86 + "pathName": "pages/justTest/justTest",
  87 + "query": "",
  88 + "scene": null
  89 + },
  90 + {
  91 + "id": 3,
  92 + "name": "pages/goods/goodsInfo/goodsInfo",
  93 + "pathName": "pages/goods/goodsInfo/goodsInfo",
  94 + "query": "",
  95 + "scene": null
  96 + },
  97 + {
  98 + "id": -1,
  99 + "name": "pages/team/team_show/team_show",
  100 + "pathName": "pages/team/team_show/team_show",
  101 + "query": "",
  102 + "scene": null
  103 + },
  104 + {
  105 + "id": -1,
  106 + "name": "pages/index/index/index",
  107 + "pathName": "pages/index/index/index",
  108 + "query": "",
  109 + "scene": null
  110 + },
  111 + {
  112 + "id": -1,
  113 + "name": "pages/store/index",
  114 + "pathName": "pages/store/index",
  115 + "query": "",
  116 + "scene": null
  117 + },
  118 + {
  119 + "id": 7,
  120 + "name": "packageA/pages/goods_share/goods_share",
  121 + "pathName": "packageA/pages/goods_share/goods_share",
  122 + "query": "",
  123 + "scene": null
  124 + },
  125 + {
  126 + "id": 8,
  127 + "name": "packageA/pages/live_share/live_share",
  128 + "pathName": "packageA/pages/live_share/live_share",
  129 + "query": "",
  130 + "scene": null
  131 + },
  132 + {
  133 + "id": -1,
  134 + "name": "pages/cart/cart2_pt/cart2_pt",
  135 + "pathName": "pages/cart/cart2_pt/cart2_pt",
  136 + "query": "",
  137 + "scene": null
  138 + },
  139 + {
  140 + "id": -1,
  141 + "name": "pages/cart/cart2_pt/cart2_pt",
  142 + "pathName": "pages/cart/cart2_pt/cart2_pt",
  143 + "query": "",
  144 + "scene": null
  145 + },
  146 + {
  147 + "id": -1,
  148 + "name": "pages/cart/cart_wk/cart_wk",
  149 + "pathName": "pages/index/index/index",
  150 + "query": "",
  151 + "scene": null
  152 + },
  153 + {
  154 + "id": -1,
  155 + "name": "pages/cart_wk/cart_wk/cart_wk",
  156 + "pathName": "pages/cart_wk/cart_wk/cart_wk",
  157 + "query": "",
  158 + "scene": null
  159 + },
  160 + {
  161 + "id": -1,
  162 + "name": "pages/cart/cart_wk/cart_wk",
  163 + "pathName": "pages/cart/cart_wk/cart_wk",
  164 + "query": "",
  165 + "scene": null
  166 + },
  167 + {
  168 + "id": -1,
  169 + "name": "pages/user/assistance/assistance",
  170 + "pathName": "pages/user/assistance/assistance",
  171 + "query": "",
  172 + "scene": null
  173 + },
  174 + {
  175 + "id": -1,
  176 + "name": "pages/goods/search/search",
  177 + "pathName": "pages/goods/search/search",
  178 + "query": "",
  179 + "scene": null
  180 + },
  181 + {
  182 + "id": -1,
  183 + "name": "pages/goods/search/search",
  184 + "pathName": "pages/goods/search/search",
  185 + "query": "",
  186 + "scene": null
  187 + },
  188 + {
  189 + "id": -1,
  190 + "name": "pages/user/userinfo/userinfo",
  191 + "pathName": "pages/user/userinfo/userinfo",
  192 + "query": "",
  193 + "scene": null
  194 + },
  195 + {
  196 + "id": -1,
  197 + "name": "pages/user/goods_share/goods_share",
  198 + "pathName": "pages/user/goods_share/goods_share",
  199 + "query": "",
  200 + "scene": null
  201 + },
  202 + {
  203 + "id": -1,
  204 + "name": "packageA//pages/user/goods_share/goods_share",
  205 + "pathName": "packageA//pages/user/goods_share/goods_share",
  206 + "query": "",
  207 + "scene": null
  208 + },
  209 + {
  210 + "id": -1,
  211 + "name": "packageA/pages/user/goods_share/goods_share",
  212 + "pathName": "packageA/pages/user/goods_share/goods_share",
  213 + "query": "",
  214 + "scene": null
  215 + },
  216 + {
  217 + "id": 21,
  218 + "name": "packageA/pages/goods_share/goods_share",
  219 + "pathName": "packageA/pages/addCustomer/addCustomer",
  220 + "query": "",
  221 + "scene": null
  222 + },
  223 + {
  224 + "id": -1,
  225 + "name": "packageA/pages/goods_share/goods_share",
  226 + "pathName": "packageA/pages/goods_share/goods_share",
  227 + "query": "",
  228 + "scene": null
  229 + },
  230 + {
  231 + "id": -1,
  232 + "name": "packageA/pages/goods_share/goods_share",
  233 + "pathName": "packageA/pages/goods_share/goods_share",
  234 + "query": "",
  235 + "scene": null
  236 + },
  237 + {
  238 + "id": -1,
  239 + "name": "packageA/pages/activity_share/activity_share",
  240 + "pathName": "packageA/pages/activity_share/activity_share",
  241 + "query": "",
  242 + "scene": null
  243 + },
  244 + {
  245 + "id": -1,
  246 + "name": "packageA/pages/quan_list/quan_list",
  247 + "pathName": "packageA/pages/quan_list/quan_list",
  248 + "query": "",
  249 + "scene": null
  250 + },
  251 + {
  252 + "id": -1,
  253 + "name": "packageA/pages/quan_pro/quan_pro",
  254 + "pathName": "packageA/pages/quan_pro/quan_pro",
  255 + "query": "",
  256 + "scene": null
  257 + },
  258 + {
  259 + "id": -1,
  260 + "name": "packageA/pages/quan_list/quan_list",
  261 + "pathName": "packageA/pages/quan_list/quan_list",
  262 + "query": "",
  263 + "scene": null
  264 + },
  265 + {
  266 + "id": -1,
  267 + "name": "packageA/pages/quan/quan",
  268 + "pathName": "packageA/pages/quan/quan",
  269 + "query": "",
  270 + "scene": null
  271 + },
  272 + {
  273 + "id": -1,
  274 + "name": "packageA/pages/addCustomer/addCustomer",
  275 + "pathName": "packageA/pages/addCustomer/addCustomer",
  276 + "query": "",
  277 + "scene": null
  278 + },
  279 + {
  280 + "id": -1,
  281 + "name": "packageA/pages/quan/quan",
  282 + "pathName": "packageA/pages/quan/quan",
  283 + "query": "",
  284 + "scene": null
  285 + },
  286 + {
  287 + "id": -1,
  288 + "name": "pages/user/assistance/assistance",
  289 + "pathName": "pages/user/assistance/assistance",
  290 + "query": "",
  291 + "scene": null
  292 + },
  293 + {
  294 + "id": -1,
  295 + "name": "packageA/pages/live_share/live_share",
  296 + "pathName": "packageA/pages/live_share/live_share",
  297 + "query": "",
  298 + "scene": null
  299 + },
  300 + {
  301 + "id": -1,
  302 + "name": "packageA/pages/quan/quan",
  303 + "pathName": "packageA/pages/quan/quan",
  304 + "query": "",
  305 + "scene": null
  306 + },
  307 + {
  308 + "id": -1,
  309 + "name": "pages/user/assistance/assistance",
  310 + "pathName": "pages/user/assistance/assistance",
  311 + "query": "",
  312 + "scene": null
  313 + },
  314 + {
  315 + "id": -1,
  316 + "name": "packageA/pages/live_share/live_share",
  317 + "pathName": "packageA/pages/live_share/live_share",
  318 + "query": "",
  319 + "scene": null
  320 + },
  321 + {
  322 + "id": -1,
  323 + "name": "packageA/pages/jfbuy/jfbuy",
  324 + "pathName": "packageA/pages/jfbuy/jfbuy",
  325 + "query": "",
  326 + "scene": null
  327 + },
  328 + {
  329 + "id": -1,
  330 + "name": "packageA/pages/goods_share/goods_share",
  331 + "pathName": "packageA/pages/goods_share/goods_share",
  332 + "query": "",
  333 + "scene": null
  334 + },
  335 + {
  336 + "id": -1,
  337 + "name": "packageA/pages/live_share/live_share",
  338 + "pathName": "packageA/pages/live_share/live_share",
  339 + "query": "",
  340 + "scene": null
  341 + },
  342 + {
  343 + "id": -1,
  344 + "name": "packageA/pages/activity_share/activity_share",
  345 + "pathName": "packageA/pages/activity_share/activity_share",
  346 + "query": "",
  347 + "scene": null
  348 + },
  349 + {
  350 + "id": -1,
  351 + "name": "packageA/pages/jfbuy/jfbuy",
  352 + "pathName": "packageA/pages/jfbuy/jfbuy",
  353 + "query": "",
  354 + "scene": null
  355 + },
  356 + {
  357 + "id": -1,
  358 + "name": "packageA/pages/jfbuy/jfbuy",
  359 + "pathName": "packageA/pages/jfbuy/jfbuy",
  360 + "query": "",
  361 + "scene": null
  362 + },
  363 + {
  364 + "id": -1,
  365 + "name": "pages/user/order_list/order_list",
  366 + "pathName": "pages/user/order_list/order_list",
  367 + "query": "",
  368 + "scene": null
  369 + },
  370 + {
  371 + "id": -1,
  372 + "name": "pages/shop_details/shop_details",
  373 + "pathName": "pages/shop_details/shop_details",
  374 + "query": "",
  375 + "scene": null
  376 + },
  377 + {
  378 + "id": -1,
  379 + "name": "pages/index/index/index",
  380 + "pathName": "pages/index/index/index",
  381 + "query": "",
  382 + "scene": null
  383 + },
  384 + {
  385 + "id": -1,
  386 + "name": "packageA/pages/quan/quan",
  387 + "pathName": "packageA/pages/quan/quan",
  388 + "query": "",
  389 + "scene": null
  390 + },
  391 + {
  392 + "id": -1,
  393 + "name": "packageA/pages/quan/quan",
  394 + "pathName": "packageA/pages/quan/quan",
  395 + "query": "",
  396 + "scene": null
  397 + },
  398 + {
  399 + "id": -1,
  400 + "name": "pages/user/order_list/order_list",
  401 + "pathName": "pages/user/order_list/order_list",
  402 + "query": "",
  403 + "scene": null
  404 + },
  405 + {
  406 + "id": -1,
  407 + "name": "packageA/pages/chongzhi/chongzhi",
  408 + "pathName": "packageA/pages/chongzhi/chongzhi",
  409 + "query": "",
  410 + "scene": null
  411 + },
  412 + {
  413 + "id": -1,
  414 + "name": "packageA/pages/chongzhiDetails/chongzhiDetails",
  415 + "pathName": "packageA/pages/chongzhiDetails/chongzhiDetails",
  416 + "query": "",
  417 + "scene": null
  418 + },
  419 + {
  420 + "id": -1,
  421 + "name": "packageA/pages/chongzhi/chongzhi",
  422 + "pathName": "packageA/pages/chongzhi/chongzhi",
  423 + "query": "",
  424 + "scene": null
  425 + },
  426 + {
  427 + "id": -1,
  428 + "name": "packageA/pages/chongzhiDetails/chongzhiDetails",
  429 + "pathName": "packageA/pages/chongzhiDetails/chongzhiDetails",
  430 + "query": "",
  431 + "scene": null
  432 + },
  433 + {
  434 + "id": -1,
  435 + "name": "pages/user/deposit/prepaid/prepaid",
  436 + "pathName": "pages/user/deposit/prepaid/prepaid",
  437 + "query": "",
  438 + "scene": null
  439 + },
  440 + {
  441 + "id": -1,
  442 + "name": "packageA/pages/chongzhi/chongzhi",
  443 + "pathName": "packageA/pages/chongzhi/chongzhi",
  444 + "query": "",
  445 + "scene": null
  446 + },
  447 + {
  448 + "id": -1,
  449 + "name": "packageA/pages/chongzhi/chongzhi",
  450 + "pathName": "packageA/pages/chongzhi/chongzhi",
  451 + "query": "",
  452 + "scene": null
  453 + },
  454 + {
  455 + "id": -1,
  456 + "name": "packageA/pages/chongzhi/chongzhi",
  457 + "pathName": "packageA/pages/chongzhi/chongzhi",
  458 + "query": "",
  459 + "scene": null
  460 + },
  461 + {
  462 + "id": -1,
  463 + "name": "packageA/pages/chongzhiDetails/chongzhiDetails",
  464 + "pathName": "packageA/pages/chongzhiDetails/chongzhiDetails",
  465 + "query": "",
  466 + "scene": null
  467 + },
  468 + {
  469 + "id": -1,
  470 + "name": "packageA/pages/chongzhi/chongzhi",
  471 + "pathName": "packageA/pages/chongzhi/chongzhi",
  472 + "query": "",
  473 + "scene": null
  474 + },
  475 + {
  476 + "id": -1,
  477 + "name": "packageA/pages/chongzhiDetails/chongzhiDetails",
  478 + "pathName": "packageA/pages/chongzhiDetails/chongzhiDetails",
  479 + "query": "",
  480 + "scene": null
  481 + },
  482 + {
  483 + "id": -1,
  484 + "name": "packageA/pages/chongzhi/chongzhi",
  485 + "pathName": "packageA/pages/chongzhi/chongzhi",
  486 + "query": "",
  487 + "scene": null
  488 + },
  489 + {
  490 + "id": -1,
  491 + "name": "packageA/pages/checkin/checkin",
  492 + "pathName": "packageA/pages/checkin/checkin",
  493 + "query": "",
  494 + "scene": null
  495 + },
  496 + {
  497 + "id": -1,
  498 + "name": "packageA/pages/jfbuy/jfbuy",
  499 + "pathName": "packageA/pages/jfbuy/jfbuy",
  500 + "query": "",
  501 + "scene": null
  502 + },
  503 + {
  504 + "id": -1,
  505 + "name": "packageA/pages/checkin/checkin",
  506 + "pathName": "packageA/pages/checkin/checkin",
  507 + "query": "",
  508 + "scene": null
  509 + },
  510 + {
  511 + "id": -1,
  512 + "name": "pages/user/integral/integral",
  513 + "pathName": "pages/user/integral/integral",
  514 + "query": "",
  515 + "scene": null
  516 + },
  517 + {
  518 + "id": -1,
  519 + "name": "packageA/pages/checkin/checkin",
  520 + "pathName": "packageA/pages/checkin/checkin",
  521 + "query": "",
  522 + "scene": null
  523 + },
  524 + {
  525 + "id": -1,
  526 + "name": "packageA/pages/checkin/checkin",
  527 + "pathName": "packageA/pages/checkin/checkin",
  528 + "query": "",
  529 + "scene": null
  530 + },
  531 + {
  532 + "id": -1,
  533 + "name": "packageA/pages/jfbuy/jfbuy",
  534 + "pathName": "packageA/pages/jfbuy/jfbuy",
  535 + "query": "",
  536 + "scene": null
  537 + },
  538 + {
  539 + "id": -1,
  540 + "name": "packageA/pages/checkin/checkin",
  541 + "pathName": "packageA/pages/checkin/checkin",
  542 + "query": "",
  543 + "scene": null
  544 + },
  545 + {
  546 + "id": -1,
  547 + "name": "packageA/pages/quan_list/quan_list",
  548 + "pathName": "packageA/pages/quan_list/quan_list",
  549 + "query": "",
  550 + "scene": null
  551 + },
  552 + {
  553 + "id": -1,
  554 + "name": "packageA/pages/quan/quan",
  555 + "pathName": "packageA/pages/quan/quan",
  556 + "query": "",
  557 + "scene": null
  558 + },
  559 + {
  560 + "id": -1,
  561 + "name": "packageA/pages/quan_list/quan_list",
  562 + "pathName": "packageA/pages/quan_list/quan_list",
  563 + "query": "",
  564 + "scene": null
  565 + },
  566 + {
  567 + "id": -1,
  568 + "name": "packageA/pages/quan/quan",
  569 + "pathName": "packageA/pages/quan/quan",
  570 + "query": "",
  571 + "scene": null
  572 + },
  573 + {
  574 + "id": -1,
  575 + "name": "packageA/pages/quan/quan",
  576 + "pathName": "packageA/pages/quan/quan",
  577 + "query": "",
  578 + "scene": null
  579 + },
  580 + {
  581 + "id": -1,
  582 + "name": "packageA/pages/checkin/checkin",
  583 + "pathName": "packageA/pages/checkin/checkin",
  584 + "query": "",
  585 + "scene": null
  586 + },
  587 + {
  588 + "id": -1,
  589 + "name": "packageA/pages/chongzhi/chongzhi",
  590 + "pathName": "packageA/pages/chongzhi/chongzhi",
  591 + "query": "",
  592 + "scene": null
  593 + },
  594 + {
  595 + "id": -1,
  596 + "name": "pages/user/assistance/assistance",
  597 + "pathName": "pages/user/assistance/assistance",
  598 + "query": "",
  599 + "scene": null
  600 + },
  601 + {
  602 + "id": -1,
  603 + "name": "pages/giftpack/mygiftpack/mygiftpack",
  604 + "pathName": "pages/giftpack/mygiftpack/mygiftpack",
  605 + "query": "",
  606 + "scene": null
  607 + },
  608 + {
  609 + "id": -1,
  610 + "name": "packageA/pages/quan_list/quan_list",
  611 + "pathName": "packageA/pages/quan_list/quan_list",
  612 + "query": "",
  613 + "scene": null
  614 + },
  615 + {
  616 + "id": -1,
  617 + "name": "packageA/pages/service_record/service_record",
  618 + "pathName": "packageA/pages/service_record/service_record",
  619 + "query": "",
  620 + "scene": null
  621 + },
  622 + {
  623 + "id": -1,
  624 + "name": "packageA/pages/hongBao/hongBao",
  625 + "pathName": "packageA/pages/hongBao/hongBao",
  626 + "query": "",
  627 + "scene": null
  628 + },
  629 + {
  630 + "id": -1,
  631 + "name": "packageA/pages/hongBaoDetails/hongBaoDetails",
  632 + "pathName": "packageA/pages/hongBao/hongBao",
  633 + "query": "",
  634 + "scene": null
  635 + },
  636 + {
  637 + "id": -1,
  638 + "name": "packageA/pages/hongBaoDetails/hongBaoDetails",
  639 + "pathName": "packageA/pages/hongBaoDetails/hongBaoDetails",
  640 + "query": "",
  641 + "scene": null
  642 + },
  643 + {
  644 + "id": -1,
  645 + "name": "packageA/pages/hongBaoDetails/hongBaoDetails",
  646 + "pathName": "packageA/pages/hongBaoDetails/hongBaoDetails",
  647 + "query": "",
  648 + "scene": null
  649 + },
  650 + {
  651 + "id": -1,
  652 + "name": "packageA/pages/hongBao/hongBao",
  653 + "pathName": "packageA/pages/hongBao/hongBao",
  654 + "query": "",
  655 + "scene": null
  656 + },
  657 + {
  658 + "id": -1,
  659 + "name": "packageA/pages/hongBaoDetails/hongBaoDetails",
  660 + "pathName": "packageA/pages/hongBaoDetails/hongBaoDetails",
  661 + "query": "",
  662 + "scene": null
  663 + },
  664 + {
  665 + "id": -1,
  666 + "name": "packageA/pages/hongBao/hongBao",
  667 + "pathName": "packageA/pages/hongBao/hongBao",
  668 + "query": "",
  669 + "scene": null
  670 + },
  671 + {
  672 + "id": -1,
  673 + "name": "packageA/pages/service_record/service_record",
  674 + "pathName": "packageA/pages/service_record/service_record",
  675 + "query": "",
  676 + "scene": null
  677 + },
  678 + {
  679 + "id": -1,
  680 + "name": "packageA/pages/distribution/main/main",
  681 + "pathName": "packageA/pages/distribution/main/main",
  682 + "query": "",
  683 + "scene": null
  684 + },
  685 + {
  686 + "id": -1,
  687 + "name": "packageA/pages/distribution/myteam/myteam",
  688 + "pathName": "packageA/pages/distribution/myteam/myteam",
  689 + "query": "",
  690 + "scene": null
  691 + },
  692 + {
  693 + "id": -1,
  694 + "name": "packageA/pages/distribution/myteam/myteam",
  695 + "pathName": "packageA/pages/distribution/myteam/myteam",
  696 + "query": "",
  697 + "scene": null
  698 + },
  699 + {
  700 + "id": -1,
  701 + "name": "packageA/pages/myteam/myteam",
  702 + "pathName": "packageA/pages/myteam/myteam",
  703 + "query": "",
  704 + "scene": null
  705 + },
  706 + {
  707 + "id": -1,
  708 + "name": "pages/giftpack/newvipgift/newvipgift",
  709 + "pathName": "pages/giftpack/newvipgift/newvipgift",
  710 + "query": "",
  711 + "scene": null
  712 + },
  713 + {
  714 + "id": -1,
  715 + "name": "packageA/pages/distribution/myteam/myteam",
  716 + "pathName": "packageA/pages/distribution/myteam/myteam",
  717 + "query": "",
  718 + "scene": null
  719 + },
  720 + {
  721 + "id": -1,
  722 + "name": "packageA/pages/distribution/order/order",
  723 + "pathName": "packageA/pages/distribution/order/order",
  724 + "query": "",
  725 + "scene": null
  726 + },
  727 + {
  728 + "id": -1,
  729 + "name": "packageA/pages/distribution/myteam/myteam",
  730 + "pathName": "packageA/pages/distribution/myteam/myteam",
  731 + "query": "",
  732 + "scene": null
  733 + },
  734 + {
  735 + "id": -1,
  736 + "name": "packageA/pages/distribution/order/order",
  737 + "pathName": "packageA/pages/distribution/order/order",
  738 + "query": "",
  739 + "scene": null
  740 + },
  741 + {
  742 + "id": -1,
  743 + "name": "packageA/pages/distribution/commision/commision",
  744 + "pathName": "packageA/pages/distribution/commision/commision",
  745 + "query": "",
  746 + "scene": null
  747 + },
  748 + {
  749 + "id": -1,
  750 + "name": "packageA/pages/distribution/commision/commision",
  751 + "pathName": "packageA/pages/distribution/commision/commision",
  752 + "query": "",
  753 + "scene": null
  754 + },
  755 + {
  756 + "id": -1,
  757 + "name": "packageA/pages/distribution/commision/commision",
  758 + "pathName": "packageA/pages/distribution/commision/commision",
  759 + "query": "",
  760 + "scene": null
  761 + },
  762 + {
  763 + "id": -1,
  764 + "name": "packageA/pages/distribution/rank/rank",
  765 + "pathName": "packageA/pages/distribution/rank/rank",
  766 + "query": "",
  767 + "scene": null
  768 + },
  769 + {
  770 + "id": -1,
  771 + "name": "packageA/pages/distribution/commision/commision",
  772 + "pathName": "packageA/pages/distribution/commision/commision",
  773 + "query": "",
  774 + "scene": null
  775 + },
  776 + {
  777 + "id": -1,
  778 + "name": "packageA/pages/distribution/order/order",
  779 + "pathName": "packageA/pages/distribution/order/order",
  780 + "query": "",
  781 + "scene": null
  782 + },
  783 + {
  784 + "id": -1,
  785 + "name": "packageA/pages/distribution/myteam/myteam",
  786 + "pathName": "packageA/pages/distribution/myteam/myteam",
  787 + "query": "",
  788 + "scene": null
  789 + },
  790 + {
  791 + "id": -1,
  792 + "name": "packageA/pages/distribution/main/main",
  793 + "pathName": "packageA/pages/distribution/main/main",
  794 + "query": "",
  795 + "scene": null
  796 + },
  797 + {
  798 + "id": -1,
  799 + "name": "packageA/pages/distribution/card/card",
  800 + "pathName": "packageA/pages/distribution/card/card",
  801 + "query": "",
  802 + "scene": null
  803 + },
  804 + {
  805 + "id": -1,
  806 + "name": "packageA/pages/distribution/rank/rank",
  807 + "pathName": "packageA/pages/distribution/rank/rank",
  808 + "query": "",
  809 + "scene": null
  810 + },
  811 + {
  812 + "id": -1,
  813 + "name": "packageA/pages/distribution/goods/goods",
  814 + "pathName": "packageA/pages/distribution/goods/goods",
  815 + "query": "",
  816 + "scene": null
  817 + },
  818 + {
  819 + "id": -1,
  820 + "name": "packageA/pages/distribution/main/main",
  821 + "pathName": "packageA/pages/distribution/main/main",
  822 + "query": "",
  823 + "scene": null
  824 + },
  825 + {
  826 + "id": -1,
  827 + "name": "packageA/pages/distribution/shop/shop",
  828 + "pathName": "packageA/pages/distribution/shop/shop",
  829 + "query": "",
  830 + "scene": null
  831 + },
  832 + {
  833 + "id": -1,
  834 + "name": "packageA/pages/distribution/rookie/rookie",
  835 + "pathName": "packageA/pages/distribution/rookie/rookie",
  836 + "query": "",
  837 + "scene": null
  838 + },
  839 + {
  840 + "id": -1,
  841 + "name": "packageA/pages/distribution/main/main",
  842 + "pathName": "packageA/pages/distribution/main/main",
  843 + "query": "",
  844 + "scene": null
  845 + },
  846 + {
  847 + "id": -1,
  848 + "name": "pages/index/index/index",
  849 + "pathName": "pages/index/index/index",
  850 + "query": "",
  851 + "scene": null
  852 + },
  853 + {
  854 + "id": -1,
  855 + "name": "packageA/pages/distribution/main/main",
  856 + "pathName": "packageA/pages/distribution/main/main",
  857 + "query": "",
  858 + "scene": null
  859 + },
  860 + {
  861 + "id": -1,
  862 + "name": "packageA/pages/distribution/order/order",
  863 + "pathName": "packageA/pages/distribution/order/order",
  864 + "query": "",
  865 + "scene": null
  866 + },
  867 + {
  868 + "id": -1,
  869 + "name": "packageA/pages/distribution/order/order",
  870 + "pathName": "packageA/pages/distribution/order/order",
  871 + "query": "",
  872 + "scene": null
  873 + },
  874 + {
  875 + "id": -1,
  876 + "name": "packageA/pages/distribution/rank/rank",
  877 + "pathName": "packageA/pages/distribution/rank/rank",
  878 + "query": "",
  879 + "scene": null
  880 + },
  881 + {
  882 + "id": -1,
  883 + "name": "packageA/pages/distribution/myteam/myteam",
  884 + "pathName": "packageA/pages/distribution/myteam/myteam",
  885 + "query": "",
  886 + "scene": null
  887 + },
  888 + {
  889 + "id": -1,
  890 + "name": "packageA/pages/distribution/myteam/myteam",
  891 + "pathName": "packageA/pages/distribution/myteam/myteam",
  892 + "query": "",
  893 + "scene": null
  894 + },
  895 + {
  896 + "id": -1,
  897 + "name": "packageA/pages/distribution/main/main",
  898 + "pathName": "packageA/pages/distribution/main/main",
  899 + "query": "",
  900 + "scene": null
  901 + },
  902 + {
  903 + "id": -1,
  904 + "name": "packageA/pages/distribution/commision/commision",
  905 + "pathName": "packageA/pages/distribution/commision/commision",
  906 + "query": "",
  907 + "scene": null
  908 + },
  909 + {
  910 + "id": -1,
  911 + "name": "packageA/pages/distribution/shop/shop",
  912 + "pathName": "packageA/pages/distribution/shop/shop",
  913 + "query": "",
  914 + "scene": null
  915 + },
  916 + {
  917 + "id": -1,
  918 + "name": "packageA/pages/distribution/shop/shop",
  919 + "pathName": "packageA/pages/distribution/shop/shop",
  920 + "query": "",
  921 + "scene": null
  922 + },
  923 + {
  924 + "id": -1,
  925 + "name": "packageA/pages/distribution/shop/shop",
  926 + "pathName": "packageA/pages/distribution/shop/shop",
  927 + "query": "",
  928 + "scene": null
  929 + },
  930 + {
  931 + "id": -1,
  932 + "name": "packageA/pages/distribution/card/card",
  933 + "pathName": "packageA/pages/distribution/card/card",
  934 + "query": "",
  935 + "scene": null
  936 + },
  937 + {
  938 + "id": -1,
  939 + "name": "packageA/pages/distribution/main/main",
  940 + "pathName": "packageA/pages/distribution/main/main",
  941 + "query": "",
  942 + "scene": null
  943 + },
  944 + {
  945 + "id": -1,
  946 + "name": "packageA/pages/distribution/card/card",
  947 + "pathName": "packageA/pages/distribution/card/card",
  948 + "query": "",
  949 + "scene": null
  950 + },
  951 + {
  952 + "id": -1,
  953 + "name": "packageA/pages/distribution/main/main",
  954 + "pathName": "packageA/pages/distribution/main/main",
  955 + "query": "",
  956 + "scene": null
  957 + },
  958 + {
  959 + "id": -1,
  960 + "name": "pages/index/index/index",
  961 + "pathName": "pages/index/index/index",
  962 + "query": "",
  963 + "scene": null
  964 + },
  965 + {
  966 + "id": -1,
  967 + "name": "packageA/pages/distribution/main/main",
  968 + "pathName": "packageA/pages/distribution/main/main",
  969 + "query": "",
  970 + "scene": null
  971 + },
  972 + {
  973 + "id": -1,
  974 + "name": "pages/index/index/index",
  975 + "pathName": "pages/index/index/index",
  976 + "query": "",
  977 + "scene": null
  978 + },
  979 + {
  980 + "id": -1,
  981 + "name": "packageA/pages/distribution/main/main",
  982 + "pathName": "packageA/pages/distribution/main/main",
  983 + "query": "",
  984 + "scene": null
  985 + },
  986 + {
  987 + "id": -1,
  988 + "name": "packageA/pages/activity_share/activity_share",
  989 + "pathName": "packageA/pages/activity_share/activity_share",
  990 + "query": "",
  991 + "scene": null
  992 + },
  993 + {
  994 + "id": -1,
  995 + "name": "packageA/pages/goods_share/goods_share",
  996 + "pathName": "packageA/pages/goods_share/goods_share",
  997 + "query": "",
  998 + "scene": null
  999 + },
  1000 + {
  1001 + "id": -1,
  1002 + "name": "packageA/pages/service_share/service_share",
  1003 + "pathName": "packageA/pages/service_share/service_share",
  1004 + "query": "",
  1005 + "scene": null
  1006 + },
  1007 + {
  1008 + "id": -1,
  1009 + "name": "packageA/pages/distribution/main/main",
  1010 + "pathName": "packageA/pages/distribution/main/main",
  1011 + "query": "",
  1012 + "scene": null
  1013 + },
  1014 + {
  1015 + "id": -1,
  1016 + "name": "packageA/pages/cardDetails/cardDetails",
  1017 + "pathName": "packageA/pages/cardDetails/cardDetails",
  1018 + "query": "",
  1019 + "scene": null
  1020 + },
  1021 + {
  1022 + "id": -1,
  1023 + "name": "pages/user/my_service/i_service",
  1024 + "pathName": "pages/user/appment_main/appment_main",
  1025 + "query": "",
  1026 + "scene": null
  1027 + },
  1028 + {
  1029 + "id": -1,
  1030 + "name": "pages/user/appment_main/appment_main",
  1031 + "pathName": "pages/user/my_service/appment_main/appment_main",
  1032 + "query": "",
  1033 + "scene": null
  1034 + },
  1035 + {
  1036 + "id": -1,
  1037 + "name": "pages/user/my_service/appment_main",
  1038 + "pathName": "pages/user/my_service/appment_main",
  1039 + "query": "",
  1040 + "scene": null
  1041 + },
  1042 + {
  1043 + "id": -1,
  1044 + "name": "packageA/pages/distribution/main/main",
  1045 + "pathName": "packageA/pages/distribution/main/main",
  1046 + "query": "",
  1047 + "scene": null
  1048 + },
  1049 + {
  1050 + "id": -1,
  1051 + "name": "pages/index/index/index",
  1052 + "pathName": "pages/index/index/index",
  1053 + "query": "",
  1054 + "scene": null
  1055 + },
  1056 + {
  1057 + "id": -1,
  1058 + "name": "packageA/pages/distribution/main/main",
  1059 + "pathName": "packageA/pages/distribution/main/main",
  1060 + "scene": null
  1061 + }
  1062 + ]
  1063 + }
  1064 + }
  1065 +}
0 1066 \ No newline at end of file
... ...
utils/filter.wxs
... ... @@ -29,7 +29,7 @@ var filters = {
29 29  
30 30 if (ts == null || ts == undefined || ts == '') return "";
31 31 var d = getDate(ts * 1000)
32   - var fm = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('-');
  32 + var fm = [appendZero(d.getFullYear()), appendZero(d.getMonth() + 1), appendZero(d.getDate())].join('-');
33 33 var md = (d.getMonth() + 1) + '月' + d.getDate() + '日';
34 34 if (isFull == 1)
35 35 fm = fm + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes()), appendZero(d.getSeconds())].join(':');
... ...