1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"07b8":function(e,t,o){"use strict";o.r(t);var n=o("4546");for(var a in n)["default"].indexOf(a)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(a);o("e951");var i=o("828b"),r=Object(i["a"])(n["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);t["default"]=r.exports},"1aee":function(e,t,o){"use strict";(function(e,t){var n=o("47a9"),a=n(o("7ca3"));o("f076");var i=n(o("3240")),r=n(o("07b8")),c=n(o("d1e1")),s=n(o("1844")),u=n(o("1e56")),d=n(o("4d38")),l=n(o("4881"));function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function h(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach((function(t){(0,a.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}e.__webpack_require_UNI_MP_PLUGIN__=o,i.default.prototype.$util=u.default,i.default.prototype.$config=d.default,i.default.prototype.$Cache=s.default,i.default.prototype.$eventHub=new i.default,i.default.prototype.$socket=new l.default,i.default.config.productionTip=!1;i.default.component("home",(function(){Promise.all([o.e("common/vendor"),o.e("components/home/index")]).then(function(){return resolve(o("0708"))}.bind(null,o)).catch(o.oe)})),i.default.component("skeleton",(function(){o.e("components/skeleton/index").then(function(){return resolve(o("537b"))}.bind(null,o)).catch(o.oe)})),i.default.component("BaseMoney",(function(){o.e("components/BaseMoney").then(function(){return resolve(o("7202"))}.bind(null,o)).catch(o.oe)})),i.default.component("BaseTag",(function(){o.e("components/BaseTag").then(function(){return resolve(o("ddf8"))}.bind(null,o)).catch(o.oe)})),i.default.component("baseDrawer",(function(){o.e("components/tui-drawer/tui-drawer").then(function(){return resolve(o("af01"))}.bind(null,o)).catch(o.oe)})),i.default.component("easyLoadimage",(function(){o.e("components/easy-loadimage/easy-loadimage").then(function(){return resolve(o("94dd"))}.bind(null,o)).catch(o.oe)})),r.default.mpType="app";var p=new i.default(h(h({},r.default),{},{store:c.default,Cache:s.default}));t(p).$mount()}).call(this,o("3223")["default"],o("df3c")["createApp"])},4546:function(e,t,o){"use strict";o.r(t);var n=o("5685"),a=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(i);t["default"]=a.a},5685:function(e,t,o){"use strict";(function(e,n){var a=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(o("7eb4")),r=a(o("34cf")),c=a(o("ee10")),s=(o("5088"),o("4d38")),u=o("769c"),d=o("48a0"),l=o("c4d7"),f=(a(o("998d")),a(o("4891"))),h=o("360a"),p=o("92f9"),g=o("8f59"),m={globalData:{spid:0,code:0,isLogin:!1,userInfo:{},globalData:!1,windowHeight:e.getWindowInfo().windowHeight+"px",sysHeight:e.getWindowInfo().statusBarHeight},computed:(0,g.mapGetters)(["isLogin","cartNum"]),watch:{cartNum:function(t,o){this.$store.commit("indexData/setCartNum",t+""),t>0?e.setTabBarBadge({index:3,text:t>99?"99+":t+""}):e.hideTabBarRedDot({index:3})}},onShow:function(t){var o=e.getEnterOptionsSync();if(o.query.spid&&(this.$Cache.set("spread",o.query.spid),this.globalData.spid=o.query.spid,this.globalData.pid=o.query.spid,(0,l.silenceBindingSpread)(this.globalData)),o.query.scene){var n=this.$util.getUrlParams(decodeURIComponent(o.query.scene));n.spid&&(this.$Cache.set("spread",n.spid),this.globalData.spid=n.spid),(0,l.silenceBindingSpread)(this.globalData)}},onLaunch:function(t){var o=this;e.hideTabBar();this.setConfig(),this.setTheme(),this.$store.dispatch("getBasicConfig"),this.$store.dispatch("getPageFooter"),this.$store.dispatch("getActivityModal"),this.$store.getters.isLogin?this.$store.getters.isLogin&&this.getExpired()&&(this.$Cache.clear(u.LOGIN_STATUS),f.default.getCode().then((function(e){o.silenceAuth(e)}))):f.default.getCode().then((function(e){o.silenceAuth(e)})).catch((function(t){e.hideLoading()}))},methods:{remoteRegister:function(e){var t=this;(0,d.remoteRegister)({remote_token:e}).then((function(e){var o=e.data;o.get_remote_login_url?location.href=o.get_remote_login_url:(t.$store.commit("LOGIN",{token:o.token,time:o.expires_time-t.$Cache.time()}),(0,p.getUserInfo)().then((function(e){t.$store.commit("SETUID",e.data.uid),t.$store.commit("UPDATE_USERINFO",e.data),location.reload()})).catch((function(e){return t.$util.Tips({title:err})})))}))},silenceAuth:function(t){var o=this,n=this,a=n.globalData.spid?n.globalData.spid:"";(0,d.silenceAuth)({code:t,spread_spid:a,spread_code:n.globalData.code}).then((function(t){if(void 0!==t.data.token&&t.data.token){e.hideLoading();var a=t.data.expires_time-o.$Cache.time();n.$store.commit("LOGIN",{token:t.data.token,time:a}),n.$store.commit("SETUID",t.data.userInfo.uid),n.$store.commit("UPDATE_USERINFO",t.data.userInfo)}})).catch((function(e){return n.$util.Tips({title:e})}))},checkUpdateVersion:function(){if(n.canIUse("getUpdateManager")){var e=n.getUpdateManager();e.onCheckForUpdate((function(t){t.hasUpdate&&(e.onUpdateReady((function(){n.showModal({title:"温馨提示",content:"检测到新版本,是否重启小程序?",showCancel:!1,success:function(t){t.confirm&&e.applyUpdate()}})})),e.onUpdateFailed((function(){n.showModal({title:"已有新版本",content:"请您删除小程序,重新搜索进入"})})))}))}else n.showModal({title:"溫馨提示",content:"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"})},getExpired:function(){return(0,c.default)(i.default.mark((function e(){return i.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]])})))()},setConfig:function(){e.removeStorageSync(u.SUBSCRIBE_MESSAGE),this.$Cache.clear("homeTop");""==s.HTTP_REQUEST_URL&&e.showToast({title:"请配置根目录下的config/app.js文件中的HTTP_REQUEST_URL",icon:"error"}),this.checkUpdateVersion();var t=e.getMenuButtonBoundingClientRect();this.globalData.navH=2*t.top+t.height/2;var o=n.getAppBaseInfo().SDKVersion;f.default.compareVersion(o,"2.21.2")>=0?this.$Cache.set("MP_VERSION_ISNEW",!0):this.$Cache.set("MP_VERSION_ISNEW",!1),(0,d.getLogo)().then((function(t){e.setStorageSync("BASIC_CONFIG",t.data)}))},setTheme:function(){(0,h.colorChange)("color_change").then((function(t){var o,n=t.data.status,a=(null===(o=t.data.color_data)||void 0===o?void 0:o.theme_type)||1;if(1==a){e.setStorageSync("statusColor",n),e.$emit("colorOk",n);var i={1:"--view-theme: #1DB0FC;--view-minorColorT:rgba(9, 139, 243, 0.1);--view-bntColor:#22CAFD;--view-gradient:#5ACBFF",2:"--view-theme: #42CA4D;--view-minorColorT:rgba(66, 202, 77, 0.1);--view-bntColor:#FE960F;--view-gradient:#4DEA4D",3:"--view-theme: #e93323;--view-minorColorT:rgba(233, 51, 35, 0.1);--view-bntColor:#FE960F;--view-gradient:#FF7931",4:"--view-theme: #FF448F;--view-minorColorT:rgba(255, 68, 143, 0.1);--view-bntColor:#282828;--view-gradient:#FF67AD",5:"--view-theme: #FE5C2D;--view-minorColorT:rgba(254, 92, 45, 0.1);--view-bntColor:#FDB000;--view-gradient:#FF9451",6:"--view-theme: #E0A558;--view-minorColorT:rgba(224, 165, 88, 0.1);--view-bntColor:#1A1A1A;--view-gradient:#FFCD8C"};Object.entries(i).forEach((function(t){var o=(0,r.default)(t,2),a=o[0],i=o[1];a==n&&(e.setStorageSync("viewColor",i),e.$emit("ok",i))}))}else{var c=t.data.color_data,s="--view-theme: ".concat(c.theme_color,";--view-minorColorT:").concat(c.light_color,";--view-bntColor:").concat(c.aux_color,";--view-gradient:").concat(c.gradient_color);e.setStorageSync("viewColor",s),e.$emit("ok",s)}}))},setScript:function(){var e=document.createElement("script");e.src="".concat(s.HTTP_REQUEST_URL,"/api/get_script"),document.head.appendChild(e)}}};t.default=m}).call(this,o("df3c")["default"],o("3223")["default"])},b487:function(e,t,o){},e951:function(e,t,o){"use strict";var n=o("b487"),a=o.n(n);a.a}},[["1aee","common/runtime","common/vendor"]]]); |