(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-home"],{1115:function(e,t,i){"use strict";i.r(t);var a=i("e619"),n=i.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(o);t["default"]=n.a},3217:function(e,t,i){"use strict";i.r(t);var a=i("dc58"),n=i("1115");for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);i("9a5b");var s=i("828b"),r=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"68ffdc55",null,!1,a["a"],void 0);t["default"]=r.exports},"5c89":function(e,t,i){var a=i("c86c");t=a(!1),t.push([e.i,".segmented-control[data-v-68ffdc55]{display:flex;flex-direction:row;justify-content:center;font-size:%?26?%;border-radius:%?5?%;box-sizing:border-box;margin:0 auto;overflow:hidden}.segmented-control.button[data-v-68ffdc55]{border-radius:%?54?%;box-sizing:border-box}.segmented-control.text[data-v-68ffdc55]{border:0;border-radius:%?0?%}.segmented-control-item[data-v-68ffdc55]{flex:1;text-align:center;line-height:%?54?%;box-sizing:border-box}.segmented-control-item.button[data-v-68ffdc55]{border-left:%?1?% solid}.segmented-control-item.button[data-v-68ffdc55]:first-child{border-radius:%?54?% 0 0 %?54?%}.segmented-control-item.button[data-v-68ffdc55]:last-child{border-radius:0 %?54?% %?54?% 0}.segmented-control-item.text[data-v-68ffdc55]{border-left:0}.segmented-control-item[data-v-68ffdc55]:first-child{border-left-width:0}",""]),e.exports=t},"75bc":function(e,t,i){var a=i("c86c");t=a(!1),t.push([e.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.pages-home .icon-right[data-v-0e2232d4]{font-size:%?24?%}.pages-home .menu-item[data-v-0e2232d4]{width:20%}.pages-home .menu-item .menu-img[data-v-0e2232d4]{width:%?96?%;height:%?96?%}.pages-home .notice-info[data-v-0e2232d4]{height:%?110?%}.pages-home .notice-info .notice-img[data-v-0e2232d4]{width:%?128?%;height:%?48?%}.pages-home .notice-info .infomation-left[data-v-0e2232d4]{height:%?48?%;border-right:.03125rem solid #e1e6ec}.pages-home .notice-info .roller-box[data-v-0e2232d4]{height:%?40?%}.pages-home .notice-info .roller-box .roller-item[data-v-0e2232d4]{height:%?40?%;line-height:1}.pages-home .weather-info[data-v-0e2232d4]{height:%?168?%;background:#fff}.pages-home .weather-info .number[data-v-0e2232d4]{font-size:%?48?%;color:#feb23a}.pages-home .weather-info .weather[data-v-0e2232d4]{color:#feb23a}.pages-home .weather-info .weather-img[data-v-0e2232d4]{width:%?50?%;height:%?50?%}.pages-home .weather-info .about-info[data-v-0e2232d4]{right:%?0?%;width:%?84?%;height:%?84?%;border-radius:%?5000?%;margin-right:%?30?%}.pages-home .weather-info .about-info .about-img[data-v-0e2232d4]{width:%?102?%;height:%?25?%;margin:0 %?8?%}.pages-home .weather-info .about-info .about-right-img[data-v-0e2232d4]{width:%?34?%;height:%?25?%}.pages-home .advertisement-info .coupon-img[data-v-0e2232d4]{width:100%;height:%?180?%}.pages-home .goods-item .cover[data-v-0e2232d4]{width:%?180?%;height:%?170?%}.pages-home .goods-item .add-car-img[data-v-0e2232d4]{width:%?70?%;height:%?70?%}.pages-home .hot-shop-list[data-v-0e2232d4]{white-space:nowrap;width:calc(100% - %?30?%)}.pages-home .hot-shop-list .hot-shop-item[data-v-0e2232d4]{width:%?281?%;height:%?353?%;background:#f9faf9;display:inline-block}.pages-home .hot-shop-list .hot-shop-item .cover[data-v-0e2232d4]{width:%?281?%;height:%?175?%;border-radius:%?15?% %?15?% 0 0}.pages-home .hot-shop-list .hot-shop-item .business-tag[data-v-0e2232d4]{width:%?86?%;height:%?34?%;background:rgba(52,162,99,.1)}.pages-home .home-index-bg[data-v-0e2232d4]{background:#39b54a;height:15.625rem;width:100%;top:0;border-radius:0 0 5% 5%;z-index:-1}.pages-home .welfare-item .cover[data-v-0e2232d4]{width:%?180?%;height:%?160?%}.pages-home .welfare-item .ellipsis[data-v-0e2232d4]{max-width:%?480?%}',""]),e.exports=t},"7ffc":function(e,t,i){"use strict";i.r(t);var a=i("fe14"),n=i.n(a);for(var o in a)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(o);t["default"]=n.a},"9a5b":function(e,t,i){"use strict";var a=i("f430"),n=i.n(a);n.a},"9da9":function(e,t,i){"use strict";i.r(t);var a=i("c989"),n=i("7ffc");for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);i("b162");var s=i("828b"),r=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"0e2232d4",null,!1,a["a"],void 0);t["default"]=r.exports},a1e1:function(e,t,i){var a=i("75bc");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var n=i("967d").default;n("b6f2272c",a,!0,{sourceMap:!1,shadowMode:!1})},b162:function(e,t,i){"use strict";var a=i("a1e1"),n=i.n(a);n.a},c989:function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.isLoad?i("v-uni-view",{staticClass:"pages-home"},[i("uni-nav-bar",{attrs:{fixed:!0,shadow:!1,statusBar:!0,onlyLeft:!0,color:"#fff",backgroundColor:e.scrollTop<20?"":e.primaryColor}},[i("v-uni-view",{staticClass:"flex-y-center",attrs:{slot:"left"},on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.toChooseLocation.apply(void 0,arguments)}},slot:"left"},[i("i",{staticClass:"iconfont icon-dingwei mr-sm"}),i("v-uni-view",{staticClass:" max-400 ellipsis"},[e._v(e._s(e.location.address||e.location.city||(e.location.lat?"未知地点":e.isLoad?"定位失败":"定位中...")))])],1)],1),i("v-uni-view",{style:{height:e.configInfo.navBarHeight+"px"}}),i("v-uni-view",{staticClass:"home-index-bg abs",attrs:{mode:"aspectFill","lazy-load":!0}}),i("v-uni-view",{staticClass:"pt-md pl-md pr-md",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.$util.toCheckLogin({url:"/home/pages/search"})}}},[i("search",{attrs:{padding:0,radius:10,backgroundColor:"rgba(240,240,240,0.2)",searchColor:"rgba(240,240,240,0.2)",frontColor:"#fff",textAlign:"center",placeholder:"请输入商品名称"}})],1),e.detail.banner.rotation.length>0?i("v-uni-view",{staticClass:"mt-lg ml-md mr-md"},[i("banner",{attrs:{list:e.detail.banner.rotation,margin:0,autoplay:!0,borderRadius:25,height:286,indicatorActiveColor:e.primaryColor},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.goBanner.apply(void 0,arguments)}}})],1):e._e(),i("v-uni-view",{staticClass:"notice-info flex-center mt-md pd-md fill-base",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$util.toCheckLogin({url:"/home/pages/welfare?type=2"})}}},[i("v-uni-image",{staticClass:"notice-img",attrs:{mode:"aspectFill","lazy-load":!0,src:"/static/image/home/notice.png"}}),i("v-uni-view",{staticClass:"ml-sm infomation-left"}),i("v-uni-view",{staticClass:"flex-1 ml-md"},[i("v-uni-swiper",{staticClass:"roller-box",attrs:{autoplay:!0,circular:!0,vertical:!0,interval:2e3}},e._l(e.detail.system_list,(function(t,a){return i("v-uni-swiper-item",{key:a},[i("v-uni-view",{staticClass:"roller-item flex-between f-caption c-desc"},[i("v-uni-view",{staticClass:"ellipsis"},[e._v(e._s(t.title))])],1)],1)})),1)],1)],1),e.detail.weather.observe.update_time?i("v-uni-view",{staticClass:"weather-info flex-warp rel pr-md pl-md pb-md f-icontext c-desc",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.goAbout.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"flex-y-baseline"},[i("v-uni-view",{staticClass:"flex-center mr-lg"},[i("v-uni-view",{staticClass:"number"},[e._v(e._s(e.detail.weather.observe.degree)+"°")])],1),i("v-uni-view",{staticClass:"weather"},[e._v(e._s(e.today)+" "+e._s(e.detail.weather.observe.weather))])],1),i("v-uni-view",{staticClass:"flex-warp"},[i("v-uni-view",{staticClass:"mr-lg"},[e._v("温度变化:"+e._s(e.detail.weather.forecast_24h.min_degree+"°~"+e.detail.weather.forecast_24h.max_degree+"°"))]),i("v-uni-view",{staticClass:"mr-lg"},[e._v("风力:"+e._s(e.detail.weather.observe.wind_power)+"级")]),i("v-uni-view",{staticClass:"mr-lg"},[e._v("湿度:"+e._s(e.detail.weather.observe.humidity)+"%")]),i("v-uni-view",[e._v("气压:"+e._s(e.detail.weather.observe.pressure)+"hPa")])],1),i("v-uni-view",{staticClass:"about-info flex-center abs",style:{background:e.primaryColor}},[i("v-uni-image",{staticClass:"weather-img ml-sm mr-md",attrs:{mode:"aspectFill","lazy-load":!0,src:""+e.weather_img+e.time_key+"/"+e.detail.weather.observe.weather_code+".png"}})],1)],1):e._e(),i("v-uni-view",{staticClass:"flex-warp fill-base pb-md"},e._l(e.menuList,(function(t,a){return i("v-uni-view",{key:a,staticClass:"menu-item flex-center flex-column pb-lg",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.toMenu(a)}}},[i("v-uni-image",{staticClass:"menu-img radius",attrs:{mode:"aspectFill","lazy-load":!0,src:"/static/image/home/"+t.img_name+".png"}}),i("v-uni-view",{staticClass:"f-caption c-title mt-sm"},[e._v(e._s(t.title))])],1)})),1),e.detail.coupon_total?i("v-uni-view",{staticClass:"advertisement-info fill-base pr-md pl-md pb-md",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$util.toCheckLogin({url:"/shop/pages/coupon"})}}},[i("v-uni-image",{staticClass:"coupon-img",attrs:{mode:"aspectFill","lazy-load":!0,src:"/static/image/home/xrhb.png"}})],1):e._e(),e.detail.banner.poster.length>0?i("v-uni-view",{staticClass:"advertisement-info fill-base pr-md pl-md pb-md"},[i("banner",{attrs:{list:e.detail.banner.poster,margin:0,autoplay:!0,borderRadius:25,height:285,indicatorActiveColor:e.primaryColor},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.goBanner.apply(void 0,arguments)}}})],1):e._e(),i("v-uni-view",{staticClass:"mt-md pd-lg fill-base"},[i("v-uni-view",{staticClass:"flex-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$util.toCheckLogin({url:"/shop/pages/hot-goods"})}}},[i("v-uni-view",{staticClass:"flex-1 f-paragraph text-bold"},[e._v("热门商品")]),i("v-uni-view",{staticClass:"flex-y-center c-caption f-caption"},[e._v("查看更多"),i("i",{staticClass:"iconfont icon-right"})])],1),e._l(e.detail.hot_goods,(function(t,a){return[i("v-uni-view",{key:a+"_0",staticClass:"goods-item flex-center mt-lg",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.goDetail(1,"hot_goods",a)}}},[i("v-uni-image",{staticClass:"cover radius-16",attrs:{mode:"aspectFill","lazy-load":!0,src:t.cover}}),i("v-uni-view",{staticClass:"flex-1 ml-lg"},[i("v-uni-view",{staticClass:"flex-center"},[i("v-uni-view",{staticClass:"flex-1"},[i("v-uni-view",{staticClass:"f-paragraph c-title mt-sm mb-sm max-400 ellipsis"},[e._v(e._s(t.goods_name))]),i("v-uni-view",{staticClass:"flex-y-baseline f-caption c-warning"},[e._v("¥"),i("v-uni-view",{staticClass:"f-title"},[e._v(e._s(t.show_price))])],1),i("v-uni-view",{staticClass:"f-caption c-caption text-delete"},[e._v("¥"+e._s(t.show_init_price))])],1),i("v-uni-image",{staticClass:"add-car-img",attrs:{"lazy-load":!0,src:"/static/image/shop/add-car.png"}})],1)],1)],1)]}))],2),i("v-uni-view",{staticClass:"mt-md pt-lg pb-lg fill-base"},[i("v-uni-view",{staticClass:"pl-lg pr-lg flex-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$util.toCheckLogin({url:"/shop/pages/choose-store"})}}},[i("v-uni-view",{staticClass:"flex-1 f-paragraph text-bold"},[e._v("热门店铺")]),i("v-uni-view",{staticClass:"flex-y-center c-caption f-caption"},[e._v("查看更多"),i("i",{staticClass:"iconfont icon-right"})])],1),e.detail.store_list.length>0?i("v-uni-scroll-view",{staticClass:"hot-shop-list pt-lg pl-lg",attrs:{"scroll-x":!0,"scroll-with-animation":!0}},[e._l(e.detail.store_list,(function(t,a){return[i("v-uni-view",{key:a+"_0",staticClass:"hot-shop-item mr-lg radius-16",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.goDetail(2,"store_list",a)}}},[i("v-uni-image",{staticClass:"cover box-shadow",attrs:{mode:"aspectFill","lazy-load":!0,src:t.cover}}),i("v-uni-view",{staticClass:"pd-md"},[i("v-uni-view",{staticClass:"flex-between f-caption c-desc"},[i("v-uni-view",{staticClass:"business-tag flex-center radius-4",style:{color:e.primaryColor}},[e._v("营业中")]),i("v-uni-view",{staticClass:"pl-sm ellipsis"},[e._v(e._s(t.distance))])],1),i("v-uni-view",{staticClass:"f-paragraph c-title mt-md ellipsis-2"},[e._v(e._s(t.title))])],1)],1)]}))],2):e._e()],1),i("v-uni-view",{staticClass:"mt-md pd-lg fill-base"},[i("v-uni-view",{staticClass:"flex-center",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.$util.toCheckLogin({url:"/home/pages/welfare"})}}},[i("v-uni-view",{staticClass:"flex-1 f-paragraph text-bold"},[e._v("公益栏目")]),i("v-uni-view",{staticClass:"flex-y-center c-caption f-caption"},[e._v("查看更多"),i("i",{staticClass:"iconfont icon-right"})])],1),e._l(e.detail.welfare_list,(function(t,a){return[i("v-uni-view",{key:a+"_0",staticClass:"welfare-item flex-center mt-lg",on:{click:function(t){t.stopPropagation(),arguments[0]=t=e.$handleEvent(t),e.goDetail(3,"welfare_list",a)}}},[i("v-uni-image",{staticClass:"cover radius-16",attrs:{mode:"aspectFill","lazy-load":!0,src:t.cover}}),i("v-uni-view",{staticClass:"flex-1 ml-lg"},[i("v-uni-view",{staticClass:"f-title c-title mb-md ellipsis"},[e._v(e._s(t.title))]),i("v-uni-view",{staticClass:"f-caption c-caption"},[e._v(e._s(t.create_time_text))])],1)],1)]}))],2),i("v-uni-view",{staticClass:"space-footer"})],1):e._e()},n=[]},dc58:function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){}));var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("v-uni-view",{staticClass:"segmented-control",class:e.styleType,style:e.wrapStyle},e._l(e.values,(function(t,a){return i("v-uni-view",{key:a,staticClass:"segmented-control-item",class:e.styleType,style:a===e.currentIndex?e.activeStyle:e.itemStyle,on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.onClick(a)}}},[e._v(e._s(t.title))])})),1)},n=[]},e619:function(e,t,i){"use strict";i("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("64aa"),i("c223");var a={name:"uni-segmented-control",props:{current:{type:Number,default:0},values:{type:Array,default:function(){return[]}},activeColor:{type:String,default:"#007aff"},styleType:{type:String,default:"button"},haveBorder:{type:Boolean,default:function(){return!1}},lockTap:{type:Boolean,default:function(){return!0}}},data:function(){return{currentIndex:this.current}},watch:{current:function(e){e!==this.currentIndex&&(this.currentIndex=e)}},computed:{wrapStyle:function(){var e="";switch(this.styleType){case"text":e="border:0;";break;default:e=this.haveBorder?"border: 1rpx solid ".concat(this.activeColor,";"):"";break}return e},itemStyle:function(){var e="";switch(this.styleType){case"text":e="color:#000;border-left:0;";break;default:e="color:#222;background:#eddbba;border-color:#fff;";break}return e},activeStyle:function(){var e="";switch(this.styleType){case"text":e="color:".concat(this.activeColor,";border-left:0;border-bottom-style:solid;");break;default:e="color:#fff;border-color:".concat(this.activeColor,";background-color:").concat(this.activeColor);break}return e}},methods:{onClick:function(e){var t=this.lockTap,i=this.currentIndex;console.log(t,i),i===e&&t||(this.currentIndex=e,this.$emit("clickItem",e))}}};t.default=a},f430:function(e,t,i){var a=i("5c89");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);var n=i("967d").default;n("47ba2cea",a,!0,{sourceMap:!1,shadowMode:!1})},fe14:function(e,t,i){"use strict";i("6a54");var a=i("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("bf0f"),i("18f7"),i("de6c"),i("8f71"),i("4626");var n=a(i("9b1b")),o=a(i("5de6")),s=a(i("2634")),r=a(i("2fdc")),l=i("8f59"),c=a(i("3217")),u={components:{uniSegmentedControl:c.default},data:function(){return{scrollTop:0,options:{},weather_img:"https://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/currentweather/",menuList:[{id:1,title:"土地租赁",img_name:"land",url:"/pages/land"},{id:2,title:"农业认养",img_name:"claim",url:"/pages/claim"},{id:3,title:"视频监控",img_name:"monitor",url:"/home/pages/monitor/list"},{id:4,title:"农场商城",img_name:"shop",url:"/pages/shop"},{id:5,title:"会员充值",img_name:"stored",url:"/mine/pages/balance/list"},{id:6,title:"众筹认养",img_name:"collage",url:"/claim/pages/collage/list"},{id:7,title:"限时秒杀",img_name:"seckill",url:"/shop/pages/seckill"},{id:8,title:"积分商城",img_name:"integral",url:"/shop/pages/integral/list"},{id:9,title:"农场签到",img_name:"sign",url:"/shop/pages/sign"},{id:10,title:"积分抽奖",img_name:"luck",url:"/shop/pages/luck"}],isLoad:!1,loading:!1,detail:{},about_us:0,weather:{},store_list:[],today:"",cur_time:"",time_key:"day"}},computed:(0,l.mapState)({primaryColor:function(e){return e.config.configInfo.primaryColor},subColor:function(e){return e.config.configInfo.subColor},configInfo:function(e){return e.config.configInfo},userInfo:function(e){return e.user.userInfo},location:function(e){return e.user.location},loginType:function(e){return e.user.loginType}}),onLoad:function(){var e=this;return(0,r.default)((0,s.default)().mark((function t(){return(0,s.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("====onload"),!e.isLoad){t.next=3;break}return t.abrupt("return");case 3:e.initIndex();case 4:case"end":return t.stop()}}),t)})))()},onShow:function(){var e=this;return(0,r.default)((0,s.default)().mark((function t(){var i,a,n,r,l,c,u,d;return(0,s.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e.$util.DateToUnix(e.$util.formatTime(new Date,"YY-M-D h:m:s")),a=e.$util.DateToUnix(e.$util.formatTime(new Date,"YY-M-D")),n=a+28800-1,r=a+68400+1,e.time_key=i>n&&i0&&void 0!==e[0]&&e[0],t.cur_time=t.$util.formatTime(new Date,"YY-M-D"),t.today=t.$util.formatTime(new Date,"YY年M月D日"),t.configInfo.id&&!a){i.next=7;break}return i.next=6,t.getConfigInfo();case 6:"apple"==t.loginType&&t.updateUserItem({key:"isShowLogin",val:!1});case 7:return i.next=9,t.getLocation();case 9:return a||t.$util.showLoading(),n=t.location,r=n.lat,l=void 0===r?0:r,c=n.lng,u=void 0===c?0:c,i.next=13,Promise.all([t.$api.home.index({lat:l,lng:u}),t.$api.shop.couponList()]);case 13:d=i.sent,f=(0,o.default)(d,2),h=f[0],v=f[1],h.coupon_total=v.total,p=h.weather,g=p.status,m=void 0===g?0:g,w=p.data,200==m&&(b=w.forecast_24h,_=b.filter((function(e){return e.time==t.cur_time})),w.forecast_24h=_.length>0?_[0]:[],h.weather=w),t.detail=h,t.isLoad=!0,t.loading=!1,t.$util.hideAll();case 24:case"end":return i.stop()}}),i)})))()},initRefresh:function(){this.initIndex(!0)},getLocation:function(){var e=this;return(0,r.default)((0,s.default)().mark((function t(){var i,a,n,o;return(0,s.default)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e.location,i.lat){t.next=20;break}if(t.prev=2,a=uni.getStorageSync("cached_location"),n=uni.getStorageSync("location_cache_time"),o=(new Date).getTime(),!(a&&n&&o-n<18e5)){t.next=10;break}i=a,t.next=13;break;case 10:return t.next=12,e.$util.getBmapLocation();case 12:i=t.sent;case 13:e.updateUserItem({key:"location",val:i}),t.next=20;break;case 16:t.prev=16,t.t0=t["catch"](2),console.log("获取位置失败:",t.t0),e.$util.showToast({title:"获取位置失败,使用默认位置"});case 20:case"end":return t.stop()}}),t,null,[[2,16]])})))()},toChooseLocation:function(e){var t=this;return(0,r.default)((0,s.default)().mark((function e(){var i,a,n,r,l,c,u,d,f,h;return(0,s.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$util.checkAuth({type:"userLocation"});case 2:return e.next=4,uni.chooseLocation();case 4:if(i=e.sent,a=(0,o.default)(i,2),n=a[1],n=void 0===n?{}:n,r=n.address,l=void 0===r?"":r,c=n.longitude,u=void 0===c?0:c,d=n.latitude,f=void 0===d?0:d,u){e.next=11;break}return e.abrupt("return");case 11:h={lng:u,lat:f,address:l},t.updateUserItem({key:"location",val:h}),t.initRefresh();case 14:case"end":return e.stop()}}),e)})))()},toMenu:function(e){var t=this.menuList[e],i=t.title,a=t.url,n=["土地租赁","农业认养"].includes(i)?"switchTab":"农场商城"==i?"reLaunch":"navigateTo";this.$util.toCheckLogin({url:a,openType:n})},goBanner:function(e){var t=e.item,i=t.connect_type,a=t.text_id,n=void 0===a?0:a,o=t.img;switch(i){case 1:case 2:case 4:var s={1:"/home/pages/farm/detail?id=".concat(n),2:"/home/pages/article?id=".concat(n,"&type=1"),4:"/shop/pages/store?id=".concat(n)},r=s[i];this.$util.toCheckLogin({url:r});break;case 3:this.$util.previewImage({current:o,urls:[o]});break}},goAbout:function(){this.detail.about_us&&this.$util.toCheckLogin({url:"/home/pages/about"})},goDetail:function(e,t,i){var a=this;return(0,r.default)((0,s.default)().mark((function n(){var o,r;return(0,s.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:o=a.detail[t][i].id,r="",n.t0=e,n.next=1===n.t0?5:2===n.t0?7:3===n.t0?9:11;break;case 5:return r="/shop/pages/detail?id=".concat(o),n.abrupt("break",11);case 7:return r="/shop/pages/store?id=".concat(o),n.abrupt("break",11);case 9:return r="/home/pages/article?id=".concat(o,"&type=2"),n.abrupt("break",11);case 11:a.$util.toCheckLogin({url:r});case 12:case"end":return n.stop()}}),n)})))()}})};t.default=u}}]);