2026-03-23 14:57:47 +08:00

1 line
17 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"065e":function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,i=(t._self._c,t.popup_show?t.$t("发现新版本"):null),o=t.popup_show&&t.downstatus<1?t.$t("立即升级"):null,n=!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:i,m1:o,m2:n,g0:a,g1:s}})},n=[]},"313b":function(t,e,i){"use strict";var o=i("48c8"),n=i.n(o);n.a},"37b9":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o,n=i("4e53"),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,n.getUpdateInfo)("ios"===this.platform?2:1).then((function(i){if(Array.isArray(i.data))return e.$emit("isNew");var n=t.getStorageSync("app_update_time")||"",a=(new Date).toLocaleDateString();if(n===a||e.getVer){if(n!==a&&e.getVer){if(!i.data.is_force)return}else if(n==a&&!e.getVer&&!i.data.is_force)return}else t.setStorageSync("app_update_time",(new Date).toLocaleDateString());var s=i.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 i=t.split(".",4),o=e.split(".",4),n=0;n<i.length&&n<o.length;n++){var a=i[n],s=parseInt(a),r=o[n],c=parseInt(r);if(c>s||r.length>a.length)return!0;if(c<s)return!1}return o.length>i.length&&0==e.indexOf(t)}}};e.default=a}).call(this,i("df3c")["default"])},"3e38":function(t,e,i){"use strict";i.r(e);var o=i("d83d"),n=i.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(a);e["default"]=n.a},"48c8":function(t,e,i){},"4e44":function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var o=function(){var t=this.$createElement,e=(this._self._c,this.styleConfig.length),i=e?null:this.sortList.children&&this.sortList.children.length,o=e?null:0==this.goodList.length&&this.loaded;this.$mp.data=Object.assign({},{$root:{g0:e,g1:i,g2:o}})},n=[]},"63cc":function(t,e,i){"use strict";i.r(e);var o=i("065e"),n=i("c4f4");for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);i("313b");var s=i("828b"),r=Object(s["a"])(n["default"],o["b"],o["c"],!1,null,"44f416fc",null,!1,o["a"],void 0);e["default"]=r.exports},"72c7":function(t,e,i){"use strict";i.r(e);var o=i("4e44"),n=i("3e38");for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);i("c34d");var s=i("828b"),r=Object(s["a"])(n["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=r.exports},"92c4":function(t,e,i){},9405:function(t,e,i){"use strict";(function(t,e){var o=i("47a9");i("89bd");o(i("3240"));var n=o(i("72c7"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},c34d:function(t,e,i){"use strict";var o=i("92c4"),n=i.n(o);n.a},c4f4:function(t,e,i){"use strict";i.r(e);var o=i("37b9"),n=i.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(a);e["default"]=n.a},d83d:function(t,e,i){"use strict";(function(t,o){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(i("3b2d")),s=n(i("7ca3")),r=n(i("0110")),c=i("b8fd"),d=i("4e53"),u=i("ae0a"),l=i("8f59"),h=i("c28d"),f=i("8ede"),g=i("8633"),p=i("23a8"),m=i("2a20"),v=n(i("d1b4")),w=(n(i("63cc")),i("b089"));function b(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function S(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?b(Object(i),!0).forEach((function(e){(0,s.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):b(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var _=getApp(),y={computed:S({appletStyle:function(){return{top:this.getHeight.menuButtonInfo.bottom+8+"px",right:"10px"}},pageStyle:function(){return{backgroundColor:this.bgColor,backgroundImage:this.bgPic?"url(".concat(this.bgPic,")"):"",minHeight:this.windowHeight+"px"}},pdHeights:function(){var t="".concat(2*this.pdHeight+100,"rpx");return{height:this.isFooter?t:"100rpx"}}},(0,l.mapGetters)(["isLogin","uid","cartNum"])),mixins:[r.default],components:{PageDesign:function(){i.e("subpackage/diyComponents/pageDesign").then(function(){return resolve(i("9d4d"))}.bind(null,i)).catch(i.oe)},Loading:function(){i.e("components/Loading/index").then(function(){return resolve(i("f6e0"))}.bind(null,i)).catch(i.oe)},couponWindow:function(){i.e("components/couponWindow/index").then(function(){return resolve(i("43e9"))}.bind(null,i)).catch(i.oe)},waterfallsFlow:function(){i.e("components/WaterfallsFlow/WaterfallsFlow").then(function(){return resolve(i("b632"))}.bind(null,i)).catch(i.oe)},emptyPage:function(){i.e("components/emptyPage").then(function(){return resolve(i("5c67"))}.bind(null,i)).catch(i.oe)}},data:function(){var t;return t={styleConfig:[],loading:!1,loadend:!1,loadTitle:"下拉加载更多",page:1,limit:this.$config.LIMIT,numConfig:0,code:"",isCouponShow:!1,couponObj:{},couponObjs:{show:!1},shareInfo:{},sortList:"",sortAll:[],goodPage:1,goodList:[],sid:0,curSort:0,sortMpTop:0,loaded:!1},(0,s.default)(t,"loading",!1),(0,s.default)(t,"domOffsetTop",50),(0,s.default)(t,"isFixed",!0),(0,s.default)(t,"site_config",""),(0,s.default)(t,"errorNetwork",!1),(0,s.default)(t,"isHeaderSerch",!1),(0,s.default)(t,"showHomeComb",!1),(0,s.default)(t,"showCateNav",!1),(0,s.default)(t,"homeCombData",{}),(0,s.default)(t,"headerSerchCombData",{}),(0,s.default)(t,"cateNavData",{}),(0,s.default)(t,"footerConfigData",{}),(0,s.default)(t,"bgColor",""),(0,s.default)(t,"bgPic",""),(0,s.default)(t,"bgTabVal",""),(0,s.default)(t,"pageShow",!0),(0,s.default)(t,"windowHeight",0),(0,s.default)(t,"imgHost",m.HTTP_REQUEST_URL),(0,s.default)(t,"isShowAuth",!1),(0,s.default)(t,"isScrolled",!1),(0,s.default)(t,"product_video_status",!1),(0,s.default)(t,"confirm_video_status",!1),(0,s.default)(t,"positionTop",0),(0,s.default)(t,"isFooter",!1),(0,s.default)(t,"pdHeight",0),(0,s.default)(t,"entryData",{store_id:"",latitude:"",longitude:"",select_store_id:""}),(0,s.default)(t,"goodsIndex",[]),(0,s.default)(t,"promotionIndex",[]),(0,s.default)(t,"belongIndex",0),(0,s.default)(t,"isBelongStore",!1),(0,s.default)(t,"getHeight",this.$util.getWXStatusHeight()),(0,s.default)(t,"myApplet",!0),(0,s.default)(t,"configData",v.default.get("BASIC_CONFIG")),(0,s.default)(t,"currentDiyData",{}),(0,s.default)(t,"isPreview",!1),(0,s.default)(t,"themeId",0),t},onLoad:function(e){var i=this,o=this;t.hideTabBar(),o.getOptions(e),this.$nextTick((function(){t.getSystemInfo({success:function(t){o.windowHeight=t.windowHeight}})}));e.state,e.scope;var n=e.theme_id;if(e.scene){var a=this.$util.getUrlParams(decodeURIComponent(e.scene));a.theme_id&&(n=a.theme_id)}if(n)this.themeId=n,this.isPreview=!0,t.setStorageSync("previewThemeId",n),(0,w.applyTheme)(n);else{var s=t.getStorageSync("previewThemeId");s&&(this.themeId=s,this.isPreview=!0)}this.diyData(),this.getTempIds(),(0,d.getShare)().then((function(t){i.shareInfo=t.data})),this.getCopyRight(),this.$eventHub.$on("confirm_video_status",(function(){if(!i.confirm_video_status){i.confirm_video_status=!0;0,t.showModal({content:"当前使用移动网络,是否继续播放视频?",success:function(t){t.confirm&&(i.SET_AUTOPLAY(!0),i.$eventHub.$emit("product_video_observe"))}})}}))},onUnload:function(){t.$off("activeFn")},watch:{isLogin:{deep:!0,handler:function(e,i){var o=(new Date).toLocaleDateString();if(e){try{var n=t.getStorageSync("oldDate")||""}catch(a){}n!=o&&this.getCoupon()}}}},onShow:function(){t.removeStorageSync("form_type_cart"),this.isLogin&&(this.getCoupon(),this.getCartNum()),o.canIUse("checkIsAddedToMyMiniProgram")?this.checkMyApplet():this.myApplet=!0},onPullDownRefresh:function(){this.diyData(),t.stopPullDownRefresh()},methods:S(S({},(0,l.mapMutations)(["SET_AUTOPLAY","SET_NEARBY"])),{},{checkMyApplet:function(){var t=this;o.checkIsAddedToMyMiniProgram({success:function(e){e.added?t.myApplet=!1:t.myApplet=!0},fail:function(){t.myApplet=!0}})},getCartNum:function(){var e=this;(0,h.getCartCounts)().then((function(i){e.$store.commit("indexData/setCartNum",i.data.count+"");var o=i.data.count;o>0?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,c.getCrmebCopyRight)().then((function(e){var i=e.data;t.setStorageSync("wechatStatus",i.wechat_status),i.copyrightContext||i.copyrightImage||(i.copyrightImage="/static/images/support.png"),t.setStorageSync("copyNameInfo",i.copyrightContext),t.setStorageSync("copyImageInfo",i.copyrightImage),t.setStorageSync("MPSiteData",JSON.stringify({site_logo:i.site_logo,site_name:i.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&&(_.globalData.spid=e.spid)}t.spid&&(_.globalData.spid=t.spid)},reconnect:function(){var t=this;this.diyData(),(0,d.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,g.goShopDetail)(e,this.uid).then((function(i){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(e){1==e.dataType.tabVal?t.navigateTo({url:"/pages/goods/goods_list/index?cid=".concat(e.classPage.id,"&title=").concat(e.classPage.name)}):t.navigateTo({url:"/pages/annex/special/index?theme_id=".concat(e.id)})},getProductList:function(t){var e=this;this.curSort=0,this.loaded=!1,this.sortAll.length>0?(this.sortAll.forEach((function(i,o){i.id==t&&(e.$set(e,"sortList",i),e.sid=i.children.length?i.children[0].id:"")})),this.goodList=[],this.goodPage=1,this.$nextTick((function(){""!=e.sortList&&e.getGoodsList()}))):(0,f.getCategoryList)().then((function(i){e.sortAll=i.data,i.data.forEach((function(i,o){i.id==t&&(e.sortList=i,e.sid=i.children.length?i.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,i=t.getStorageSync("oldUser")||0;i||(0,c.getCouponNewUser)().then((function(i){var o=i.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,i=t.getStorageSync("tagDate")||"",o=(new Date).toLocaleDateString();i===o?this.getNewCoupon():(0,c.getCouponV2)().then((function(i){var o=i.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,c.getTempIds)().then((function(t){t.data&&o.setStorageSync(u.SUBSCRIBE_MESSAGE,JSON.stringify(t.data))}))},objToArr:function(t){if(!t||"object"!==(0,a.default)(t))return[];var e=Object.keys(t).sort(),i=e.map((function(e){return t[e]}));return i},setDiyData:function(e){var i=this;if(e){this.currentDiyData=e,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=1,e.title&&t.setNavigationBarTitle({title:e.title});var o=[],n=[],a=[],s=this.objToArr(e.value);s.forEach((function(e,s,r){e&&("pageFoot"==e.name&&(i.footerConfigData=e),"homeComb"!==e.name||e.isHide||(i.showHomeComb=!0,i.homeCombData=e,e.searchConfig&&e.searchConfig.tabVal&&(i.positionTop=t.getWindowInfo().statusBarHeight+43)),"headerSerch"!=e.name||e.isHide||(i.isHeaderSerch=!0,i.headerSerchCombData=e),"tabNav"!=e.name||e.isHide||(i.showCateNav=!0,i.cateNavData=e),"goodList"!=e.name||e.isHide||n.push(s),"promotionList"!=e.name||e.isHide||a.push(s),e.isHide||o.push(e))})),o.sort((function(t,e){return(t.timestamp||0)-(e.timestamp||0)})),this.styleConfig=o,this.goodsIndex=n,this.promotionIndex=a}},exitPreview:function(){t.removeStorageSync("previewThemeId"),this.themeId=0,this.currentDiyData={},this.isPreview=!1,(0,w.applyTheme)(),this.diyData()},getDiyData:function(){var e=this,i={};this.themeId&&(i.theme_id=this.themeId),(0,c.getThemeInfo)("home",i).then((function(i){t.setStorageSync("diyData",JSON.stringify(i.data)),e.setDiyData(i.data)})).catch((function(t){}))},diyData:function(){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,g.goShopDetail)(e,this.$store.state.app.uid).then((function(i){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=y}).call(this,i("df3c")["default"],i("3223")["default"])}},[["9405","common/runtime","common/vendor"]]]);