1 line
6.4 KiB
JavaScript
1 line
6.4 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0a5c0fd5"],{"42aa":function(t,o,a){"use strict";a.r(o);var i=function(){var t=this,o=t.$createElement,a=t._self._c||o;return a("div",{staticClass:"U000005-template1",class:t.className,attrs:{id:"location-box-"+this.id}},[a("div",{domProps:{innerHTML:t._s(t.css)}}),1==t.datas.location_style||2==t.datas.location_style?a("div",{staticClass:"location-box"},[a("div",{staticClass:"location-left",on:{click:t.tolocation}},[a("i",{staticClass:"iconfont icon-order_locate"}),a("span",{staticClass:"title"},[t._v(t._s(t.address||"全国"))]),a("i",{staticClass:"iconfont icon-advertise-next"})]),a("div",{directives:[{name:"show",rawName:"v-show",value:1!=t.datas.show_search,expression:"datas.show_search != 1"}],staticClass:"location-right",on:{click:t.tosearch}},[a("i",{staticClass:"iconfont icon-all_search_2"}),a("span",[t._v(t._s(t.datas.search_title))])]),2==t.datas.location_style&&1!=t.datas.show_search?a("div",{staticClass:"location-search",on:{click:t.tosearch}},[t._v("搜索")]):t._e()]):t._e(),3==t.datas.location_style?a("div",{staticClass:"location-box2"},[a("div",{staticClass:"location-whole"},[a("div",{staticClass:"location-left",on:{click:t.tolocation}},[a("span",{staticClass:"title"},[t._v(t._s(t.address||"全国"))]),a("i",{staticClass:"iconfont icon-advertise-next"})]),a("div",{directives:[{name:"show",rawName:"v-show",value:1!=t.datas.show_search,expression:"datas.show_search != 1"}],staticClass:"location-right",on:{click:t.tosearch}},[a("i",{staticClass:"iconfont icon-all_search_2"}),a("span",[t._v(t._s(t.datas.search_title))])])])]):t._e()])},n=[],c=(a("e7e5"),a("d399")),e=(a("99af"),a("e9c4"),function(){var t=this.datas,o=t.preview_color,a=t.border_style,i=t.search_border_radius,n=t.bg_color,c=t.border_color,e=t.font_color,s=t.city_font_color;return"\n .component-".concat(this.id," .location-box, .component-").concat(this.id," .location-box2{\n background-color: ").concat(o.color||"#f8f8f8",";\n background-image: url(").concat(2==o.isColor?o.image:"",");\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n }\n .component-").concat(this.id," .location-box .location-right{\n border-radius: ").concat(i,"px;\n border: solid ").concat(a,"px ").concat(c,";\n background-color: ").concat(n||"#f8f8f8",";\n color: ").concat(e,";\n }\n\n .component-").concat(this.id," .location-search {\n color: ").concat(s,";\n }\n\n .component-").concat(this.id," .location-box .location-left {\n color: ").concat(s,";\n }\n\n .component-").concat(this.id," .location-box2 .location-whole {\n border-radius: ").concat(i,"px;\n border: solid ").concat(a,"px ").concat(c,";\n background-color: ").concat(n||"#f8f8f8",";\n }\n\n .component-").concat(this.id," .location-box2 .location-left {\n color: ").concat(s,";\n border-color: ").concat(s,";\n }\n\n .component-").concat(this.id," .location-box2 .location-right {\n color: ").concat(e,";\n }\n ")}),s={props:["id","datas","styles"],data:function(){return{address:"",city:"",point:{},oldOffsetTop:0,oDiv:{}}},computed:{css:function(){return"<style>"+e.call(this)+"</style>"},className:function(){var t=["component-wrapper","component-".concat(this.id)];return t}},mounted:function(){this.ready()},activated:function(){this.ready()},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},destroyed:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{ready:function(){var t=this;this.$store.commit("setReferer",window.location.href),this.$nextTick((function(){t.oDiv=document.getElementById("location-box-".concat(t.id))})),window.addEventListener("scroll",this.handleScroll),this.fun.getLocation().then((function(o){t.point=o.point,t.address=o.title,t.city=o.city})).catch((function(t){}))},tolocation:function(){this.$router.push(this.fun.getUrl("o2oLocation"))},tosearch:function(){if(this.city){var t=this.datas.search_type||"store";this.$router.push(this.fun.getUrl("o2oSearchMultiple",{city:this.city,point:JSON.stringify(this.point),fromHome:1},{search_type:t}))}else Object(c["a"])("请先选择城市")},handleScroll:function(){if(1==this.datas.is_top_fixed){var t=document.body.scrollTop||document.documentElement.scrollTop;0!=this.oDiv.offsetTop&&(this.oldOffsetTop=this.oDiv.offsetTop),t>this.oDiv.offsetTop&&t>this.oldOffsetTop?3==this.fun.getPhoneEnv()?this.oDiv.style="position:fixed;top:0;width:375px;z-index:10":this.oDiv.style="position:fixed;top:0;width:100%;z-index:10":this.oDiv.style=""}}}},l=s,d=(a("b68d"),a("2877")),r=Object(d["a"])(l,i,n,!1,null,"3f459ca4",null);o["default"]=r.exports},"6c74":function(t,o,a){var i=a("7920");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var n=a("499e").default;n("3916eaac",i,!0,{sourceMap:!1,shadowMode:!1})},7920:function(t,o,a){var i=a("24fb");o=i(!1),o.push([t.i,".component-wrapper[data-v-3f459ca4]{width:100%;text-align:left}.title[data-v-3f459ca4]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-box[data-v-3f459ca4]{height:45px;line-height:45px;padding:0 10px}.location-box[data-v-3f459ca4],.location-box .location-left[data-v-3f459ca4]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.location-box .location-left[data-v-3f459ca4]{width:40%}.location-box .location-right[data-v-3f459ca4]{-webkit-box-flex:0;-webkit-flex:0 0 47%;-ms-flex:0 0 47%;flex:0 0 47%;overflow:hidden;height:25px;line-height:25px;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;padding:0 8px}.location-box .location-search[data-v-3f459ca4]{text-align:center;-webkit-box-flex:0;-webkit-flex:0 0 10%;-ms-flex:0 0 10%;flex:0 0 10%;margin-left:5px}.location-box2[data-v-3f459ca4]{height:45px;line-height:45px;width:100%;padding:8px 10px}.location-box2 .location-whole[data-v-3f459ca4]{padding:5px;height:30px;line-height:20px}.location-box2 .location-left[data-v-3f459ca4],.location-box2 .location-whole[data-v-3f459ca4]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.location-box2 .location-left[data-v-3f459ca4]{width:40%}.location-box2 .location-right[data-v-3f459ca4]{border-left:1px solid #d3d3d3;width:60%;padding-left:10px}",""]),t.exports=o},b68d:function(t,o,a){"use strict";a("6c74")}}]); |