(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"107d":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var o=function(){var e=this.$createElement,t=(this._self._c,!this.popup_show||this.downstatus<1?null:(this.downSize/1024/1024).toFixed(2)),n=!this.popup_show||this.downstatus<1?null:(this.fileSize/1024/1024).toFixed(2);this.$mp.data=Object.assign({},{$root:{g0:t,g1:n}})},i=[]},1210:function(e,t,n){},"426e":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,i=n("48a0"),a={name:"appUpdate",props:{tabbar:{type:Boolean,default:!1},getVer:{type:Boolean,default:!1}},data:function(){return{popup_show:!1,platform:"",version:"1.0.0",need_update:!1,downing:!1,downstatus:0,update_info:{os:"",version:"",info:""},fileSize:0,downSize:0,viewObj:null}},created:function(){o=this,this.getVer||this.update()},computed:{lengthWidth:function(){var e=this.downSize/this.fileSize*100;return e=e?e.toFixed(2):0,{width:e+"%"}},getHeight:function(){var e=0;return this.tabbar&&(e=50),{bottom:e+"px",height:"auto"}}},methods:{update:function(){},getUpdateInfo:function(){var t=this;(0,i.getUpdateInfo)("ios"===this.platform?2:1).then((function(n){if(Array.isArray(n.data))return t.$emit("isNew");var i=e.getStorageSync("app_update_time")||"",a=(new Date).toLocaleDateString();if(i===a||t.getVer){if(i!==a&&t.getVer){if(!n.data.is_force)return}else if(i==a&&!t.getVer&&!n.data.is_force)return}else e.setStorageSync("app_update_time",(new Date).toLocaleDateString());var s=n.data;o.update_info=s,o.update_info.platform&&o.checkUpdate()})).catch((function(e){o.popup_show=!1}))},checkUpdate:function(){o.need_update=o.compareVersion(o.version,o.update_info.version),o.need_update?(o.popup_show=!0,o.tabbar&&(o.viewObj=new plus.nativeObj.View("viewObj",{bottom:"0px",left:"0px",height:"50px",width:"100%",backgroundColor:"rgba(0,0,0,.6)"}),o.viewObj.show())):this.$emit("isNew")},closeUpdate:function(){o.update_info.is_force?"android"==this.platform?plus.runtime.quit():plus.ios.import("UIApplication").sharedApplication().performSelector("exit"):(o.popup_show=!1,o.viewObj&&o.viewObj.hide())},nowUpdate:function(){if(o.downing)return!1;o.downing=!0,/\.apk$/.test(o.update_info.url)||/\.wgt$/.test(o.update_info.url)?o.download_wgt():plus.runtime.openURL(o.update_info.url,(function(){plus.nativeUI.toast("打开错误")}))},download_wgt:function(){plus.nativeUI.showWaiting("下载更新文件...");var e=plus.downloader.createDownload(o.update_info.url,{method:"get"},(function(e,t){}));e.addEventListener("statechanged",(function(e,t){if(null===t);else if(200==t)switch(o.downstatus=e.state,e.state){case 3:o.downSize=e.downloadedSize,e.totalSize&&(o.fileSize=e.totalSize);break;case 4:o.installWgt(e.filename);break}else plus.nativeUI.closeWaiting(),plus.nativeUI.toast("下载出错"),o.downing=!1,o.downstatus=0})),e.start()},installWgt:function(e){plus.nativeUI.showWaiting("安装更新文件..."),plus.runtime.install(e,{},(function(){plus.nativeUI.closeWaiting(),plus.nativeUI.alert("应用资源下载完成!",(function(){plus.runtime.restart()}))}),(function(e){plus.nativeUI.closeWaiting(),plus.nativeUI.alert("安装更新文件失败["+e.code+"]:"+e.message)}))},compareVersion:function(e,t){if(!e||!t||""==e||""==t)return!1;for(var n=e.split(".",4),o=t.split(".",4),i=0;is||r.length>a.length)return!0;if(cn.length&&0==t.indexOf(e)}}};t.default=a}).call(this,n("df3c")["default"])},"576f":function(e,t,n){"use strict";n.r(t);var o=n("7fb3"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},"7fb3":function(e,t,n){"use strict";(function(e,o){var i=n("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n("7ca3")),s=i(n("89cc")),r=n("360a"),c=n("48a0"),u=i(n("1844")),d=n("769c"),l=n("8f59"),f=n("0f73"),h=n("95b5"),p=n("5088"),g=n("4d38");i(n("ad50"));function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(e){for(var t=1;t0?e.setTabBarBadge({index:3,text:this.cartNum>99?"99+":this.cartNum+""}):e.hideTabBarRedDot({index:3}),e.removeStorageSync("form_type_cart")},methods:b(b({},(0,l.mapMutations)(["SET_AUTOPLAY"])),{},{getOptions:function(e){if(e.scene){var t=this.$util.getUrlParams(decodeURIComponent(e.scene));t.spid&&(v.globalData.spid=t.spid)}e.spid&&(v.globalData.spid=e.spid)},reconnect:function(){var e=this;this.diyData(),(0,c.getShare)().then((function(t){e.shareInfo=t.data}))},goICP:function(){e.navigateTo({url:"/pages/annex/web_view/index?url=https://beian.miit.gov.cn/"})},bindHeighta:function(e){},bindHeight:function(t){e.hideLoading(),this.domOffsetTop=t.top},changeSort:function(e,t){this.curSort!=t&&(this.curSort=t,this.sid=e.id,this.goodList=[],this.goodPage=1,this.loaded=!1,this.getGoodsList())},bindSortId:function(e){this.styleConfig=[],this.loaded=!1,1==e.type?this.getProductList(e.classPage):(this.sortList=[],this.getMicroPage(e.microPage,!0))},getMicroPage:function(t,n){var o=this,i=this;i.styleConfig=[],i.goodList=[],e.showLoading({title:"加载中..."}),(0,r.getDiy)(t).then((function(t){e.hideLoading();t.data;var n=i.objToArr(t.data.value);n=n.filter((function(e){return"1"!==e.isHide})),n.forEach((function(e,t){["headerSerch","homeComb"].includes(e.name)&&n.splice(t,1)})),o.styleConfig=n})).catch((function(e){return i.$util.Tips({title:e})}))},getProductList:function(e){var t=this;this.curSort=0,this.loaded=!1,this.sortAll.length>0?(this.sortAll.forEach((function(n,o){n.id==e&&(t.$set(t,"sortList",n),t.sid=n.children.length?n.children[0].id:"")})),this.goodList=[],this.goodPage=1,this.$nextTick((function(){""!=t.sortList&&t.getGoodsList()}))):(0,f.getCategoryList)().then((function(n){t.sortAll=n.data,n.data.forEach((function(n,o){n.id==e&&(t.sortList=n,t.sid=n.children.length?n.children[0].id:"")})),t.goodList=[],t.goodPage=1,t.$nextTick((function(){""!=t.sortList&&t.getGoodsList()}))}))},getGoodsList:function(){var e=this;this.loading||this.loaded||(this.loading=!0,(0,f.getProductslist)({sid:this.sid,keyword:"",priceOrder:"",salesOrder:"",news:0,page:this.goodPage,limit:10,cid:this.sortList.id}).then((function(t){e.loading=!1,e.loaded=t.data.length<10,e.goodPage++,e.goodList=e.goodList.concat(t.data)})))},getTemlIds:function(){var e=o.getStorageSync(d.SUBSCRIBE_MESSAGE);e||(0,r.getTemlIds)().then((function(e){e.data&&o.setStorageSync(d.SUBSCRIBE_MESSAGE,JSON.stringify(e.data))}))},objToArr:function(e){var t=Object.keys(e).sort(),n=t.map((function(t){return e[t]}));return n},setDiyData:function(t){var n=this;this.errorNetwork=!1,t.is_bg_color&&(this.bgColor=t.color_picker),t.is_bg_pic&&(this.bgPic=t.bg_pic,this.bgTabVal=t.bg_tab_val),this.pageShow=t.is_show,e.setNavigationBarTitle({title:t.title});var o=[],i=this.objToArr(t.value);i.forEach((function(e,t,i){"homeComb"===e.name&&(n.showHomeComb=!0,n.homeCombData=e),"headerSerch"==e.name&&(n.isHeaderSerch=!0,n.headerSerchCombData=e),"tabNav"==e.name&&(n.showCateNav=!0,n.cateNavData=e),"1"!==e.isHide&&o.push(e)})),o.sort((function(e,t){return e.timestamp-t.timestamp})),this.styleConfig=o},getDiyData:function(){var t=this;(0,r.getDiy)(0).then((function(n){e.setStorageSync("diyData",JSON.stringify(n.data)),t.setDiyData(n.data)})).catch((function(e){}))},diyData:function(){var t=this,n=e.getStorageSync("diyData");n?(0,r.getDiyVersion)(0).then((function(o){var i=e.getStorageSync("diyVersion");o.data.version+"0"===i?t.setDiyData(JSON.parse(n)):(e.setStorageSync("diyVersion",o.data.version+"0"),t.getDiyData())})):this.getDiyData()},changeLogin:function(){this.getIsLogin()},getIsLogin:function(){(0,p.toLogin)()},changeBarg:function(t){this.isLogin?e.navigateTo({url:"/pages/activity/goods_bargain_details/index?id=".concat(t.id,"&spid=").concat(this.$store.state.app.uid)}):this.getIsLogin()},goDetail:function(t){(0,h.goShopDetail)(t,this.$store.state.app.uid).catch((function(n){e.navigateTo({url:"/pages/goods_details/index?id=".concat(t.id)})}))},newDataStatus:function(e){this.isFooter=!!e},checked:function(){}}),onReachBottom:function(){this.goodList.length&&this.getGoodsList()},onPullDownRefresh:function(){this.goodList=[],this.sortList=[],this.diyData(),this.pullReset=1,setTimeout((function(){e.stopPullDownRefresh()}),1e3)},onPageScroll:function(t){t.scrollTop>10?this.isScrolled=!0:this.isScrolled=!1,e.$emit("scroll"),e.$emit("onPageScroll",t.scrollTop)},onShareAppMessage:function(){var e=this.uid?this.uid:0;return this.shareInfo.img?{title:this.shareInfo.title,path:"/pages/index/index?spid="+e,imageUrl:this.shareInfo.img,desc:this.shareInfo.synopsis}:{title:this.shareInfo.title,path:"/pages/index/index?spid="+e}},onShareTimeline:function(){var e=this.uid?this.uid:0;return{title:this.shareInfo.title,path:"/pages/index/index?spid="+e,imageUrl:this.shareInfo.img,desc:this.shareInfo.synopsis}}};t.default=w}).call(this,n("df3c")["default"],n("3223")["default"])},"94a5":function(e,t,n){"use strict";(function(e,t){var o=n("47a9");n("f076");o(n("3240"));var i=o(n("977d"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"977d":function(e,t,n){"use strict";n.r(t);var o=n("a4e9"),i=n("576f");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("b1dde");var s=n("828b"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=r.exports},a4e9:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var o=function(){var e=this,t=e.$createElement,n=(e._self._c,e.pageShow?e.__get_style([e.pageStyle]):null),o=e.pageShow&&!e.errorNetwork?e.sortList.children&&e.sortList.children.length:null,i=e.pageShow&&!e.errorNetwork?0==e.goodList.length&&e.loaded:null;e.$mp.data=Object.assign({},{$root:{s0:n,g0:o,g1:i}})},i=[]},ad50:function(e,t,n){"use strict";n.r(t);var o=n("107d"),i=n("d580");for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);n("da01");var s=n("828b"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"0632b69b",null,!1,o["a"],void 0);t["default"]=r.exports},b1dde:function(e,t,n){"use strict";var o=n("1210"),i=n.n(o);i.a},d580:function(e,t,n){"use strict";n.r(t);var o=n("426e"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=i.a},da01:function(e,t,n){"use strict";var o=n("fe6f"),i=n.n(o);i.a},fe6f:function(e,t,n){}},[["94a5","common/runtime","common/vendor"]]]);