1 line
8.4 KiB
JavaScript
1 line
8.4 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"3d58":function(e,t,o){e.exports={theme_bg:"#f30213"}},"447e":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("34cf")),s=n(o("7ca3")),c=n(o("ee10")),i=(n(o("facf")),n(o("3240"))),f=o("8f59");function d(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 l(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?d(Object(o),!0).forEach((function(t){(0,s.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var p={data:function(){return{options:{}}},computed:(0,f.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin","forcedLoginState"]),onLaunch:function(){var t=(0,c.default)(a.default.mark((function t(o){var n,u,s,c=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),"pagesub/index/store"===o.url&&(n="",o.query.scene?n=decodeURIComponent(o.query.scene):(o.query.store_id||o.store_id)&&(n="store_id=".concat(o.query.store_id)),n?r.navigateTo({url:"/".concat(o.path,"?").concat(n)}):(console.error("错误:未找到 store_id 参数"),r.switchTab({url:"/pages/index/index"}))),u=this,e.getSystemInfo({success:function(e){i.default.prototype.statusBar=e.statusBarHeight;var t=r.getMenuButtonBoundingClientRect();console.log(t),i.default.prototype.customBar=t.bottom+t.top-e.statusBarHeight}});try{e.getStorageSync("selang")||(s=e.getSystemInfoSync(),e.setStorageSync("selang",s.language))}catch(a){}return this.__("首页"),this.__("分类"),this.__("社区"),this.__("购物车"),this.__("我的"),u.reloadLang(),u.resetLang(),t.next=15,this.$store.dispatch("getSysInfo",(function(e){u.$isResolve()}));case 15:if(!this.hasLogin){t.next=20;break}return t.next=18,this.$store.dispatch("getCartList",(function(e){}));case 18:this.checkNewMsg(),setInterval((function(){c.checkNewMsg()}),6e4);case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),onShow:function(){var e=(0,c.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(){},onTabItemTap:function(e){console.log("没有触发",e)},methods:l(l({},(0,f.mapMutations)(["logout","getPlantformInfo","forceUserInfo","getUserInfo","showCartNum","reloadUserResource","setMsgNum"])),{},{parseScene:function(e){var t={};return e.split("&").forEach((function(e){var o=e.split("="),r=(0,u.default)(o,2),n=r[0],a=r[1];t[n]=a})),t},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=p}).call(this,o("df3c")["default"],o("3223")["default"])},"73f3":function(e,t,o){"use strict";o.r(t);var r=o("c2bc");for(var n in r)["default"].indexOf(n)<0&&function(e){o.d(t,e,(function(){return r[e]}))}(n);o("7840");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},7840:function(e,t,o){"use strict";var r=o("3d58"),n=o.n(r);n.a},c2bc:function(e,t,o){"use strict";o.r(t);var r=o("447e"),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},e09b:function(e,t,o){"use strict";(function(e,t,r){var n=o("47a9"),a=n(o("7ca3"));o("ec76");var u=n(o("3240")),s=n(o("73f3"));o("b5c2");var c=n(o("7ef8")),i=n(o("23b9")),f=n(o("facf")),d=n(o("3bf1")),l=n(o("1985")),p=n(o("35cc")),g=n(o("e4a2")),_=n(o("52ff"));function y(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("c273"),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.bdMapAk="j2XbIbapUzLD0ycnJa6Cc5T7lppsxvMJ",u.default.prototype.tmplIds=["kiDj_hSF_ASwD-Dlgxnypi6IJBQZ12a-hEpd3zZ-Uxc","Lq6_OHOemtmBoWGrd9zvyJ3ultzXB5metmqPtYeV0pc"],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("2039"))}.bind(null,o)).catch(o.oe)})),u.default.component("loading",(function(){o.e("components/loading").then(function(){return resolve(o("6334"))}.bind(null,o)).catch(o.oe)})),s.default.mpType="app",u.default.prototype.$onLaunched=new Promise((function(e){u.default.prototype.$isResolve=e}));var h=new u.default(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?y(Object(o),!0).forEach((function(t){(0,a.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):y(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({store:c.default},s.default));r(h).$mount()}).call(this,o("3223")["default"],o("df3c")["default"],o("df3c")["createApp"])}},[["e09b","common/runtime","common/vendor"]]]); |