1 line
9.7 KiB
JavaScript
1 line
9.7 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-65bf3eb4"],{"25f0a":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{attrs:{id:"hotel_home"}},[o("c-title",{attrs:{hide:!1,text:"酒店首页"}}),o("div",{attrs:{id:"content"}},[o("div",{staticStyle:{overflow:"hidden",background:"#f8f8f8",height:"12.5rem"}},[o("img",{staticStyle:{width:"100%"},attrs:{src:t.frontendData.thumb},on:{click:function(e){return t.goPagebtn(t.frontendData.url)}}})]),o("div",{staticClass:"position"},[o("div",{staticClass:"search"},[o("ul",{staticClass:"box"},[o("li",{staticClass:"city"},[o("span",{staticClass:"city_cur"},[t._v(t._s(t.location.city))]),o("div",{staticClass:"current",on:{click:function(e){return t.routerGo("1")}}},[o("i",{staticClass:"iconfont icon-location"}),o("span",[t._v("当前位置")])])]),o("li",{staticClass:"nearby",on:{click:t.gotoSearch}},[o("span",[t._v("我的附近")]),o("input",{attrs:{type:"text",placeholder:"搜索关键字/位置/品牌/查找酒店",disabled:""}}),o("i",{staticClass:"fa fa-angle-right"})])]),o("button",{attrs:{type:"button"},on:{click:t.gotoSearch}},[t._v(" 查找酒店 ")])]),o("div",{staticClass:"hotel_list"},[o("div",{staticClass:"hotel"},[t._v("酒店甄选")]),o("ul",{staticClass:"list"},t._l(t.hotelList,(function(e,i){return o("li",{key:i,on:{click:function(o){return t.hotelBtn(e.hotel_id)}}},[o("div",{staticClass:"imgContent"},[o("img",{attrs:{src:e.logourl,alt:""}})]),o("div",{staticClass:"bottom"},[o("div",{staticClass:"left"},[o("div",{staticClass:"name"},[t._v(t._s(e.name))]),o("div",{staticClass:"address"},[t._v(t._s(e.provice)+"."+t._s(e.city))])]),o("div",{staticClass:"right"},[o("div",{staticClass:"distance"},[t._v("距离:"+t._s(e.distance/1e3+"km"))]),o("div",{staticClass:"manfang"},[t._v(t._s(1==e.is_manfang?"满房":"有房"))])])]),o("div",{staticClass:"hotelType"},[t._v(" "+t._s(e.level_name)+" ")])])})),0)])])])],1)},n=[],a=(o("e7e5"),o("d399")),l=(o("ac1f"),o("1276"),o("d3b7"),o("25f0"),o("99af"),o("6968")),s=o("ac0d"),c={mixins:[s["a"]],data:function(){return{location:{},hotelList:[],page:1,isLoadMore:!0,total_page:0,frontendData:""}},activated:function(){var t=this;this.initData(),this.fun.getLocation().then((function(e){t.location=e,t.getList()})).catch((function(t){})),this.getFrontend()},mounted:function(){},methods:{getFrontend:function(){var t=this;$http.get("plugin.hotel-supply.frontend.home.home",{}).then((function(e){1==e.result&&(t.frontendData=e.data)})).catch((function(t){}))},goPagebtn:function(t){t&&(window.location.href=t)},hotelBtn:function(t){this.$router.push(this.fun.getUrl("HotelSupplyHome",{id:t}))},getLocation:function(){var t=this,e=new AMap.Map("iCenter");function o(e){var o=e.position.toString().split(","),i={lat:o[1],lng:o[0]},n=t.fun.isTextEmpty(e.addressComponent.city)?e.addressComponent.province:e.addressComponent.city,a=e.addressComponent.province?e.addressComponent.province:"",l={address:e.formattedAddress,city:n,title:e.formattedAddress,province:a,point:i};t.$store.commit("updateLocation",l),t.$store.commit("setLocation",l),t.location=l,t.getList()}function i(t){Object(a["a"])("定位失败,请手动切换位置")}e.plugin("AMap.Geolocation",(function(){var t=new AMap.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new AMap.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),AMap.event.addListener(t,"complete",o),AMap.event.addListener(t,"error",i)}))},routerGo:function(t){"1"==t&&this.$router.push(this.fun.getUrl("o2oLocation_loc",{},{tag:"hotelSupply"}))},gotoSearch:function(){this.$router.push(this.fun.getUrl("HotelSupplySearch"))},getList:function(){var t=this,e=this.fun.bd_encrypt(this.location.point.lng,this.location.point.lat),o={lng:e.lng,lat:e.lat,search:{city:this.location.city,province:this.location.province},page:this.page};$http.post("plugin.hotel-supply.frontend.home.index",o).then((function(e){1==e.result&&(t.isLoadMore=!0,t.total_page=e.data.last_page,t.total_page||(t.total_page=0),t.hotelList=e.data.data)})).catch((function(t){}))},getMoreData:function(){var t=this;if(t.isLoadMore=!1,!(this.page>=this.total_page)){this.page=this.page+1;var e=this.fun.bd_encrypt(this.location.point.lng,this.location.point.lat),o={lng:e.lng,lat:e.lat,search:{city:this.location.city,province:this.location.province},page:this.page};$http.post("plugin.hotel-supply.frontend.home.index",o).then((function(e){if(1==e.result){if(t.isLoadMore=!0,1!==e.result)return t.page=t.page-1,void(t.isLoadMore=!1);var o=e.data.data;t.hotelList=t.hotelList.concat(o)}})).catch((function(t){}))}},initData:function(){this.hotelList=[],this.isLoadMore=!0,this.page=1,this.total_page=0}},components:{cTitle:l["a"]}},r=c,h=r,d=(o("c397"),o("2877")),m=Object(d["a"])(h,i,n,!1,null,"636a0c7b",null);e["default"]=m.exports},"2a39":function(t,e,o){var i=o("cf1e");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var n=o("499e").default;n("01c9e368",i,!0,{sourceMap:!1,shadowMode:!1})},ac0d:function(t,e,o){"use strict";o.d(e,"a",(function(){return a}));var i=document.documentElement,n=document.body,a={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return i&&i.scrollTop?t=i.scrollTop:n&&(t=n.scrollTop),t},getClientHeight:function(){var t=0;return t=n.clientHeight&&i.clientHeight?Math.min(n.clientHeight,i.clientHeight):Math.max(n.clientHeight,i.clientHeight),t},getScrollHeight:function(){return Math.max(n.scrollHeight,i.scrollHeight)},handleScroll:function(){this.otherScroll();var t=document.documentElement.scrollTop||document.body.scrollTop;this.btnFlag=t>60,this.getScrollTop()+this.getClientHeight()+105>this.getScrollHeight()?(this.isLoadMore&&this.getMoreData(),this.isBottom=!0):this.isBottom=!1},otherScroll:function(){}}}},c397:function(t,e,o){"use strict";o("2a39")},cf1e:function(t,e,o){var i=o("24fb");e=i(!1),e.push([t.i,"#hotel_home #content .position[data-v-636a0c7b]{z-index:10;position:relative;top:-3.125rem}#hotel_home #content .search[data-v-636a0c7b]{width:22.1875rem;margin:0 auto 1rem;border-radius:.375rem;background:#fff;padding:0 .75rem .75rem .75rem}#hotel_home #content .search .box li[data-v-636a0c7b]{height:3.125rem;border-bottom:.0625rem solid #ebebeb;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}#hotel_home #content .search .box .city[data-v-636a0c7b]{position:relative;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}#hotel_home #content .search .box .city .city_cur[data-v-636a0c7b]{font-size:18px;line-height:3.125rem;font-weight:700}#hotel_home #content .search .box .city .current[data-v-636a0c7b]{position:absolute;right:0;padding:.25rem 0}#hotel_home #content .search .box .city .current i[data-v-636a0c7b]{font-size:1.5rem;color:#337ef9;line-height:1.5rem}#hotel_home #content .search .box .city .current span[data-v-636a0c7b]{font-size:12px;color:#337ef9;display:block}#hotel_home #content .search .box .nearby[data-v-636a0c7b]{line-height:3.125rem;position:relative;font-size:16px}#hotel_home #content .search .box .nearby .nearby_b[data-v-636a0c7b]{color:#8c8c8c}#hotel_home #content .search .box .nearby input[data-v-636a0c7b]{width:13.75rem;border:none;margin-left:1.25rem;font-size:16px}#hotel_home #content .search .box .nearby .fa[data-v-636a0c7b]{position:absolute;right:0;font-size:1.125rem;color:#c9c9c9;line-height:3.125rem}#hotel_home #content .search button[data-v-636a0c7b]{margin-top:.75rem;width:100%;height:2.875rem;font-size:18px;color:#fff;background:#f15353;border:none;border-radius:.375rem}#hotel_home #content .hotel_list[data-v-636a0c7b]{width:22.1875rem;margin:0 auto;border-radius:.375rem;background:#fff;padding:0 .75rem .75rem .75rem}#hotel_home #content .hotel_list .hotel[data-v-636a0c7b]{text-align:left;height:2rem;line-height:2rem;font-size:1rem}#hotel_home #content .hotel_list .list[data-v-636a0c7b]{width:100%}#hotel_home #content .hotel_list .list li[data-v-636a0c7b]{border-radius:.4rem;position:relative;margin-bottom:1rem}#hotel_home #content .hotel_list .list li .imgContent[data-v-636a0c7b]{width:100%;height:10rem}#hotel_home #content .hotel_list .list li .imgContent img[data-v-636a0c7b]{height:100%;width:100%}#hotel_home #content .hotel_list .list li .bottom[data-v-636a0c7b]{position:absolute;left:0;bottom:0;right:0;height:3.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;background-color:rgba(0,0,0,.6);color:#fff;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;text-align:left;padding-top:.2rem}#hotel_home #content .hotel_list .list li .bottom .left[data-v-636a0c7b]{padding-left:.8rem}#hotel_home #content .hotel_list .list li .bottom .left .address[data-v-636a0c7b],#hotel_home #content .hotel_list .list li .bottom .left .name[data-v-636a0c7b]{line-height:1.5rem;font-size:.8rem}#hotel_home #content .hotel_list .list li .bottom .right[data-v-636a0c7b]{padding-right:.8rem}#hotel_home #content .hotel_list .list li .bottom .right .distance[data-v-636a0c7b]{line-height:1.5rem;height:1.5rem}#hotel_home #content .hotel_list .list li .bottom .right .manfang[data-v-636a0c7b]{width:4rem;text-align:center;line-height:1.5rem;height:1.5rem;color:#fff;background-color:rgba(255,0,0,.6);border-radius:1rem;margin:0 auto}#hotel_home #content .hotel_list .list li .hotelType[data-v-636a0c7b]{position:absolute;top:.5rem;left:.5rem;padding-left:.5rem;padding-right:.5rem;text-align:center;line-height:1.5rem;height:1.5rem;color:#fff;background-color:rgba(0,0,0,.6);border-radius:1rem}",""]),t.exports=e}}]); |