1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-25785437"],{"072a":function(t,e,a){var o=a("24fb");e=o(!1),e.push([t.i,'.tab-list[data-v-4edbfafa]{padding:0 .75rem .5rem .75rem;background-color:#fff}.classify-goodsList[data-v-4edbfafa]{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem .75rem 0 .75rem}.brand-main[data-v-4edbfafa]{background-color:#fff;border-radius:.5rem;margin:.75rem .75rem 0 .75rem}.brand-main .brand-title[data-v-4edbfafa]{font-size:1rem;font-weight:700;line-height:1.375rem;color:#333;padding:.75rem}.brand-main .brand-list[data-v-4edbfafa]{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-transition:1s;transition:1s}.brand-main .brand-item[data-v-4edbfafa]{-webkit-box-flex:0;-webkit-flex:0 0 calc(25% - 0.6875rem);-ms-flex:0 0 calc(25% - 0.6875rem);flex:0 0 calc(25% - 0.6875rem);width:2.75rem;margin-bottom:.6875rem;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.brand-main .brand-item[data-v-4edbfafa]:nth-child(4){margin-right:0}.brand-main .brand-item img[data-v-4edbfafa]{width:2.75rem;height:2.75rem;border-radius:.25rem}.brand-main .brand-item .brand-text[data-v-4edbfafa]{font-size:.625rem;line-height:.875rem;padding:.25rem 0 0 0;color:#333}.brand-main .brand-item .brand-wrap[data-v-4edbfafa]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.brand-main .brand-item-more[data-v-4edbfafa]{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;font-size:.75rem;line-height:1.0625rem;color:#999}.brand-list[data-v-4edbfafa]:after{content:"";height:0;width:calc(25% - .6875rem)}.brand-more[data-v-4edbfafa]{text-align:center;font-size:.75rem;line-height:1.0625rem;color:#999;padding:0 0 .75rem 0}.searchBtn[data-v-4edbfafa]{font-size:.75rem;line-height:1.03rem;color:#fff;padding:.25rem 1rem;background:var(--color);border-radius:1.09rem}',""]),t.exports=e},"228d":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{style:{"--color":""+t.background_color}},[a("c-title",{attrs:{hide:!1,text:t.classifyName}}),a("van-sticky",{attrs:{"offset-top":"40"}},[a("van-search",{attrs:{"show-action":"",placeholder:"请输入搜索关键词",shape:"round"},on:{blur:t.searchBlur,focus:t.hidebox},scopedSlots:t._u([{key:"action",fn:function(){return[a("div",{staticClass:"searchBtn",on:{click:t.searchChange}},[t._v("搜索")])]},proxy:!0}]),model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}}),a("div",{staticStyle:{background:"#fff"}},[a("transition",{attrs:{name:"fateOut"},on:{enter:t.fateOutEnter,"after-leave":t.fateOutLeave}},[a("sarchHistory",{directives:[{name:"show",rawName:"v-show",value:t.showHistory,expression:"showHistory"}],ref:"searchHistory",attrs:{isShowDelete:!1,storageName:t.storageName},on:{clickTag:t.serachTag}})],1)],1),a("div",{staticClass:"tab-list"},[t.categorys.length>1?a("van-tabs",{attrs:{"title-active-color":"#E32323","title-inactive-color":"#333333"},on:{change:t.categorysChange},model:{value:t.tabActive,callback:function(e){t.tabActive=e},expression:"tabActive"}},t._l(t.categorys,(function(t,e){return a("block",{key:e},[a("van-tab",{attrs:{title:t.name,name:t.id}})],1)})),1):t._e()],1)],1),t._e(),t.goodsList.length>0?a("div",{staticClass:"classify-goodsList flex-j-sb"},t._l(t.goodsList,(function(e,o){return a("block",{key:e.id},[a("index-goods",{attrs:{goodsItem:e,city:t.query.city}})],1)})),1):a("van-empty",{attrs:{description:"暂无数据"}})],1)},i=[],r=a("2909"),s=(a("a9e3"),a("b64b"),a("14d9"),a("b0c0"),a("99af"),a("6968")),n=a("ac0d"),c=a("c75f"),d=a("69e3"),l={components:{cTitle:s["a"],indexGoods:c["a"],sarchHistory:d["a"]},mixins:[n["a"]],data:function(){return{search:"",tabActive:0,keyword:"",classifyName:"分类",getBrand:[],brandNum:11,goodsList:[],query:{page:1,city:""},totalPage:0,isLoadMore:!0,brandId:"",categorys:[{id:0,name:"全部"}],timer:"",categorysId:"",brandsId:"",locationStatus:!1,storageName:"sachertorte",showHistory:!1,total_page:0,background_color:"#ffc11e"}},activated:function(){var t=this;this.$route.query.id&&(this.tabActive=Number(this.$route.query.id),this.categorysId=Number(this.$route.query.id),this.classifyName=this.$route.query.classifyName),0===this.tabActive&&(this.brandId=0,this.brandsId=this.$route.query.brandId||""),this.query.page=1,this.categorys=[{id:0,name:"全部"}],this.categorysList(),this.query.city=this.$route.query.city,this.fun.getLocation().then((function(e){t.locationStatus=!0,t.query.city||(t.query.city=e.city),t.getBrandsData(),t.goodsByList()})).catch((function(e){t.getBrandsData(),t.goodsByList(),t.locationStatus=!1}))},methods:{serachTag:function(t){this.keyword=t,this.searchChange()},searchBlur:function(){this.showHistory=!1},hidebox:function(){this.searchHistoryList=window.localStorage.getItem(this.storageName)?JSON.parse(window.localStorage.getItem(this.storageName)):[],this.searchHistoryList.length>0&&(this.showHistory=!0)},searchChange:function(){var t=this;this.query.page=1,this.timer&&clearTimeout(this.timer),this.$refs.searchHistory&&this.$refs.searchHistory.appendKeywords(this.keyword),this.timer=setTimeout((function(){t.debounce(t.goodsByList())}),500)},debounce:function(t,e){var a,o;return function(i){var r=this,s=arguments,n=+new Date;a&&n<a+e?(clearTimeout(o),o=setTimeout((function(){a=n,t.apply(r,s)}),e)):(a=n,t.apply(r,s))}},exhibitionOn:function(){this.brandNum=this.getBrand.length},packup:function(){this.brandNum=11},brandClick:function(t){this.brandsId=t,this.query.page=1,this.goodsByList()},categorysChange:function(t,e){this.brandId=t,this.query.page=1,this.categorysId=t,this.tabActive=t,this.goodsByList()},getBrandsData:function(){var t=this,e={city:this.query.city};$http.get("plugin.yz-supply-cake.frontend.goods.goods.getBrand",e,"正在获取").then((function(e){if(1==e.result){var a=e.data;t.getBrand=a}else t.$dialog.alert({message:e.msg})}),(function(t){}))},categorysList:function(){var t=this;$http.get("plugin.yz-supply-cake.frontend.index.index.getCategorys",{},"正在获取").then((function(e){if(1==e.result){var a=e.data,o=a;for(var i in o)t.categorys.push({id:o[i].id,name:o[i].name,thumb:o[i].thumb,thumb_url:o[i].thumb_url});var r=JSON.parse(localStorage.getItem("yz_basic_info"));t.background_color=r.theme_color}else t.$dialog.alert({message:e.msg})}),(function(t){}))},goodsByList:function(){var t=this,e="plugin.yz-supply-cake.frontend.goods.goods.getGoodsList";e+="&page=".concat(this.query.page),e+="&city=".concat(this.query.city),e+="&search[brand_id]=".concat(this.brandsId),e+="&search[category]=".concat(this.categorysId),e+="&search[keyword]=".concat(this.keyword),$http.get(e,{},"正在获取").then((function(e){if(1==e.result){var a=e.data;t.isLoadMore=!0,t.totalPage=a.last_page,t.totalPage||(t.query.page=0),t.goodsList=a.data}else t.page=t.page-1,t.isLoadMore=!1,t.$dialog.alert({message:e.msg})}),(function(t){}))},getMoreData:function(){var t=this;if(this.isLoadMore=!1,!(this.query.page>=this.totalPage)){this.query.page=this.query.page+1;var e="plugin.yz-supply-cake.frontend.goods.goods.getGoodsList";e+="&page=".concat(this.query.page),e+="&city=".concat(this.query.city),e+="&search[brand_id]=".concat(this.brandsId),e+="&search[category]=".concat(this.categorysId),e+="&search[keyword]=".concat(this.keyword),$http.get(e,{},"加载中").then((function(e){if(t.isLoadMore=!0,1===e.result){var a=e.data.data;t.goodsList=[].concat(Object(r["a"])(t.goodsList),Object(r["a"])(a))}else t.query.page=t.query.page-1,t.isLoadMore=!1}),(function(t){}))}}}},h=l,g=h,m=(a("5a7a"),a("2877")),u=Object(m["a"])(g,o,i,!1,null,"4edbfafa",null);e["default"]=u.exports},"248a":function(t,e,a){var o=a("072a");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var i=a("499e").default;i("379aec73",o,!0,{sourceMap:!1,shadowMode:!1})},3979:function(t,e,a){var o=a("24fb");e=o(!1),e.push([t.i,".ell[data-v-67afc964]{text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.goods-item[data-v-67afc964]{width:10.75rem;background-color:#fff;border-radius:.5rem;overflow:hidden;margin-bottom:.5rem}.goods-item img[data-v-67afc964]{max-width:100%;height:10.75rem}.goods-item .goods-details[data-v-67afc964]{padding:0 .75rem 0 .5rem}.goods-item .goods-text[data-v-67afc964]{text-align:left;font-size:.875rem;font-weight:700;line-height:1.25rem;color:#333;padding:0 0 .25rem 0}.goods-item .company-label[data-v-67afc964]{background:rgba(249,38,33,.1);border-radius:.125rem;padding:.125rem .25rem .125rem .25rem;margin:.25rem 0}.goods-item .company-label .icon-info_store[data-v-67afc964]{color:#e3494e;font-size:.875rem;line-height:.875rem}.goods-item .company-label .name[data-v-67afc964]{font-size:.75rem;line-height:1rem;padding:0 0 0 .125rem;color:#e3494e}.goods-price[data-v-67afc964]{text-align:left;padding:.25rem 0 .4375rem 0}.goods-price .price[data-v-67afc964]{font-size:.875rem;font-weight:700;line-height:1.25rem;color:#e32323;padding:0 .25rem 0 0}.goods-price .original-price[data-v-67afc964]{font-size:.75rem;line-height:1rem;color:#999;text-decoration:line-through}",""]),t.exports=e},"5a7a":function(t,e,a){"use strict";a("248a")},"68b7":function(t,e,a){var o=a("3979");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var i=a("499e").default;i("e37cf7c8",o,!0,{sourceMap:!1,shadowMode:!1})},"9ad8":function(t,e,a){"use strict";a("68b7")},ac0d:function(t,e,a){"use strict";a.d(e,"a",(function(){return r}));var o=document.documentElement,i=document.body,r={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return o&&o.scrollTop?t=o.scrollTop:i&&(t=i.scrollTop),t},getClientHeight:function(){var t=0;return t=i.clientHeight&&o.clientHeight?Math.min(i.clientHeight,o.clientHeight):Math.max(i.clientHeight,o.clientHeight),t},getScrollHeight:function(){return Math.max(i.scrollHeight,o.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(){}}}},c75f:function(t,e,a){"use strict";var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"goods-item",on:{click:function(e){return t.goodsNavTo(t.goodsItem.id)}}},[a("img",{attrs:{src:t.goodsItem.thumb}}),a("div",{staticClass:"goods-details"},[a("p",{staticClass:"goods-text ell"},[t._v(t._s(t.goodsItem.title))]),a("div",{staticClass:"flex"},[a("div",{staticClass:"company-label flex-a-c"},[a("span",{staticClass:"iconfont icon-info_store"}),a("span",{staticClass:"name"},[t._v(t._s(t.goodsItem.name||t.goodsItem.brand_name))])])]),a("div",{staticClass:"goods-price"},[t.goodsItem&&t.goodsItem.has_many_options?a("span",{staticClass:"price"},[t._v("¥"+t._s(t.goodsItem&&t.goodsItem.has_many_options[0]&&t.goodsItem.has_many_options[0].product_price))]):t._e(),0!=t.goodsItem.market_price&&t.goodsItem.market_price!=(t.goodsItem&&t.goodsItem.has_many_options[0]&&t.goodsItem.has_many_options[0].product_price)?a("span",{staticClass:"original-price"},[t._v("¥"+t._s(t.goodsItem.market_price))]):t._e()])])])},i=[],r=(a("14d9"),{name:"indexGoods",props:{goodsItem:{type:Object,default:function(){return{}}},city:{type:String}},components:{},data:function(){return{}},mounted:function(){},computed:{},watch:{},methods:{goodsNavTo:function(t){this.$router.push(this.fun.getUrl("sachertorteGoods",{},{id:t,city:this.city}))}}}),s=r,n=(a("9ad8"),a("2877")),c=Object(n["a"])(s,o,i,!1,null,"67afc964",null);e["a"]=c.exports}}]); |