Files
T
陈誉午 994b267f5c feat: 电子药箱小程序 - 4Tab药品管理
- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡
- 药品百科: 搜索 + 分类筛选 + 20种药品静态数据
- 惠教中心: 4条药品使用指南课程
- 我的: 家庭成员信息管理
- 自定义TabBar + navigation-bar组件
- SVG药品分类插图
2026-07-29 11:20:52 +08:00

1 line
20 KiB
JavaScript

"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var _utils=require("../../../utils/utils"),_constant=require("../../../utils/constant"),_socket=require("../../../utils/socket"),_times=require("../../../utils/times"),_storage=require("../../../utils/storage"),_theme=require("../../../utils/theme"),_singleLogin=require("../../../utils/singleLogin"),_questionnaireManager=require("../../../utils/questionnaire-manager");function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(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)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),c=new T(o||[]);return r(a,"_invoke",{value:_(e,n,c)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function d(){}function p(){}var I={};s(I,i,function(){return this});var y=Object.getPrototypeOf,v=y&&y(y(w([])));v&&v!==t&&n.call(v,i)&&(I=v);var g=p.prototype=f.prototype=Object.create(I);function m(e){["next","throw","return"].forEach(function(t){s(e,t,function(e){return this._invoke(t,e)})})}function k(e,t){function o(r,i,a,c){var s=h(e[r],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==_typeof(l)&&n.call(l,"__await")?t.resolve(l.__await).then(function(e){o("next",e,a,c)},function(e){o("throw",e,a,c)}):t.resolve(l).then(function(e){u.value=e,a(u)},function(e){return o("throw",e,a,c)})}c(s.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t(function(t,r){o(e,n,t,r)})}return i=i?i.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function b(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var o=h(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,l;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function w(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=s(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},m(k.prototype),s(k.prototype,a,function(){return this}),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},m(g),s(g,c,"Generator"),s(g,i,function(){return this}),s(g,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=w,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){asyncGeneratorStep(i,r,o,a,c,"next",e)}function c(e){asyncGeneratorStep(i,r,o,a,c,"throw",e)}a(void 0)})}}Component({options:{styleIsolation:"shared"},properties:{sdkInstance:{type:Object,value:null}},data:{visible:!1,loading:!1,data:null,checkValue:"",checkedCheckIn:[],useDarkTheme:!1,isDeadline:!1,errMsg:"",isSubmitSuccess:!1,openedCheckInId:[]},lifetimes:{detached:function(){"function"==typeof this.unsub&&this.unsub(),this.unsub=null}},observers:{sdkInstance:function(e){var t=this;if(e){this.store=e.store,this.sdkInstance=e;var n=this;e.on(_constant.EVENTS.INNER.socket.init,function(e){n.socket=e,n.bindSocketEvents()});var r=1,o=0;"function"==typeof this.unsub&&this.unsub(),this.unsub=null,this.unsub=this.store.get({CheckInInfo:function(e){var r=e||{},o=r.visible,i=r.currentId;o&&i&&n.openCheckIn(i),o||n.selectComponent("#check-in-drawer").hideFrame({silent:!0}),(0,_utils.setDataIfChanged)(t,{visible:!!o})},liveInfo:function(e){(0,_utils.setDataIfChanged)(t,{useDarkTheme:(0,_theme.isUseDarkTheme)(null==e?void 0:e.Basic)})},mainInfo:function(e){2===(e||{}).mode&&n.setCheckedCheckIn()},userInfo:function(e){(e||{}).userId&&n.setCheckedCheckIn()},imageTextInfo:function(e){var t=((null==e?void 0:e.imageText)||[]).length;t&&1===r&&(r++,n.imageTextUpdateList()),t!==o&&(o=t,setTimeout(function(){n.checkInAutoOpen()},500))}})}}},methods:{openCheckInDrawer:function(){this.selectComponent("#check-in-drawer").showFrame()},closeCheckInDrawer:function(){this.selectComponent("#check-in-drawer").hideFrame(),this.myCancel()},myCancel:function(){var e=this;(this.store.get("CheckInInfo")||{}).visible&&(this.store.set("CheckInInfo",{visible:!1,currentId:null}),this.setData({isSubmitSuccess:!1}),setTimeout(function(){e.checkInAutoOpen()},500))},valueChange:function(e){this.setData({checkValue:e.detail.value||"",errMsg:""})},onCountDown:function(){this.setData({isDeadline:!0,errMsg:""})},isLogin:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 2===this.store.get("mainInfo").mode||(e&&this.triggerEvent("commentCheck"),!1)},setCurrentData:function(e){var t=e.IsChecked,n=e.CheckInInfo,r=e.CheckInName,o=e.StartTime,i=e.DeadLine,a=e.DeadlineSecond,c=e.NeedPersonInfo,s=e.CannotWatchLiveWhenNotCheckIn;this.setData({data:{CheckInName:(0,_utils.getBySplit)(r),CheckInInfo:(0,_utils.getBySplit)(n),NeedPersonInfo:c,StartTime:o,Deadline:i,DeadlineSecond:a,IsChecked:t,ShowKickoutTip:!t&&(0,_questionnaireManager.isYesFlag)(s)}})},setCheckedIn:function(e,t){var n=this,r=this.data.checkedCheckIn;this.setData({checkedCheckIn:r.concat([e])},function(){n.imageTextUpdate({CheckInID:e,CheckInStatus:t})});var o=this.store.get("userInfo").userId,i=this.store.get("mainInfo").activityId+"_"+o;this.localCacheCheckIn(i,e)},updateNewStatus:function(e){var t=e.IsChecked,n=e.CheckInConfig||{},r=n.Status,o=n.CheckInId,i=n.CheckInName,a=n.StartTime,c=n.Deadline,s=n.DeadlineSecond,u=n.NeedPersonInfo,h=n.CheckInInfo,l=n.CannotWatchLiveWhenNotCheckIn;t&&this.setCheckedIn(o,r),this.setCurrentData({IsChecked:t,CheckInName:i,StartTime:a,DeadLine:c,DeadlineSecond:s,NeedPersonInfo:u,CheckInInfo:h,CannotWatchLiveWhenNotCheckIn:l})},openCheckIn:function(e){var t=this;return _asyncToGenerator(_regeneratorRuntime().mark(function n(){var r,o,i,a,c,s,u,h;return _regeneratorRuntime().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t.setData({isDeadline:!1,checkValue:"",errMsg:""}),r=t.store.get("imageTextInfo")||{},o=r.imageText,i=null,null==o||o.forEach(function(t){null==t||t.Context.forEach(function(t){var n;t.ImageTextType===_constant.ImageTextTypes.CHECKIN&&(null===(n=t.CheckInContext)||void 0===n?void 0:n.CheckInId)===e&&(i=t.CheckInContext)})}),i){n.next=7;break}return t.sdkInstance.reportLogger("mini_sdk_check_in_no_current_data",{imageText:o,CheckInId:e}),n.abrupt("return");case 7:if(t.setCurrentData(i),t.openCheckInDrawer(),t.isLogin()){n.next=12;break}return t.sdkInstance.reportLogger("mini_sdk_check_in_no_login",{CheckInId:e}),n.abrupt("return");case 12:return a=t.store.get("userInfo"),c=a.userId,s=t.store.get("mainInfo"),u=s.activityId,t.setData({loading:!0}),n.next=17,t.sdkInstance.request(_constant.REQUEST_URL_MAP.GET_CHECK_IN_DETAIL,{method:"GET",data:{CheckInId:e,ActivityId:u,UserId:c}});case 17:if(h=n.sent,t.setData({loading:!1}),h){n.next=22;break}return t.sdkInstance.reportLogger("mini_sdk_check_in_get_detail_fail",{ActivityId:u,CheckInId:e,UserId:c}),n.abrupt("return");case 22:t.updateNewStatus(h);case 23:case"end":return n.stop()}},n)}))()},formSubmit:function(){var e=this;return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var n,r,o,i,a,c,s,u;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isLogin(!0)){t.next=2;break}return t.abrupt("return");case 2:if(!e.data.data.NeedPersonInfo||e.data.checkValue.trim()){t.next=5;break}return e.setData({errMsg:"empty"}),t.abrupt("return");case 5:return e.setData({isSubmitting:!0}),n=e.store.get("mainInfo"),r=n.activityId,o=e.store.get("CheckInInfo"),i=o.currentId,a=e.store.get("userInfo"),c=a.userId,s={CheckInId:i,ActivityId:r,UserId:Number(c),PersonInfo:e.data.checkValue},t.next=12,e.sdkInstance.request(_constant.REQUEST_URL_MAP.CHECK_IN_SUBMIT,{method:"POST",data:s});case 12:if(u=t.sent,e.setData({isSubmitting:!1}),u){t.next=18;break}return wx.showToast({title:"提交失败",icon:"none"}),e.sdkInstance.reportLogger("mini_sdk_check_in_join_error",s),t.abrupt("return");case 18:e.sdkInstance.reportLogger("mini_sdk_check_in_join_success",s),e.setCheckedIn(i),e.setData({isSubmitSuccess:!0});case 21:case"end":return t.stop()}},t)}))()},imageTextUpdate:function(e){var t,n=e.CheckInID,r=e.CheckInStatus,o=this.data.checkedCheckIn.includes(n),i=this.store.get("CheckInInfo")||{},a=i.visible,c=i.currentId,s=this.store.get("imageTextInfo")||{},u=s.imageText,h=void 0===u?[]:u,l=_createForOfIteratorHelper(h);try{for(l.s();!(t=l.n()).done;){var f,d=_createForOfIteratorHelper(t.value.Context);try{for(d.s();!(f=d.n()).done;){var p=f.value;if((null==p?void 0:p.ImageTextType)===_constant.ImageTextTypes.CHECKIN){var I=p.CheckInContext;if(I&&I.CheckInId===n)return r&&(I.Status=r),I.IsChecked=null!=o?o:I.IsChecked,this.handleCheckInKickout(I,n,r),this.store.set("imageTextInfo",_objectSpread(_objectSpread({},s),{},{imageText:h})),void(a&&c===n&&r&&"Export"!==r&&this.setData({isDeadline:!0,errMsg:""}))}}}catch(e){d.e(e)}finally{d.f()}}}catch(e){l.e(e)}finally{l.f()}},handleCheckInKickout:function(e,t,n){if("Deadline"===n&&(0,_questionnaireManager.isYesFlag)(null==e?void 0:e.CannotWatchLiveWhenNotCheckIn)&&!this.data.checkedCheckIn.includes(t)){var r=(this.store.get("mainInfo")||{}).activityId,o=(this.store.get("userInfo")||{}).userId;if(r&&o){var i=(0,_storage.safeGetStorageJSON)("checkedId",{}),a=r+"_"+o;Array.isArray(i[a])&&i[a].includes(t)||(this.store.set("CheckInInfo",{visible:!1,currentId:null}),this.setData({isSubmitSuccess:!1}),(0,_singleLogin.updateBanStatus)(this.store,{isBanned:!0,banType:_constant.BAN_TYPE.CHECK_IN,banTips:(null==e?void 0:e.CannotWatchLivePrompt)||"",isSoftBan:!1}))}}},imageTextUpdateList:function(){var e=this.store.get("imageTextInfo")||{},t=e.imageText,n=void 0===t?[]:t;if(n.length){var r,o=_createForOfIteratorHelper(n);try{for(o.s();!(r=o.n()).done;){var i,a=_createForOfIteratorHelper(r.value.Context);try{for(a.s();!(i=a.n()).done;){var c=i.value;if((null==c?void 0:c.ImageTextType)===_constant.ImageTextTypes.CHECKIN){var s=c.CheckInContext,u=s.CheckInId,h=this.data.checkedCheckIn.includes(u);s&&h&&(s.IsChecked=!0)}}}catch(e){a.e(e)}finally{a.f()}}}catch(e){o.e(e)}finally{o.f()}this.store.set("imageTextInfo",_objectSpread(_objectSpread({},e),{},{imageText:n}))}},bindSocketEvents:function(){var e,t=this;null===(e=this.socket)||void 0===e||e.on(_socket.WsMethod.imageTextLotteryOrCheckInUpdate,function(e){e.SendType===_constant.ImageTextTypes.CHECKIN&&(t.sdkInstance.reportLogger("mini_sdk_check_in_update",{data:e}),t.imageTextUpdate(e))})},setCheckedCheckIn:function(){var e=(this.store.get("mainInfo")||{}).activityId,t=(this.store.get("userInfo")||{}).userId;if(e&&t){var n=(0,_storage.safeGetStorageJSON)("checkedId",{})[e+"_"+t];if(t&&Array.isArray(n)){var r=n.slice(1);this.setData({checkedCheckIn:r})}}},localCacheCheckIn:function(e,t){var n=(0,_storage.safeGetStorageJSON)("checkedId",{});Array.isArray(n[e])?(n[e].includes(t)||n[e].push(t),n[e][0]=Date.now()):n[e]=[Date.now(),t];var r=Object.keys(n);if(r.length>10){var o=r.sort(function(e,t){return(Array.isArray(n[e])?n[e][0]:0)-(Array.isArray(n[t])?n[t][0]:0)}),i=r.length-10;o.slice(0,i).forEach(function(e){delete n[e]})}(0,_storage.safeSetStorageJSON)("checkedId",n)},open:function(e,t){var n=this.data.openedCheckInId;n.push(e),this.store.set("CheckInInfo",{visible:!0,currentId:e}),this.setData({openedCheckInId:_toConsumableArray(n)}),this.sdkInstance.reportTea("mini_sdk_auto_open_check_in_modal",{CheckInId:e,param:t})},checkInAutoOpen:function(){var e=this;return _asyncToGenerator(_regeneratorRuntime().mark(function t(){var n,r,o,i,a,c,s,u,h,l,f,d,p,I,y,v,g,m,k,_,b,C,x,T;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.store.get("CheckInInfo")||{},r=n.visible,o=e.store.get("imageTextInfo")||{},i=o.imageText,a=void 0===i?[]:i,c=e.data,s=c.openedCheckInId,u=c.checkedCheckIn,h=e.store.get("mainInfo")||{},l=h.activityId,f=e.store.get("userInfo"),d=(f||{}).userId,l){t.next=9;break}return t.abrupt("return");case 9:if(r||!a.length){t.next=45;break}p=0;case 11:if(!(p<a.length)){t.next=45;break}if(y=(null===(I=a[p].Context)||void 0===I?void 0:I.length)||0){t.next=15;break}return t.abrupt("continue",42);case 15:v=0;case 16:if(!(v<y)){t.next=42;break}if(g=a[p].Context[v],m=g.CheckInContext||{},k=m.CheckInId,_=m.Status,b=m.StartTime,C=u.includes(k)?1:0,g.ImageTextType!==_constant.ImageTextTypes.CHECKIN||"Export"!==_||C||s.includes(k)){t.next=39;break}if(!(x=(0,_times.isRecent)(b,20))){t.next=29;break}return e.sdkInstance.reportTea("mini_sdk_check_in_should_popup",{CheckInId:k,ActivityId:l,UserId:d,Reason:"recent"}),e.open(k,x),t.abrupt("return");case 29:return t.next=31,e.sdkInstance.request(_constant.REQUEST_URL_MAP.GET_CHECK_IN_DETAIL,{method:"GET",data:{CheckInId:k,ActivityId:l,UserId:Number(d)}});case 31:if(null==(T=t.sent)||!T.IsChecked){t.next=36;break}e.setCheckedIn(k),t.next=39;break;case 36:return e.sdkInstance.reportTea("mini_sdk_check_in_should_popup",{CheckInId:k,ActivityId:l,UserId:d,Reason:"api_check",ApiResult:T}),e.open(k,T),t.abrupt("return");case 39:v++,t.next=16;break;case 42:p++,t.next=11;break;case 45:case"end":return t.stop()}},t)}))()}}});