1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8f4ce448"],{"4cc8":function(t,a,o){"use strict";o.r(a);var s=function(){var t=this,a=t.$createElement,o=t._self._c||a;return o("div",{class:t.className},[o("div",{domProps:{innerHTML:t._s(t.css)}}),o("div",[t.datas.get_number?o("div",{attrs:{id:"store"}},[t.datas.tab_list&&t.datas.tab_list.length>0?o("div",{staticClass:"tab_box"},[o("ul",{staticClass:"tab_list"},[o("van-tabs",{attrs:{sticky:t.sticky,background:t.datas.tab_bg_color,"title-active-color":t.datas.tab_active_color,color:t.datas.tab_active_color,"title-inactive-color":t.datas.tab_color,id:"tab"},on:{change:t.onClick},model:{value:t.active,callback:function(a){t.active=a},expression:"active"}},[t.datas.tab_list.indexOf("4")>-1?o("van-tab",{attrs:{title:"附近商家",name:"nearby"}},[o("div",{staticClass:"store-box"},[t.datas.sort_style&&"2"==t.datas.sort_style?o("storeItem02",{attrs:{storeList:t.shopList3,datas:t.datas}}):o("storeItem",{attrs:{storeList:t.shopList3,datas:t.datas}}),t.isLoadMore3?o("div",{staticClass:"loading-box",on:{click:t.getMoreList}},[t._v(" "+t._s(t.$i18n.t("加载更多"))+" ")]):t._e()],1)]):t._e(),t.datas.tab_list.indexOf("1")>-1?o("van-tab",{attrs:{title:"人气商家",name:"popularity_short"}},[o("div",{staticClass:"store-box"},[t.datas.sort_style&&"2"==t.datas.sort_style?o("storeItem02",{attrs:{storeList:t.shopList0,datas:t.datas}}):o("storeItem",{attrs:{storeList:t.shopList0,datas:t.datas}}),t.isLoadMore0?o("div",{staticClass:"loading-box",on:{click:t.getMoreList}},[t._v(" "+t._s(t.$i18n.t("加载更多"))+" ")]):t._e()],1)]):t._e(),t.datas.tab_list.indexOf("2")>-1?o("van-tab",{attrs:{title:"新驻商家",name:"new_short"}},[o("div",{staticClass:"store-box"},[t.datas.sort_style&&"2"==t.datas.sort_style?o("storeItem02",{attrs:{storeList:t.shopList1,datas:t.datas}}):o("storeItem",{attrs:{storeList:t.shopList1,datas:t.datas}}),t.isLoadMore1?o("div",{staticClass:"loading-box",on:{click:t.getMoreList}},[t._v(" "+t._s(t.$i18n.t("加载更多"))+" ")]):t._e()],1)]):t._e(),t.datas.tab_list.indexOf("3")>-1?o("van-tab",{attrs:{title:"优惠商家",name:"preferential_short"}},[o("div",{staticClass:"store-box"},[t.datas.sort_style&&"2"==t.datas.sort_style?o("storeItem02",{attrs:{storeList:t.shopList2,datas:t.datas}}):o("storeItem",{attrs:{storeList:t.shopList2,datas:t.datas}}),t.isLoadMore2?o("div",{staticClass:"loading-box",on:{click:t.getMoreList}},[t._v(" "+t._s(t.$i18n.t("加载更多"))+" ")]):t._e()],1)]):t._e()],1)],1)]):t._e()]):t._e()])])},e=[],i=(o("99af"),o("2c3e"),o("c740"),o("d3b7"),o("159b"),o("a434"),o("a9e3"),o("ac1f"),o("1276"),o("25f0"),o("e9c4"),o("adf7")),n=o.n(i),c=o("20cb"),r=o("b47c"),d=document.documentElement,l=document.body,h=function(){if(this.datas.preview_color){var t=this.datas,a=t.preview_color,o=t.font_size,s=t.font_color,e=t.border_radius,i=t.class_font_size,n=t.class_font_color,c=t.class_bg_color,r=t.class_border_radius,d=t.location_font_size,l=t.location_font_color,h=t.discount_font_size,p=t.discount_title_color,b=t.discount_font_color,_=t.tag_font_size,g=t.tag_font_color,u=t.tag_bg_color,f=t.tag_border_color,m=t.tag_border_radius;return"\n .component-".concat(this.id," .store-list {\n background-color: ").concat(a,";\n }\n\n .component-").concat(this.id," .store-list .right .title{\n font-size: ").concat(o,"px;\n color: ").concat(s,";\n }\n\n .component-").concat(this.id," .store-list .left .image img{\n border-radius: ").concat(e,"px;\n }\n\n .component-").concat(this.id," .store-list .right .distance{\n font-size: ").concat(d,"px;\n color: ").concat(l,";\n }\n\n .component-").concat(this.id," .store-list .category{\n background-color: ").concat(c,";\n border-radius: ").concat(r,"px;\n font-size: ").concat(i,"px;\n color: ").concat(n,";\n }\n\n .component-").concat(this.id," .store-list .discounts .discounts-list{\n font-size: ").concat(h,"px;\n }\n\n .component-").concat(this.id," .store-list .discounts .discounts-list .con{\n color: ").concat(b,";\n }\n\n .component-").concat(this.id," .store-list .discounts-list .type{\n color: ").concat(p,";\n }\n\n .component-").concat(this.id," .store-list .label-list .label-title{\n background-color: ").concat(u,";\n border-radius: ").concat(m,"px;\n border: solid 1px ").concat(f,";\n font-size: ").concat(_,"px;\n color: ").concat(g,";\n }\n\n")}},p={data:function(){return{emptyImage:n.a,active:"nearby",sticky:!1,tab:4,titleName:[{id:"popularity_short",text:"人气商家",url:"plugin.store-cashier.frontend.store.store.get-store-list-rank"},{id:"new_short",text:"新入驻商家",url:"plugin.store-cashier.frontend.store.store.get-store-list-rank"},{id:"preferential_short",text:"优惠商家",url:"plugin.store-cashier.frontend.store.store.get-store-list-rank"},{id:"nearby",text:"附近商家",url:"plugin.store-cashier.frontend.store.store.get-store-list-rank"}],api:"",dataJson:{},point:{},city:"",shopList0:[],isLoadMore0:!1,page0:1,total_page0:0,shopList1:[],isLoadMore1:!1,page1:1,total_page1:0,shopList2:[],isLoadMore2:!1,page2:1,total_page2:0,shopList3:[],isLoadMore3:!1,page3:1,total_page3:0}},props:["id","datas","lastIndex","index","isBottom"],computed:{css:function(){return"<style>"+h.call(this)+"</style>"},className:function(){var t=["component-wrapper","component-".concat(this.id)];return t}},components:{storeItem:c["a"],storeItem02:r["a"]},mounted:function(){var t=this;this.fun.getLocation().then((function(a){t.point=a.point,t.city=a.city,t.address=a.title,t.datas.tab_list.indexOf("4")>-1?t.chooseTab(" ","nearby"):t.datas.tab_list.indexOf("1")>-1?t.chooseTab(" ","popularity_short"):t.datas.tab_list.indexOf("2")>-1?t.chooseTab(" ","new_short"):t.datas.tab_list.indexOf("3")>-1&&t.chooseTab(" ","preferential_short")})).catch((function(a){t.chooseTab(" ","nearby")})),setTimeout((function(){t.sticky=!0}),500)},activated:function(){var t=this;this.fun.getLocation().then((function(a){t.point=a.point,t.city=a.city,t.address=a.title,t.datas.tab_list.indexOf("4")>-1?t.chooseTab(" ","nearby"):t.datas.tab_list.indexOf("1")>-1?t.chooseTab(" ","popularity_short"):t.datas.tab_list.indexOf("2")>-1?t.chooseTab(" ","new_short"):t.datas.tab_list.indexOf("3")>-1&&t.chooseTab(" ","preferential_short")})).catch((function(a){t.chooseTab(" ","nearby")}))},watch:{isBottom:function(t,a){t&&this.lastIndex==this.index&&this["isLoadMore".concat(this.tab)]&&this.getMoreList()}},methods:{onClick:function(t,a){this.chooseTab("",t)},chooseTab:function(t,a){function o(t){return t.id==a}this.tab=this.titleName.findIndex(o),this.api=this.titleName[this.tab].url;var s=this.titleName[this.tab].id;"preferential_short"==s&&(s="1"==this.datas.discount_type?"preferential_short_percentage":"preferential_short"),this["isLoadMore".concat(this.tab)]=!1,this["total_page".concat(this.tab)]=0,this["page".concat(this.tab)]=1;var e=this.fun.bd_encrypt(this.point.lng,this.point.lat),i=[];this.datas.list&&this.datas.list.length>0&&this.datas.list.forEach((function(t){i.push(t.id)})),this.dataJson={lng:e.lng,lat:e.lat,city_name:this.city,page:this["page".concat(this.tab)],sorting:s,is_aggregation:1,category_ids:i},e.lng||(this.dataJson.lng="",this.dataJson.lat=""),this.getList()},getList:function(){var t=this;$http.post(this.api,this.dataJson," ").then((function(a){1===a.result&&(t["shopList".concat(t.tab)]=a.data.data,t["total_page".concat(t.tab)]=a.data.last_page,t["total_page".concat(t.tab)]<=1?t["isLoadMore".concat(t.tab)]=!1:t["isLoadMore".concat(t.tab)]=!0,t["shopList".concat(t.tab)].length>t.datas.get_number&&(t["shopList".concat(t.tab)].splice(t.datas.get_number,t["shopList".concat(t.tab)].length-t.datas.get_number),t["isLoadMore".concat(t.tab)]=!1))}),(function(t){})).catch((function(t){}))},getScrollTop:function(){var t=0;return d&&d.scrollTop?t=d.scrollTop:l&&(t=l.scrollTop),t},getClientHeight:function(){var t=0;return t=l.clientHeight&&d.clientHeight?Math.min(l.clientHeight,d.clientHeight):Math.max(l.clientHeight,d.clientHeight),t},getScrollHeight:function(){return Math.max(l.scrollHeight,d.scrollHeight)},handleScroll:function(){Number(this.getScrollTop()+this.getClientHeight()+5)>=this.getScrollHeight()&&this["isLoadMore".concat(this.tab)]&&this.getMoreList()},getMoreList:function(){var t=this;if(this["isLoadMore".concat(this.tab)]=!1,!(this["page".concat(this.tab)]>=this["total_page".concat(this.tab)])){this["page".concat(this.tab)]=this["page".concat(this.tab)]+1;var a=this.fun.bd_encrypt(this.point.lng,this.point.lat),o=this.titleName[this.tab].id;"preferential_short"==o&&(o="1"==this.datas.discount_type?"preferential_short_percentage":"preferential_short");var s=[];this.datas.list&&this.datas.list.length>0&&this.datas.list.forEach((function(t){s.push(t.id)})),this.dataJson={lng:a.lng,lat:a.lat,city_name:this.city,page:this["page".concat(this.tab)],sorting:o,is_aggregation:1,category_ids:s},a.lng||(this.dataJson.lng="",this.dataJson.lat=""),$http.post(this.api,this.dataJson," ").then((function(a){t["isLoadMore".concat(t.tab)]=!0,1===a.result?(t["shopList".concat(t.tab)]=t["shopList".concat(t.tab)].concat(a.data.data),t["total_page".concat(t.tab)]=a.data.last_page,t["page".concat(t.tab)]>=t["total_page".concat(t.tab)]?t["isLoadMore".concat(t.tab)]=!1:t["isLoadMore".concat(t.tab)]=!0,t["shopList".concat(t.tab)].length>t.datas.get_number&&(t["shopList".concat(t.tab)].splice(t.datas.get_number,t["shopList".concat(t.tab)].length-t.datas.get_number),t["isLoadMore".concat(t.tab)]=!1)):(t["page".concat(t.tab)]=t["page".concat(t.tab)]-1,t["isLoadMore".concat(t.tab)]=!1)}),(function(t){})).catch((function(t){}))}},getLocation:function(){var t=this,a=new AMap.Map("iCenter");function o(a){var o=a.position.toString().split(",");t.point={lat:o[1],lng:o[0]},t.address=a.formattedAddress,t.title=a.formattedAddress,a.addressComponent?t.city=t.fun.isTextEmpty(a.addressComponent.city)?a.addressComponent.province:a.addressComponent.city:t.city="";var s={address:a.formattedAddress,city:t.city,title:a.formattedAddress,point:t.point};t.$store.commit("updateLocation",s),t.$store.commit("setLocation",s),window.localStorage.setItem("myLocation",JSON.stringify(s)),this.datas.tab_list.indexOf("4")>-1?this.chooseTab(" ","nearby"):t.datas.tab_list.indexOf("1")>-1?t.chooseTab(" ","popularity_short"):t.datas.tab_list.indexOf("2")>-1?t.chooseTab(" ","new_short"):t.datas.tab_list.indexOf("3")>-1&&t.chooseTab(" ","preferential_short")}function s(a){t.chooseTab(" ","popularity_short")}a.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});a.addControl(t),t.getCurrentPosition(),AMap.event.addListener(t,"complete",o),AMap.event.addListener(t,"error",s)}))}}},b=p,_=(o("71ca"),o("2877")),g=Object(_["a"])(b,s,e,!1,null,"3a3927de",null);a["default"]=g.exports},"71ca":function(t,a,o){"use strict";o("dccd")},bd9f:function(t,a,o){var s=o("24fb");a=s(!1),a.push([t.i,"*[data-v-3a3927de]{list-style-type:none}.component-wrapper[data-v-3a3927de]{width:100%;text-align:left}#store .scroll[data-v-3a3927de]{overflow-x:scroll}#store .loading-box[data-v-3a3927de]{width:100%;height:50px;line-height:50px;text-align:center}#store .store_deduction_style[data-v-3a3927de]{background:#ff2c29;color:#fff;padding:0 5px;font-size:10px}#store .store_cash_back_style[data-v-3a3927de]{border:1px solid #ff2c29;color:#ff2c29;padding:0 5px;font-size:10px;margin-left:.25rem}",""]),t.exports=a},dccd:function(t,a,o){var s=o("bd9f");s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var e=o("499e").default;e("c807ebf2",s,!0,{sourceMap:!1,shadowMode:!1})}}]); |