1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugins/check_in/index/index"],{"4c33":function(e,t,n){"use strict";(function(e){n("2d0a");i(n("66fd"));var t=i(n("f8dd"));function i(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},"7ffd":function(e,t,n){"use strict";var i=n("fb6a"),a=n.n(i);a.a},c893:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n("2f62");function a(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,c=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw o}}}}function r(e,t){if(e){if("string"===typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h={data:function(){return{month:1,year:1990,everyday:[],config:{total:[],continue:[]},user:{},result:{},other_height:"500rpx",now:1,noday:["","","","","","","",""],week:1,date:[],getRed:!1,customize:null,page_loading:!0,template_message:!1,success:!1}},computed:s({},(0,i.mapState)({userInfo:function(e){return e.user.info},mallImg:function(e){return e.mallConfig.__wxapp_img.mall},checkImg:function(e){return e.mallConfig.plugin.check_in}})),methods:{toRules:function(){e.navigateTo({url:"/pages/rules/index?url=".concat(encodeURIComponent(this.$api.check_in.index),"&keys=").concat(JSON.stringify(["config","rule"]))})},toIndex:function(){e.redirectTo({url:"/pages/index/index"})},getSetting:function(){var t=this;t.$request({url:t.$api.check_in.customize}).then((function(n){0==n.code?(t.customize=n.data.list,t.getList()):(t.$hideLoading(),e.showToast({title:n.msg,icon:"none",duration:1e3}))})).catch((function(e){t.$hideLoading()}))},getList:function(){var t=this;t.$request({url:t.$api.check_in.index}).then((function(n){t.$hideLoading(),0==n.code?(t.config=n.data.config,t.user=n.data.check_in_user,t.template_message=n.data.template_message,t.getEveryday()):e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(e){t.$hideLoading()}))},getEveryday:function(){var e=this,t=e.month,n=e.year,i=32,a=[];t<8&&t%2==0&&2!=t||t>7&&t%2==1?i=31:2==t&&(i=n%4==0&&n%100!=0?30:29);for(var r=1;r<i;r++)a.push({date:r,check:!1});for(var o=e.noday,c=e.week,s=0;s<c;s++)a.unshift(o[s]);if(a.length%7!=0)for(var u=7-a.length%7,h=0;h<u;h++)a.push(o[h]);e.everyday=a,e.getDay(n,t)},getDay:function(t,n){var i=this;i.$request({url:i.$api.check_in.sign_in_day,data:{month:n,year:t}}).then((function(t){if(i.$hideLoading(),0==t.code){var n,r=t.data.check_in_day,o=a(i.everyday);try{for(o.s();!(n=o.n()).done;){var c=n.value;if(c){c.check=!1;var s,u=a(r);try{for(u.s();!(s=u.n()).done;){var h=s.value;h==c.date&&(c.check=!0)}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){o.e(d)}finally{o.f()}i.$forceUpdate()}else e.showToast({title:t.msg,icon:"none",duration:1e3})})).catch((function(e){i.$hideLoading()}))},lose:function(){var e=this.month-1,t=this.year,n=this.now;e<1&&(e=12,t--);var i=t+"-"+e+"-01",a=new Date(Date.parse(i.replace(/-/g,"/")));this.week=a.getDay();var r=new Date,o=r.getFullYear(),c=r.getMonth()+1;n=t==o?e>c?0:e<c?32:r.getDate():t>o?0:32,this.year=t,this.month=e,this.now=n,this.getEveryday()},add:function(){var e=this.month+1,t=this.year,n=this.now;e>12&&(e=1,t++);var i=t+"-"+e+"-01",a=new Date(Date.parse(i.replace(/-/g,"/")));this.week=a.getDay();var r=new Date,o=r.getFullYear(),c=r.getMonth()+1;n=t==o?e>c?0:e<c?32:r.getDate():t>o?0:32,this.year=t,this.month=e,this.now=n,this.getEveryday()},subscribe:function(){var e=this;this.$subscribe(this.template_message).then((function(t){e.getAward(1)})).catch((function(t){e.getAward(1)}))},getAward:function(t,n){var i=this;e.showLoading({mask:!0,title:1==t?"签到中...":"领取中..."}),i.$request({url:i.$api.check_in.sign_in,data:{status:t,day:n||1}}).then((function(t){if(0==t.code){var n=t.data.queueId,a=t.data.token;i.checkInResult(n,a)}else e.hideLoading(),e.showToast({title:t.msg,icon:"none",duration:1e3})})).catch((function(a){e.hideLoading(),i.$event.on(i.$const.EVENT_USER_LOGIN).then((function(){i.$store.dispatch("user/info"),i.getAward(t,n)}))}))},checkInResult:function(t,n){var i=this;i.$request({url:i.$api.check_in.sign_in_result,data:{queueId:t,token:n}}).then((function(a){e.hideLoading(),0==a.code?1==a.data.retry?i.checkInResult(t,n):(i.result=a.data,"integral"==i.result.type?i.success=!0:"balance"==i.result.type&&(i.getRed=!0)):e.showToast({title:a.msg,icon:"none",duration:1e3})})).catch((function(t){e.hideLoading()}))},changeSwitch:function(){0==this.user.is_remind&&this.$subscribe(this.template_message)},toSwitch:function(t){var n=this,i=this,a=0;t.detail.value&&(a=1),i.$request({url:i.$api.check_in.user,data:{is_remind:a}}).then((function(t){i.$hideLoading(),0==t.code?n.user.is_remind=a:e.showToast({title:t.msg,icon:"none",duration:1e3})})).catch((function(e){i.$hideLoading()}))},close:function(){this.success=!1,this.getRed=!1,this.getList()}},onShareAppMessage:function(){return this.$shareAppMessage({title:this.$children[0].navigationBarTitle,path:"/plugins/check_in/index/index"})},onShareTimeline:function(){return this.$shareTimeline({title:this.$children[0].navigationBarTitle,query:{}})},onLoad:function(){this.$commonLoad.onload();var e=this;wx.getSystemInfo({success:function(t,n){e.other_height=2*t.windowHeight-500+"rpx"}});var t=new Date;e.year=t.getFullYear(),e.month=t.getMonth()+1,e.now=t.getDate();var n=e.year+"-"+e.month+"-01",i=new Date(Date.parse(n.replace(/-/g,"/")));e.week=i.getDay(),wx.showShareMenu({menus:["shareAppMessage","shareTimeline"]}),e.$showLoading({type:"global",text:"加载中..."}),e.getSetting()}};t.default=h}).call(this,n("543d")["default"])},da5c:function(e,t,n){"use strict";var i;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i}));var a=function(){var e=this,t=e.$createElement;e._self._c},r=[]},eeef:function(e,t,n){"use strict";n.r(t);var i=n("c893"),a=n.n(i);for(var r in i)"default"!==r&&function(e){n.d(t,e,(function(){return i[e]}))}(r);t["default"]=a.a},f8dd:function(e,t,n){"use strict";n.r(t);var i=n("da5c"),a=n("eeef");for(var r in a)"default"!==r&&function(e){n.d(t,e,(function(){return a[e]}))}(r);n("7ffd");var o,c=n("f0c5"),s=Object(c["a"])(a["default"],i["b"],i["c"],!1,null,"f085787e",null,!1,i["a"],o);t["default"]=s.exports},fb6a:function(e,t,n){}},[["4c33","common/runtime","common/vendor"]]]);
|