(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"0179":function(e,t,o){"use strict";(function(e,t){var a=o("47a9"),n=a(o("7ca3"));o("7561");var r=a(o("3240")),i=a(o("8f62")),c=a(o("9a76")),s=a(o("a4e8")),u=a(o("2c75")),l=a(o("bad7")),d=a(o("375d"));function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function f(e){for(var t=1;t0?e.setTabBarBadge({index:3,text:t>99?"99+":t+""}):e.hideTabBarRedDot({index:3})}},onLaunch:function(){var t=(0,i.default)(r.default.mark((function t(o){var a,n,i,p,f=this;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.hideTabBar(),a=this,(0,u.getLogo)().then((function(t){e.setStorageSync("BASIC_CONFIG",t.data)})),(0,d.copyRight)().then((function(t){var o=t.data;e.setStorageSync("wechatStatus",o.wechat_status),f.site_config=o.record_No,o.copyrightContext||o.copyrightImage||(o.copyrightImage="/static/images/support.png"),e.setStorageSync("copyNameInfo",o.copyrightContext),e.setStorageSync("copyImageInfo",o.copyrightImage),e.setStorageSync("MPSiteData",JSON.stringify({site_logo:o.site_logo,site_name:o.site_name}))})).catch((function(e){return f.$util.Tips({title:e.msg})})),(0,d.colorChange)("color_change").then((function(t){var o=t.data.navigation,a=t.data.status;switch(e.setStorageSync("navigation",o),e.$emit("navOk",o),e.setStorageSync("statusColor",a),e.$emit("colorOk",a),t.data.status){case 1:e.setStorageSync("viewColor",v),e.$emit("ok",v);break;case 2:e.setStorageSync("viewColor",m),e.$emit("ok",m);break;case 3:e.setStorageSync("viewColor",b),e.$emit("ok",b);break;case 4:e.setStorageSync("viewColor",w),e.$emit("ok",w);break;case 5:e.setStorageSync("viewColor",C),e.$emit("ok",C);break;case 6:e.setStorageSync("viewColor",y),e.$emit("ok",y);break;default:e.setStorageSync("viewColor",b),e.$emit("ok",b);break}})),this.$store.dispatch("getDiyProduct"),o.query.spid&&(a.$Cache.set("spid",o.query.spid),a.globalData.spid=o.query.spid,(0,g.silenceBindingSpread)()),""!=c.HTTP_REQUEST_URL){t.next=10;break}return t.abrupt("return",!1);case 10:if(!o.query.hasOwnProperty("scene")){t.next=25;break}n=a.$util.getUrlParams(decodeURIComponent(o.query.scene)),t.t0=o.scene,t.next=1047===t.t0?15:1048===t.t0?17:1049===t.t0?20:1001===t.t0?23:25;break;case 15:return a.globalData.spid=void 0===n.spid?n:n.spid,t.abrupt("break",25);case 17:return a.globalData.spid=void 0===n.spid?n:n.spid,a.globalData.code=o.query.scene,t.abrupt("break",25);case 20:return a.globalData.spid=void 0===n.spid?n:n.spid,a.globalData.code=o.query.scene,t.abrupt("break",25);case 23:return a.globalData.spid=void 0===n.spid?n:n.spid,t.abrupt("break",25);case 25:this.checkUpdateVersion(),e.getSystemInfo({success:function(e){a.globalData.navHeight=e.statusBarHeight*(750/e.windowWidth)+91}}),i=e.getMenuButtonBoundingClientRect(),a.globalData.navH=2*i.top+i.height/2,p=e.getSystemInfoSync().SDKVersion,l.default.compareVersion(p,"2.21.2")>=0?a.$Cache.set("MP_VERSION_ISNEW",!0):a.$Cache.set("MP_VERSION_ISNEW",!1),this.$store.getters.isLogin?this.$store.getters.isLogin&&this.getExpired()&&(this.$Cache.clear(s.LOGIN_STATUS),l.default.getCode().then((function(e){f.silenceAuth(e)}))):l.default.getCode().then((function(e){f.silenceAuth(e)})).catch((function(t){e.hideLoading()}));case 32:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),onShow:function(e){var t=this;[1007,1008,1014,1044,1045,1046,1047,1048,1049,1073,1154,1155].includes(e.scene)&&h.getShareParams().then((function(e){e.custom_params.pid&&(t.$Cache.set("spid",e.custom_params.pid),t.globalData.spid=e.custom_params.pid)})).catch((function(e){}))},methods:{silenceAuth:function(t){var o=this,a=this,n=a.globalData.spid?a.globalData.spid:"";(0,u.silenceAuth)({code:t,spread_spid:n,spread_code:a.globalData.code}).then((function(t){if(void 0!==t.data.token&&t.data.token){e.hideLoading();var n=t.data.expires_time-o.$Cache.time();a.$store.commit("LOGIN",{token:t.data.token,time:n}),a.$store.commit("SETUID",t.data.userInfo.uid),a.$store.commit("UPDATE_USERINFO",t.data.userInfo)}})).catch((function(e){return a.$util.Tips({title:e})}))},isWork:function(){return-1!==navigator.userAgent.toLowerCase().indexOf("wxwork")&&-1!==navigator.userAgent.toLowerCase().indexOf("micromessenger")},checkUpdateVersion:function(){if(a.canIUse("getUpdateManager")){var e=a.getUpdateManager();e.onCheckForUpdate((function(t){t.hasUpdate&&(e.onUpdateReady((function(){a.showModal({title:"温馨提示",content:"检测到新版本,是否重启小程序?",showCancel:!1,success:function(t){t.confirm&&e.applyUpdate()}})})),e.onUpdateFailed((function(){a.showModal({title:"已有新版本",content:"请您删除小程序,重新搜索进入"})})))}))}else a.showModal({title:"溫馨提示",content:"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"})},getExpired:function(){return(0,i.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,p.getUserInfo)();case 3:return e.abrupt("return",!1);case 6:return e.prev=6,e.t0=e["catch"](0),e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))()}}};t.default=S}).call(this,o("df3c")["default"],o("3223")["default"])},7237:function(e,t,o){"use strict";var a=o("ca8c"),n=o.n(a);n.a},"78fa":function(e,t,o){"use strict";o.r(t);var a=o("5d6f"),n=o.n(a);for(var r in a)["default"].indexOf(r)<0&&function(e){o.d(t,e,(function(){return a[e]}))}(r);t["default"]=n.a},"8f62":function(e,t,o){"use strict";o.r(t);var a=o("78fa");for(var n in a)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return a[e]}))}(n);o("7237");var r=o("828b"),i=Object(r["a"])(a["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);t["default"]=i.exports},ca8c:function(e,t,o){}},[["0179","common/runtime","common/vendor"]]]);