You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
51 KiB
1 line
51 KiB
|
5 years ago
|
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)a.d(n,s,function(t){return e[t]}.bind(null,s));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=8)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=class{constructor(e){this.Component=e}getData(e){const t=this.Component.data;if(!e)return t;if(e.includes(".")){return e.split(".").reduce((e,t)=>e[t],t)}return this.Component.data[e]}setData(e,t=(()=>{})){e&&"object"==typeof e&&this.Component.setData(e,t)}};t.default=n},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSystemInfo=o,t.isComponent=function(e){return e&&void 0!==e.__wxExparserNodeId__&&"function"==typeof e.setData},t.isIos=i,t.getCurrentPage=d,t.getComponent=function(e){const t=new c;let a=d()||{};if(a.selectComponent&&"function"==typeof a.selectComponent){if(e)return a.selectComponent(e);t.warn("请传入组件ID")}else t.warn("该基础库暂不支持多个小程序日历组件")},t.uniqueArrayByDate=function(e=[]){let t={},a=[];e.forEach(e=>{t[`${e.year}-${e.month}-${e.day}`]=e});for(let e in t)a.push(t[e]);return a},t.delRepeatedEnableDay=function(e=[],t=[]){let a,n;if(2===t.length){const{startTimestamp:e,endTimestamp:s}=f(t);a=e,n=s}return h(e).filter(e=>e<a||e>n)},t.convertEnableAreaToTimestamp=f,t.getDateTimeStamp=b,t.converEnableDaysToTimestamp=h,t.initialTasks=t.GetDate=t.Slide=t.Logger=void 0;var n,s=(n=a(2))&&n.__esModule?n:{default:n};let r;function o(){return r||(r=wx.getSystemInfoSync())}class c{info(e){console.log("%cInfo: %c"+e,"color:#FF0080;font-weight:bold","color: #FF509B")}warn(e){console.log("%cWarn: %c"+e,"color:#FF6600;font-weight:bold","color: #FF9933")}tips(e){console.log("%cTips: %c"+e,"color:#00B200;font-weight:bold","color: #00CC33")}}t.Logger=c;t.Slide=class{isUp(e={},t={}){const{startX:a,startY:n}=e,s=t.clientX-a;return t.clientY-n<-60&&s<20&&s>-20&&(this.slideLock=!1,!0)}isDown(e={},t={}){const{startX:a,startY:n}=e,s=t.clientX-a;return t.clientY-n>60&&s<20&&s>-20}isLeft(e={},t={}){const{startX:a,startY:n}=e,s=t.clientX-a,r=t.clientY-n;return s<-60&&r<20&&r>-20}isRight(e={},t={}){const{startX:a,startY:n}=e,s=t.clientX-a,r=t.clientY-n;return s>60&&r<20&&r>-20}};class l{newDate(e,t,a){let n=`${+e}-${+t}-${+a}`;return i()&&(n=`${+e}/${+t}/${+a}`),new Date(n)}thisMonthDays(e,t){return new Date(Date.UTC(e,t,0)).getUTCDate()}firstDayOfWeek(e,t){return new Date(Date.UTC(e,t-1,1)).getUTCDay()}dayOfWeek(e,t,a){return new Date(Date.UTC(e,t-1,a)).getUTCDay()}todayDate(){const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()}}todayTimestamp(){const{year:e,month:t,date:a}=this.todayDate();return this.newDate(e,t,a).getTime()}toTimeStr(e){return e.day&&(e.date=e.day),`${+e.year}-${+e.month}-${+e.date}`}sortDates(e,t){return e.sort(function(e,a){return b(e)<b(a)&&"desc"!==t?-1:1})}prevMonth(e){return+e.month>1?{year:e.year,month:e.month-1}:{year:e.year-1,month:12}}nextMonth(e){return+e.month<12?{year:e.year,month:e.month+1}:{year:e.year+1,month:1}}convertLunar(e=[]){return e.map(e=>(e&&(e.lunar=s.default.solar2lunar(+e.year,+e.month,+e.day)),e))}}function i(){const e=o();return/iphone|ios/i.test(e.platform)}function d(){const e=getCurrentPages();return e[e.length-1]}function f(e=[]){const t=new l,a=e[0].split("-"),n=e[1].split("-"),s=ne
|