1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d01c032"],{"5a63":function(t,e,i){"use strict";i("6a90")},"6a90":function(t,e,i){var a=i("7c30");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var o=i("499e").default;o("04919f9d",a,!0,{sourceMap:!1,shadowMode:!1})},"7c30":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,"#add_near[data-v-62e72cc9]{background-color:#fff;height:100vh}#add_near .content .list[data-v-62e72cc9]{margin-top:1rem;padding:0 .7813rem;padding-bottom:4.125rem;background-color:#fff}#add_near .content .list .item[data-v-62e72cc9]{margin-bottom:1rem;padding:1rem;background-color:#fff;-webkit-box-shadow:0 0 .3125rem 0 rgba(0,0,0,.1);box-shadow:0 0 .3125rem 0 rgba(0,0,0,.1)}#add_near .content .list .item[data-v-62e72cc9],#add_near .content .list .item .img[data-v-62e72cc9]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-radius:.3125rem}#add_near .content .list .item .img[data-v-62e72cc9]{width:3.75rem;height:3.8125rem;-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:.75rem}#add_near .content .list .item .img img[data-v-62e72cc9]{width:100%;height:100%}#add_near .content .list .item .info[data-v-62e72cc9]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;text-align:center;margin-left:.5rem;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}#add_near .content .list .item .info .title[data-v-62e72cc9]{font-size:14px;color:#000;text-align:left;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}#add_near .content .list .item .info .bottom[data-v-62e72cc9]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}#add_near .content .list .item .info .bottom .money[data-v-62e72cc9]{font-size:12px;color:#f01414}#add_near .content .search[data-v-62e72cc9]{width:18.75rem;height:2.5rem;background-color:#f2f2f2;margin:0 auto;margin-top:1rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;color:#999;border-radius:1.3rem}#add_near .content .search input[data-v-62e72cc9]{outline:none;border:none;text-indent:1rem;width:100%;height:100%;font-size:12px}#add_near .content .search .icon-sousuo1[data-v-62e72cc9]{margin-right:1rem}#add_near .content .van-dropdown-menu[data-v-62e72cc9]{margin-top:1rem;padding:0 2.7rem}#add_near .content .van-dropdown-menu__item[data-v-62e72cc9]{font-size:14px}#add_near .content .van-hairline--top-bottom[data-v-62e72cc9]{position:static}#add_near .fixed[data-v-62e72cc9]{position:fixed;bottom:0;height:3.125rem;width:100%;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;z-index:999;padding:0 1rem;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.1);box-shadow:0 0 5px 0 rgba(0,0,0,.1);background-color:#fff}#add_near .fixed[data-v-62e72cc9],#add_near .fixed .btn[data-v-62e72cc9]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}#add_near .fixed .btn[data-v-62e72cc9]{width:6.25rem;color:#fff;font-size:18px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;height:2.5rem;background-color:#f53939;border-radius:1.25rem}.pc[data-v-62e72cc9]{width:375px!important}",""]),t.exports=e},ac0d:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var a=document.documentElement,o=document.body,n={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return a&&a.scrollTop?t=a.scrollTop:o&&(t=o.scrollTop),t},getClientHeight:function(){var t=0;return t=o.clientHeight&&a.clientHeight?Math.min(o.clientHeight,a.clientHeight):Math.max(o.clientHeight,a.clientHeight),t},getScrollHeight:function(){return Math.max(o.scrollHeight,a.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(){}}}},e632:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"add_near"}},[i("c-title",{attrs:{hide:!1,text:"添加推荐商品"}}),i("div",{staticClass:"content"},[i("div",{staticClass:"search"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],attrs:{placeholder:"请输入关键字搜索",type:"text"},domProps:{value:t.keyword},on:{input:function(e){e.target.composing||(t.keyword=e.target.value)}}}),i("i",{staticClass:"iconfont icon-sousuo1",on:{click:t.toSearch}})]),t.option1.length>0?i("van-dropdown-menu",{attrs:{"active-color":"#ef2844"}},[t.option1.length>0?i("van-dropdown-item",{attrs:{options:t.option1,title:"一级分类"},on:{change:t.changeCategory},model:{value:t.first,callback:function(e){t.first=e},expression:"first"}}):t._e(),t.option2.length>0?i("van-dropdown-item",{attrs:{options:t.option2,title:"二级分类"},on:{change:t.changeSecond},model:{value:t.second,callback:function(e){t.second=e},expression:"second"}}):t._e()],1):t._e(),i("div",{staticClass:"list"},[i("van-checkbox-group",{attrs:{"checked-color":"#ef2844"},model:{value:t.result,callback:function(e){t.result=e},expression:"result"}},t._l(t.datas,(function(e,a){return i("div",{key:a,staticClass:"item"},[i("van-checkbox",{attrs:{name:e.id}}),i("div",{staticClass:"img"},[i("img",{attrs:{src:e.change_thumb}})]),i("div",{staticClass:"info"},[i("div",{staticClass:"title"},[t._v(t._s(e.title))]),i("div",{staticClass:"bottom"},[i("span",{staticClass:"money"},[t._v(t._s(t.$i18n.t("money"))+t._s(e.price))])])])],1)})),0)],1)],1),i("div",{staticClass:"fixed ",class:[3==t.fun.getPhoneEnv()?"pc":""]},[i("div",[t._v("商品展示数量:"),i("span",{staticStyle:{color:"#ef2844"}},[t._v(t._s(t.show_num))])]),i("div",{staticClass:"btn",on:{click:t.add}},[t._v(" 确定 ")])])],1)},o=[],n=(i("e7e5"),i("d399")),s=(i("14d9"),i("d3b7"),i("159b"),i("b0c0"),i("99af"),i("6968")),r=i("ac0d"),d={mixins:[r["a"]],data:function(){return{show_num:"",keyword:"",arr:[],datas:[],loading:!1,allLoaded:!1,goload:!0,isLoadMore:!0,page:1,total_page:0,result:[],store_id:"",first:"",second:"",option1:[],option2:[]}},activated:function(){this.initData(),this.store_id=this.$route.params.id,this.getNum(),this.getNetData()},methods:{getNum:function(){var t=this,e={store_id:this.store_id};$http.get("plugin.store-cashier.frontend.store.near-by-goods.get-store-goods",e,"获取中").then((function(e){1==e.result?t.show_num=e.data.show_num:t.$dialog.alert({message:e.msg})}),(function(t){}))},toSearch:function(){this.$router.push(this.fun.getUrl("nearSearch",{keyword:this.keyword,store_id:this.store_id}))},initData:function(){this.show_num="",this.arr=[],this.datas=[],this.loading=!1,this.allLoaded=!1,this.goload=!0,this.isLoadMore=!0,this.page=1,this.total_page=0,this.result=[],this.store_id="",this.first="",this.second="",this.option1=[],this.option2=[]},add:function(){var t=this,e={store_id:this.store_id,choose_goods:this.result};$http.post("plugin.nearby-store-goods.frontend.controllers.goods.index",e,"获取中").then((function(e){1==e.result?(Object(n["a"])(e.msg),t.$router.go(-1)):Object(n["a"])(e.msg)}))},changeSecond:function(t){this.result=[],this.page=1;var e=this,i={store_id:this.store_id,page:this.page,category:{parentid:this.first,childid:this.second}};$http.post("plugin.store-cashier.frontend.store.near-by-goods.get-goods-list",i,"获取中").then((function(t){1==t.result?(e.datas=t.data.list.data,e.total_page=t.data.list.last_page,e.total_page||(e.total_page=0)):Object(n["a"])(t.msg)}),(function(t){}))},changeCategory:function(t){var e=this;this.page=1,this.result=[],this.option2=[],this.arr.forEach((function(i,a,o){if(i.id==t){var n=i.childrens;n.forEach((function(t,i,a){var o={};o.text=t.name,o.value=t.id,e.option2.push(o)}))}}));var i=this,a={store_id:this.store_id,page:this.page,category:{parentid:this.first,childid:""}};$http.post("plugin.store-cashier.frontend.store.near-by-goods.get-goods-list",a,"获取中").then((function(t){1==t.result?(i.datas=t.data.list.data,i.total_page=t.data.list.last_page,i.total_page||(i.total_page=0)):Object(n["a"])(t.msg)}),(function(t){}))},getNetData:function(){var t=this,e={store_id:this.store_id,page:this.page};$http.post("plugin.store-cashier.frontend.store.near-by-goods.index",e,"获取中").then((function(e){if(1==e.result)t.arr=e.data.category,t.datas=e.data.goods_data.data,t.total_page=e.data.goods_data.last_page,t.total_page||(t.total_page=0),t.arr.forEach((function(e,i,a){var o={};o.text=e.name,o.value=e.id,t.option1.push(o)}));else{if(e.data.url)return t.$notify(e.msg),window.location.href=e.data.url,0;t.$notify("暂无商品分类,请添加分类")}}),(function(t){}))},getMoreData:function(){var t=this,e="",i={};if(this.page!==this.total_page)return this.page>=this.total_page?(t.loading=!0,void(t.allLoaded=!0)):(this.page=this.page+1,this.first.length<=0?(i={page:this.page,store_id:this.store_id},e="plugin.store-cashier.frontend.store.near-by-goods.index"):(i={page:this.page,store_id:this.store_id,category:{parentid:this.first,childid:this.second}},e="plugin.store-cashier.frontend.store.near-by-goods.get-goods-list"),void $http.post(e,i,"加载中").then((function(e){if(1!==e.result)return t.page=t.page-1,t.loading=!0,t.allLoaded=!0,void(t.isLoadMore=!1);t.loading=!1,t.allLoaded=!1,t.first.length<=0?t.datas=t.datas.concat(e.data.goods_data.data):t.datas=t.datas.concat(e.data.list.data)}),(function(t){})))}},components:{cTitle:s["a"]}},c=d,l=c,h=(i("5a63"),i("2877")),g=Object(h["a"])(l,a,o,!1,null,"62e72cc9",null);e["default"]=g.exports}}]); |