(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"00d2":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o,i=n("2e42"),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 t=this.downSize/this.fileSize*100;return t=t?t.toFixed(2):0,{width:t+"%"}},getHeight:function(){var t=0;return this.tabbar&&(t=50),{bottom:t+"px",height:"auto"}}},methods:{update:function(){},getUpdateInfo:function(){var e=this;(0,i.getUpdateInfo)("ios"===this.platform?2:1).then((function(n){if(Array.isArray(n.data))return e.$emit("isNew");var i=t.getStorageSync("app_update_time")||"",a=(new Date).toLocaleDateString();if(i===a||e.getVer){if(i!==a&&e.getVer){if(!n.data.is_force)return}else if(i==a&&!e.getVer&&!n.data.is_force)return}else t.setStorageSync("app_update_time",(new Date).toLocaleDateString());var s=n.data;o.update_info=s,o.update_info.platform&&o.checkUpdate()})).catch((function(t){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 t=plus.downloader.createDownload(o.update_info.url,{method:"get"},(function(t,e){}));t.addEventListener("statechanged",(function(t,e){if(null===e);else if(200==e)switch(o.downstatus=t.state,t.state){case 3:o.downSize=t.downloadedSize,t.totalSize&&(o.fileSize=t.totalSize);break;case 4:o.installWgt(t.filename);break}else plus.nativeUI.closeWaiting(),plus.nativeUI.toast("下载出错"),o.downing=!1,o.downstatus=0})),t.start()},installWgt:function(t){plus.nativeUI.showWaiting("安装更新文件..."),plus.runtime.install(t,{},(function(){plus.nativeUI.closeWaiting(),plus.nativeUI.alert("应用资源下载完成!",(function(){plus.runtime.restart()}))}),(function(t){plus.nativeUI.closeWaiting(),plus.nativeUI.alert("安装更新文件失败["+t.code+"]:"+t.message)}))},compareVersion:function(t,e){if(!t||!e||""==t||""==e)return!1;for(var n=t.split(".",4),o=e.split(".",4),i=0;is||r.length>a.length)return!0;if(cn.length&&0==e.indexOf(t)}}};e.default=a}).call(this,n("df3c")["default"])},"189e":function(t,e,n){},"370c":function(t,e,n){"use strict";n.r(e);var o=n("00d2"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},"3ad6":function(t,e,n){"use strict";(function(t,o){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("7ca3")),s=i(n("0cf0")),r=n("d369"),c=n("2e42"),u=n("3b12"),l=n("8f59"),d=n("1a5b"),f=n("c302"),h=n("7cf0"),p=n("d7f8"),g=n("9ad6"),m=i(n("c13a"));i(n("a3c1"));function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function b(t){for(var e=1;e0?t.setTabBarBadge({index:3,text:o>99?"99+":o+""}):t.hideTabBarRedDot({index:3})})).catch((function(t){return e.$util.Tips({title:t.msg})}))},storeTap:function(e){this.entryData.select_store_id=e,this.entryData.store_id="",t.removeStorageSync("rulesStoreId")},getCopyRight:function(){var e=this;(0,r.getCrmebCopyRight)().then((function(e){var n=e.data;t.setStorageSync("wechatStatus",n.wechat_status),n.copyrightContext||n.copyrightImage||(n.copyrightImage="/static/images/support.png"),t.setStorageSync("copyNameInfo",n.copyrightContext),t.setStorageSync("copyImageInfo",n.copyrightImage),t.setStorageSync("MPSiteData",JSON.stringify({site_logo:n.site_logo,site_name:n.site_name}))})).catch((function(t){return e.$util.Tips({title:t.msg})}))},getOptions:function(t){if(t.scene){var e=this.$util.getUrlParams(decodeURIComponent(t.scene));e.spid&&(w.globalData.spid=e.spid)}t.spid&&(w.globalData.spid=t.spid)},reconnect:function(){var t=this;this.diyData(),(0,c.getShare)().then((function(e){t.shareInfo=e.data}))},goICP:function(e){t.navigateTo({url:"/pages/annex/web_view/index?url=".concat(e)})},bindHeighta:function(t){},bindHeight:function(e){t.hideLoading(),this.domOffsetTop=e.top},goGoodsDetail:function(e){(0,h.goShopDetail)(e,this.uid).then((function(n){t.navigateTo({url:"/pages/goods_details/index?id=".concat(e.id)})}))},changeSort:function(t,e){this.curSort!=e&&(this.curSort=e,this.sid=t.id,this.goodList=[],this.goodPage=1,this.loaded=!1,this.getGoodsList())},bindSortId:function(t){this.styleConfig=[],1==t.type?this.getProductList(t.classPage):(this.sortList=[],this.getMicroPage(t.microPage,!0))},getMicroPage:function(e,n){var o=this,i=this;i.styleConfig=[],t.showLoading({title:"加载中..."}),(0,r.getDiy)(e).then((function(e){t.hideLoading();e.data;var n=i.objToArr(e.data.value);n=n.filter((function(t){return!t.isHide})),n.forEach((function(t,e){["headerSerch","homeComb"].includes(t.name)&&n.splice(e,1)})),o.styleConfig=n})).catch((function(t){return i.$util.Tips({title:t})}))},getProductList:function(t){var e=this;this.curSort=0,this.loaded=!1,this.sortAll.length>0?(this.sortAll.forEach((function(n,o){n.id==t&&(e.$set(e,"sortList",n),e.sid=n.children.length?n.children[0].id:"")})),this.goodList=[],this.goodPage=1,this.$nextTick((function(){""!=e.sortList&&e.getGoodsList()}))):(0,f.getCategoryList)().then((function(n){e.sortAll=n.data,n.data.forEach((function(n,o){n.id==t&&(e.sortList=n,e.sid=n.children.length?n.children[0].id:"")})),e.goodList=[],e.goodPage=1,e.$nextTick((function(){""!=e.sortList&&e.getGoodsList()}))}))},getGoodsList:function(){var t=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(e){t.loading=!1,t.loaded=e.data.length<10,t.goodPage++,t.goodList=t.goodList.concat(e.data)})))},getNewCoupon:function(){var e=this,n=t.getStorageSync("oldUser")||0;n||(0,r.getCouponNewUser)().then((function(n){var o=n.data;o.show?o.list.length&&(e.isCouponShow=!0,e.couponObj=o,t.setStorageSync("oldUser",1)):t.setStorageSync("oldUser",1)}))},getCoupon:function(){var e=this,n=t.getStorageSync("tagDate")||"",o=(new Date).toLocaleDateString();n===o?this.getNewCoupon():(0,r.getCouponV2)().then((function(n){var o=n.data;o.list.length?(e.isCouponShow=!0,e.couponObj=o,t.setStorageSync("tagDate",(new Date).toLocaleDateString())):e.getNewCoupon()}))},couponClose:function(){this.isCouponShow=!1,t.getStorageSync("oldUser")||this.getNewCoupon()},onLoadFun:function(){this.isShowAuth=!1},getTempIds:function(){var t=o.getStorageSync(u.SUBSCRIBE_MESSAGE);t||(0,r.getTempIds)().then((function(t){t.data&&o.setStorageSync(u.SUBSCRIBE_MESSAGE,JSON.stringify(t.data))}))},objToArr:function(t){var e=Object.keys(t).sort(),n=e.map((function(e){return t[e]}));return n},setDiyData:function(e){var n=this;this.errorNetwork=!1,e.is_bg_color&&(this.bgColor=e.color_picker),e.is_bg_pic&&(this.bgPic=e.bg_pic,this.bgTabVal=e.bg_tab_val),this.pageShow=e.is_show,t.setNavigationBarTitle({title:e.title});var o=[],i=[],a=[],s=this.objToArr(e.value);s.forEach((function(e,s,r){"pageFoot"==e.name&&(n.footerConfigData=e),"homeComb"!==e.name||e.isHide||(n.showHomeComb=!0,n.homeCombData=e,e.searchConfig.tabVal&&(n.positionTop=t.getSystemInfoSync().statusBarHeight+43)),"headerSerch"!=e.name||e.isHide||(n.isHeaderSerch=!0,n.headerSerchCombData=e),"tabNav"!=e.name||e.isHide||(n.showCateNav=!0,n.cateNavData=e),"goodList"!=e.name||e.isHide||i.push(s),"promotionList"!=e.name||e.isHide||a.push(s),e.isHide||o.push(e)})),o.sort((function(t,e){return t.timestamp-e.timestamp})),this.styleConfig=o,this.goodsIndex=i,this.promotionIndex=a},getDiyData:function(){var e=this;(0,r.getDiy)(0).then((function(n){t.setStorageSync("diyData",JSON.stringify(n.data)),e.setDiyData(n.data)})).catch((function(t){}))},diyData:function(){var e=this,n=t.getStorageSync("diyData");n?(0,r.getDiyVersion)(0).then((function(o){var i=t.getStorageSync("diyVersion");o.data.version+"0"===i?e.setDiyData(JSON.parse(n)):(t.setStorageSync("diyVersion",o.data.version+"0"),e.getDiyData())})):this.getDiyData()},changeLogin:function(){this.getIsLogin()},getIsLogin:function(){(0,p.toLogin)()},changeBarg:function(e){this.isLogin?t.navigateTo({url:"/pages/activity/goods_bargain_details/index?id=".concat(e.id,"&spid=").concat(this.$store.state.app.uid)}):this.getIsLogin()},goDetail:function(e){(0,h.goShopDetail)(e,this.$store.state.app.uid).then((function(n){t.navigateTo({url:"/pages/goods_details/index?id=".concat(e.id)})}))},newDataStatus:function(t,e){this.isFooter=!!t,this.pdHeight=e}}),onReachBottom:function(){this.goodList.length&&this.getGoodsList()},onPageScroll:function(e){e.scrollTop>20&&(this.myApplet=!1),e.scrollTop>10?this.isScrolled=!0:this.isScrolled=!1,t.$emit("scroll"),t.$emit("onPageScroll",e.scrollTop)},onShareAppMessage:function(){var t=this.uid?this.uid:0;return this.shareInfo.img?{title:this.shareInfo.title,path:"/pages/index/index?spid="+t,imageUrl:this.shareInfo.img,desc:this.shareInfo.synopsis}:{title:this.shareInfo.title,path:"/pages/index/index?spid="+t}},onShareTimeline:function(){return{title:this.shareInfo.title,path:"/pages/index/index",imageUrl:this.shareInfo.img,desc:this.shareInfo.synopsis}}};e.default=S}).call(this,n("df3c")["default"],n("3223")["default"])},6409:function(t,e,n){"use strict";var o=n("919b"),i=n.n(o);i.a},8760:function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("2ea2");o(n("3240"));var i=o(n("e877"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"919b":function(t,e,n){},a3c1:function(t,e,n){"use strict";n.r(e);var o=n("eb3a"),i=n("370c");for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("e410");var s=n("828b"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,"44f416fc",null,!1,o["a"],void 0);e["default"]=r.exports},b6ed:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.pageShow?t.__get_style([t.pageStyle]):null),o=t.pageShow&&!t.errorNetwork&&t.myApplet?t.__get_style([t.appletStyle]):null,i=t.pageShow&&!t.errorNetwork?t.styleConfig.length:null,a=!t.pageShow||t.errorNetwork||i?null:t.sortList.children&&t.sortList.children.length,s=!t.pageShow||t.errorNetwork||i?null:0==t.goodList.length&&t.loaded,r=t.pageShow&&!t.errorNetwork&&t.isFooter?t.__get_style([t.pdHeights]):null,c=t.pageShow?null:t.$t("网络连接断开"),u=t.pageShow?null:t.$t("请检查情况"),l=t.pageShow?null:t.$t("在设置中是否已开启网络权限"),d=t.pageShow?null:t.$t("当前是否处于弱网环境"),f=t.pageShow?null:t.$t("版本是否过低,升级试试吧"),h=t.pageShow?null:t.$t("重新连接");t._isMounted||(t.e0=function(e){t.myApplet=!1}),t.$mp.data=Object.assign({},{$root:{s0:n,s1:o,g0:i,g1:a,g2:s,s2:r,m0:c,m1:u,m2:l,m3:d,m4:f,m5:h}})},i=[]},d348:function(t,e,n){"use strict";n.r(e);var o=n("3ad6"),i=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=i.a},e410:function(t,e,n){"use strict";var o=n("189e"),i=n.n(o);i.a},e877:function(t,e,n){"use strict";n.r(e);var o=n("b6ed"),i=n("d348");for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);n("6409");var s=n("828b"),r=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=r.exports},eb3a:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.popup_show?t.$t("发现新版本"):null),o=t.popup_show&&t.downstatus<1?t.$t("立即升级"):null,i=!t.popup_show||t.downstatus<1?null:t.$t("下载进度"),a=!t.popup_show||t.downstatus<1?null:(t.downSize/1024/1024).toFixed(2),s=!t.popup_show||t.downstatus<1?null:(t.fileSize/1024/1024).toFixed(2);t.$mp.data=Object.assign({},{$root:{m0:n,m1:o,m2:i,g0:a,g1:s}})},i=[]}},[["8760","common/runtime","common/vendor"]]]);