1 line
7.8 KiB
JavaScript
1 line
7.8 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{2302:function(e,t,o){"use strict";var r=o("72ff"),n=o.n(r);n.a},5740:function(e,t,o){"use strict";(function(e,r){var n=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(o("7eb4")),u=n(o("7ca3")),s=n(o("ee10")),c=(n(o("3779")),n(o("3240"))),i=o("8f59");function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function d(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,u.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}var l={data:function(){return{options:{}}},computed:(0,i.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin","forcedLoginState"]),onLaunch:function(){var t=(0,s.default)(a.default.mark((function t(o){var n,u,s=this;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:o.query.ucccode&&e.setStorageSync("source_ucc_code",o.query.ucccode),o.query.uid&&e.setStorageSync("activity_id",o.query.activity_id),n=this,e.getSystemInfo({success:function(e){c.default.prototype.statusBar=e.statusBarHeight;var t=r.getMenuButtonBoundingClientRect();console.log(t),c.default.prototype.customBar=t.bottom+t.top-e.statusBarHeight}});try{e.getStorageSync("selang")||(u=e.getSystemInfoSync(),e.setStorageSync("selang",u.language))}catch(a){}return this.__("首页"),this.__("分类"),this.__("发现"),this.__("购物车"),this.__("我的"),n.reloadLang(),n.resetLang(),t.next=14,this.$store.dispatch("getSysInfo",(function(e){n.$isResolve()}));case 14:if(!this.hasLogin){t.next=19;break}return t.next=17,this.$store.dispatch("getCartList",(function(e){}));case 17:this.checkNewMsg(),setInterval((function(){s.checkNewMsg()}),6e4);case 19:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),onShow:function(){var e=(0,s.default)(a.default.mark((function e(){var t,o=this;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this,console.info("app onShow"),e.next=4,this.$onLaunched;case 4:setTimeout((function(){o.getPlantformInfo((function(e){t.hasLogin&&t.userInfo.im&&t.plantformInfo.config.chat_global&&(console.info("app socket connectserver"),t.$Socket.connectserver(t.userInfo.im))}))}),300);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),onHide:function(){},methods:d(d({},(0,i.mapMutations)(["logout","getPlantformInfo","forceUserInfo","getUserInfo","showCartNum","reloadUserResource","setMsgNum"])),{},{reloadLang:function(e){var t=this;t.$.request({url:this.Config.URL.listTranslateLang,data:{},loading:!1,ajaxCache:{timeout:t.Config.CACHE_EXPIRE},success:function(e,o,r,n){for(var a in e){var u=a.replace("_","-");console.info(u),t.Lang.G[u]=Object.assign(t.Lang.G[u]||{},e[a])}console.info(t.Lang),t.resetLang()}})},checkNewMsg:function(){if(this.hasLogin){var t=getCurrentPages(),o=t[t.length-1];if(o){if(console.info(o.route),"pagesub/webpage/web"==o.route)return;if(this.$.inArray(["pagesub/webpage/web","pagesub/uLive/subnvue/live","pagesub/uLive/subnvue/push"],o.route))return}var r=this;r.$.request({url:r.Config.URL.user.msg_count,loading:!1,data:{recently_flag:1},success:function(t,o,n,a){200==o?(r.setMsgNum(t.num),t.num>0&&(!t.msg_row||t.msg_row&&1==t.msg_row.message_type||e.showModal({title:r.$.sprintf("%s",t.msg_row.user_other_nickname),content:r.$.sprintf("发来消息, 是否接入聊天?"),success:function(e){if(e.confirm){if(t.msg_row.user_other_id){var o={user_other_id:t.msg_row.user_other_id};r.$.request({url:r.Config.URL.user.msg_set_read,data:o,success:function(e,o,n,a){if(200==o){r.$.getStorageSync("uid"),r.$.getStorageSync("ukey"),t.msg_row.user_other_nickname;var u=t.msg_row.user_other_id,s=r.$.sprintf("/im/chat/chat?uid=%s",u);r.$.gopage(s)}}})}}else e.cancel&&console.log("用户点击取消")}}))):r.setMsgNum(0)}})}}})};t.default=l}).call(this,o("df3c")["default"],o("3223")["default"])},"72ff":function(e,t,o){e.exports={theme_bg:"#f30213"}},a329:function(e,t,o){"use strict";(function(e,t,r){var n=o("47a9"),a=n(o("7ca3"));o("90c2");var u=n(o("3240")),s=n(o("d48c"));o("4f79");var c=n(o("9a42")),i=n(o("b126")),f=n(o("3779")),d=n(o("1b70")),l=n(o("be2d")),p=n(o("bab1")),g=n(o("bdc9")),_=n(o("053a"));function h(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}o("be78"),e.__webpack_require_UNI_MP_PLUGIN__=o,u.default.prototype.Lang=i.default,u.default.prototype.$report=_.default.report;u.default.config.productionTip=!1,u.default.prototype.$store=c.default,u.default.prototype.$=l.default,u.default.prototype.cf=f.default,u.default.prototype.__=i.default.__,u.default.prototype.sprintf=l.default.sprintf,u.default.prototype.number_format=l.default.number_format,u.default.prototype.mf=l.default.mf,u.default.prototype.statecode=d.default,u.default.prototype.$Socket=p.default,u.default.prototype.$apiconfig=g.default,u.default.prototype.resetLang=function(){f.default.tabBar.list;for(var e=0;e<f.default.tabBar.list.length;e++)t.setTabBarItem({index:e,text:i.default.__(f.default.tabBar.list[e].text)})},u.default.prototype.setData=function(e){for(var o in e){if("options"==o){if(e[o].uid&&(t.setStorageSync("source_user_id",e[o].uid),l.default.source_data.source_type==this.statecode.SOURCE_TYPE_H5&&$cookies.set("fxid",e[o].uid)),e[o].uid&&e[o].pid){var r={},n=t.getStorageSync("source_item_id");n&&(r=JSON.parse(n));var a=parseInt(Date.parse(new Date)/100),u={};u[e[o].pid]={u:e[o].uid,t:a},Object.assign(r,u),t.setStorageSync("source_item_id",JSON.stringify(r)),l.default.source_data.source_type,this.statecode.SOURCE_TYPE_H5}if(e[o].sid&&(t.setStorageSync("source_store_id",e[o].sid),l.default.source_data.source_type==this.statecode.SOURCE_TYPE_H5&&$cookies.set("stid",e[o].sid)),e[o].uid&&e[o].ukey)l.default.setStorageSync("uid",e[o].uid),l.default.setStorageSync("ukey",e[o].ukey);e[o].source_ucc_code&&t.setStorageSync("source_ucc_code",e[o].source_ucc_code)}this.$set(this,o,e[o])}},u.default.component("status-bar",(function(){o.e("components/status-bar").then(function(){return resolve(o("226f"))}.bind(null,o)).catch(o.oe)})),u.default.component("loading",(function(){o.e("components/loading").then(function(){return resolve(o("6c03"))}.bind(null,o)).catch(o.oe)})),s.default.mpType="app",u.default.prototype.$onLaunched=new Promise((function(e){u.default.prototype.$isResolve=e}));var y=new u.default(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?h(Object(o),!0).forEach((function(t){(0,a.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):h(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({store:c.default},s.default));r(y).$mount()}).call(this,o("3223")["default"],o("df3c")["default"],o("df3c")["createApp"])},cc75:function(e,t,o){"use strict";o.r(t);var r=o("5740"),n=o.n(r);for(var a in r)["default"].indexOf(a)<0&&function(e){o.d(t,e,(function(){return r[e]}))}(a);t["default"]=n.a},d48c:function(e,t,o){"use strict";o.r(t);var r=o("cc75");for(var n in r)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return r[e]}))}(n);o("2302");var a=o("828b"),u=Object(a["a"])(r["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);t["default"]=u.exports}},[["a329","common/runtime","common/vendor"]]]); |