bztang-admin/addons/yun_shop/static/app/js/chunk-5fdeb447.002aac5e.js

1 line
12 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5fdeb447"],{c0d0:function(t,o,e){"use strict";e.r(o);var a=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"guide"},[e("c-title",{attrs:{text:t.is_retail?"零售":"订货"}}),e("van-search",{staticClass:"search-goods-bar",attrs:{"show-action":"",placeholder:"请输入搜索的内容",shape:"round"},scopedSlots:t._u([{key:"action",fn:function(){return[e("div",{staticClass:"explain-show-button",on:{click:function(o){t.showExplainPopup=!t.showExplainPopup}}},[e("i",{staticClass:"iconfont icon-dingdan1"}),t._v(" 说明 ")])]},proxy:!0}]),model:{value:t.searchGoodsKeyword,callback:function(o){t.searchGoodsKeyword=o},expression:"searchGoodsKeyword"}}),e("img",{directives:[{name:"show",rawName:"v-show",value:t.sets.banner&&!t.is_retail,expression:"sets.banner && !is_retail"}],staticClass:"top-banner",attrs:{src:t.sets.banner}}),e("d-list",{attrs:{loading:t.goodsLoading,finished:t.goodsLoadFinished},on:{load:t.getGoodsList}},[e("ul",{staticClass:"goods-list",on:{click:function(o){return t.viewGoods(o)}}},t._l(t.goodsList,(function(o,a){return e("goods-item",{key:o.id,staticClass:"goods-item",attrs:{isCart:t.isCart,data:o,index:a,show_price:t.show_price,show_price_flag:t.show_price_flag},on:{add:t.addCart,show:t.showGoodDetail,change:t.changeCart}})})),1)]),e("van-popup",{attrs:{round:"",closeable:""},model:{value:t.showExplainPopup,callback:function(o){t.showExplainPopup=o},expression:"showExplainPopup"}},[e("div",{staticClass:"explain-popup-content"},[e("div",{staticClass:"explain-title"},[t._v("说明")]),e("div",{staticClass:"explain-content",domProps:{innerHTML:t._s(t.sets.summary)}})])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isCart,expression:"isCart"}],staticClass:"bottom-fixed-button set-pc-style"},[e("div",{staticClass:"small-price"},[t._v(t._s(t.$i18n.t("money")))]),t._v(" "+t._s(t.cartsTotal)+" "),e("div",{staticClass:"button",on:{click:function(o){return o.stopPropagation(),t.openCartListPopup.apply(null,arguments)}}},[t._v(" 去结算"),e("em",{staticClass:"carts-num"},[t._v(t._s(t.cartsNum))])])]),e("yz-cart-list",{staticClass:"carlist",attrs:{cardata:t.cartList,showDestory:!0},on:{clearCart:t.clearCart,blur:t.changeCarList,plus:t.changeCarList,minus:t.changeCarList},model:{value:t.showCarList,callback:function(o){t.showCarList=o},expression:"showCarList"}},[e("div",{staticClass:"bottom-car set-pc-styleLeft"},[e("div",{staticClass:"car-box"},[e("div",{staticClass:"car-num",on:{click:function(o){o.stopPropagation(),t.showCarList=!1}}},[e("div",{staticClass:"car-num-box"},[e("i",{staticClass:"iconfont icon-all_buycar"}),e("div",{staticClass:"carnum-style"},[t._v(t._s(t.cartsNum))])]),e("div",{staticClass:"small-price"},[t._v(t._s(t.$i18n.t("money")))]),t._v(" "+t._s(t.cartsTotal)+" ")]),e("div",{staticClass:"car-add",on:{click:function(o){return o.stopPropagation(),t.toOrder.apply(null,arguments)}}},[t._v("去结算")])])])]),e("yzGoodsPopup",{attrs:{goodsInfo:t.goodinfo},on:{showgoodspecs:t.showgoodspecs},model:{value:t.showgp,callback:function(o){t.showgp=o},expression:"showgp"}}),e("yz-specs",{attrs:{goodsInfo:t.goodinfo},on:{closeSpecsPopup:t.close_yz_specs_popup},model:{value:t.popupSpecs,callback:function(o){t.popupSpecs=o},expression:"popupSpecs"}})],1)},i=[],s=(e("8a58"),e("e41f")),r=(e("5852"),e("d961")),n=e("2909"),c=(e("e7e5"),e("d399")),d=(e("14d9"),e("a9e3"),e("ac1f"),e("5319"),e("d3b7"),e("159b"),e("6062"),e("3ca3"),e("ddb0"),e("a15b"),e("b0c0"),e("4de4"),e("53986")),l=e("ebc5"),p=e("f6cc"),h=e("25bd"),g=e("94b4"),u={data:function(){return{isCart:!0,showExplainPopup:!1,sets:{summary:"",banner:""},goods:[],goodsLoadPage:1,goodsLoading:!1,goodsLoadFinished:!1,searchGoodsKeyword:"",is_retail:!1,cartList:[],cartsNum:0,activity_gid:0,activity_index:0,showgp:!1,popupSpecs:!1,goodinfo:{},showCarList:!1,cartsTotal:0,show_price:!1,show_price_flag:!1}},activated:function(){this.getGoodsList(),this.$route.params.target&&(this.is_retail=!0,this.isCart=!1),this.show_price_flag="/stock/guide"==this.$route.path},methods:{getGoodsList:function(){var t=this;if(!0!==this.goodsLoading&&!0!==this.goodsLoadFinished){this.goodsLoading=!0;var o={page:this.goodsLoadPage,is_retail:this.is_retail};$http.post("plugin.agency.api.goods.goods-list",o).then((function(o){var e,a=o.data,i=o.result,s=o.msg;0!==i?(t.show_price=a.show_price,(0===a.data.length||a.data.length<a.per_page||a.current_page===a.last_page)&&(t.goodsLoadFinished=!0),t.goodsLoadPage++,t.sets.banner=a.set.banner,t.sets.summary=a.set.summary,(e=t.goods).push.apply(e,Object(n["a"])(a.data)),t.goodsLoading=!1,t.getCartList()):Object(c["a"])(s)}))}},viewGoods:function(t){var o=t.target.dataset,e=o.gid;if(e){var a={fromStock:1};this.is_retail&&(a.is_retail=this.is_retail),this.$router.push(this.fun.getUrl("goods",{id:e},a))}},getCartList:function(){var t=this;$http.get("plugin.agency.api.member-cart.index",{has_retail:this.$route.params.target?1:0},".").then((function(o){1==o.result?(t.cartList=o.data,t.setGoodTotal()):t.$toast(o.msg)})).catch((function(t){}))},setGoodTotal:function(){this.cartsNum=0,this.cartsTotal=0;for(var t=0;t<this.cartList.length;t++){this.cartsNum+=this.cartList[t].total;for(var o=0;o<this.goods.length;o++)if(0==t&&this.goods[o].total&&(this.goods[o].total=0),this.cartList[t].goods_id==this.goods[o].id){var e=0;0==this.cartList[t].option_id?(e=this.cartList[t].total,this.cartsTotal+=this.cartList[t].total*this.cartList[t].goods.price):(e=this.goods[o].total||0,e+=this.cartList[t].total,this.cartsTotal+=this.cartList[t].total*this.cartList[t].goods_option.product_price),this.$set(this.goods[o],"total",e),this.goods[o].card_id=this.cartList[t].id}}},addCart:function(t){if(this.activity_index=t.index,t.isSpecs)return this.goodinfo=this.goodsList[t.index],this.activity_gid=t.id,void(this.popupSpecs=!0);this.addMemberCart({id:t.id,total:"1",index:t.index})},addMemberCart:function(t){var o=this;if(t.id){var e={goods_id:t.id,total:t.total||1,option_id:t.option_id||0};$http.get("plugin.agency.api.member-cart.store",e,".").then((function(e){1==e.result?(o.popupSpecs=!1,o.showgp=!1,o.$toast(e.msg),o.$set(o.goods[t.index],"total",t.total)):o.$toast(e.msg),o.getCartList()})).catch((function(t){}))}},showGoodDetail:function(t,o){},changeCart:function(t){var o=this;if(t.cartId)return 0==Number(t.num)?(this.destroyCart(t.cartId),void this.$set(this.goods[t.index],"total",0)):void $http.get("plugin.agency.api.member-cart.updateNumV2",{id:t.cartId,num:t.num},".").then((function(e){1==e.result&&(o.popupSpecs=!1,o.showgp=!1,t.index&&o.$set(o.goods[t.index],"total",t.num)),o.$toast(e.msg),o.getCartList()})).catch((function(t){}))},destroyCart:function(t){var o=this;$http.get("plugin.agency.api.member-cart.destroy",{ids:t},".").then((function(t){o.$toast(t.msg),o.getCartList()})).catch((function(t){}))},openCartListPopup:function(){this.showCarList=!0},close_yz_specs_popup:function(t,o,e,a){this.popupSpecs=!1,1==e&&this.addMemberCart({id:this.activity_gid,total:o,option_id:t,index:this.activity_index})},toOrder:function(){var t=this,o=[],e=[];this.cartList.forEach((function(t){o.push(t.id)})),e=new Set(o),e=Object(n["a"])(e),this.$nextTick((function(){t.$router.push(t.fun.getUrl("goodsorder",{},{tag:"-1",cart_ids:e.join(","),fromStock:1}))}))},clearCart:function(){var t=this,o=[];this.cartList.forEach((function(t){o.push(t.id)})),$http.get("plugin.agency.api.member-cart.destroy",{ids:o}).then((function(o){1==o.result?(t.goodsLoading=!1,t.goodsLoadFinished=!1,t.goods=[],t.goodsLoadPage=1,t.getGoodsList(),t.showCarList=!1,t.cartsNum=0,t.cartsTotal=0):t.$dialog.alert({message:o.msg})}))},changeCarList:function(t){var o="plus"==t.name?t.total+1:"minus"==t.name?t.total-1:t.total;this.changeCart({cartId:t.id,num:o})}},computed:{goodsList:function(){var t=this;return this.searchGoodsKeyword?this.goods.filter((function(o){return-1!==o.title.indexOf(t.searchGoodsKeyword)})):this.goods}},components:{VanSearch:r["a"],VanPopup:s["a"],GoodsItem:d["a"],DList:g["a"],yzCartList:h["a"],yzGoodsPopup:l["a"],yzSpecs:p["a"]}},f=u,m=(e("c697e"),e("2877")),b=Object(m["a"])(f,a,i,!1,null,"155eee90",null);o["default"]=b.exports},c697e:function(t,o,e){"use strict";e("cf57")},ceb8:function(t,o,e){var a=e("24fb");o=a(!1),o.push([t.i,".explain-show-button[data-v-155eee90]{padding-left:1.0313rem;color:#f14e4e}.van-search__action[data-v-155eee90]:active{background:none}.explain-popup-content[data-v-155eee90]{padding:1.75rem 1.3438rem;width:16.875rem;height:14.6875rem;background:#fff}.explain-title[data-v-155eee90]{font-size:1rem;font-weight:500;color:#161615}.explain-content[data-v-155eee90]{margin-top:1.25rem;line-height:1.1875rem;text-align:left;font-size:.75rem;color:#6e6e6e}.top-banner[data-v-155eee90]{width:100%;height:10.9375rem;-o-object-fit:cover;object-fit:cover}.goods-list[data-v-155eee90]{margin-top:.9375rem;padding:0 .9375rem .9375rem}.goods-item[data-v-155eee90]{margin-bottom:.625rem}.bottom-car[data-v-155eee90]{position:fixed;width:100%;height:4.5rem;left:0;bottom:-1px;background-image:-webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),color-stop(19%,#fff));background-image:-webkit-linear-gradient(top,hsla(0,0%,100%,0),#fff 19%);background-image:linear-gradient(180deg,hsla(0,0%,100%,0),#fff 19%)}.bottom-car[data-v-155eee90],.bottom-car .car-box[data-v-155eee90]{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}.bottom-car .car-box[data-v-155eee90]{border:1px solid #f14e4e;border-radius:1.5rem;height:3rem;line-height:3rem;width:90%;margin:0 auto;overflow:hidden}.bottom-car .car-box .car-num-box[data-v-155eee90]{position:relative;width:3rem;text-align:center}.bottom-car .car-box .car-num-box .carnum-style[data-v-155eee90]{position:absolute;height:1rem;right:0;top:5px;line-height:1rem;background:#f14e4e;border-radius:1rem;color:#fff;padding:0 .25rem;font-size:.75rem}.bottom-car .car-box .car-num[data-v-155eee90]{min-width:50%;text-align:left;color:#f14e4e;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-right:10px;font-size:14px}.bottom-car .car-box .car-num i[data-v-155eee90]{font-size:1.5rem}.bottom-car .car-box .car-num .small-price[data-v-155eee90]{font-size:.75rem}.bottom-car .car-box .car-add[data-v-155eee90]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:center;background-color:#f14e4e;color:#fff}.bottom-car .endstyle[data-v-155eee90]{background:#d8d8d8;border-color:#d8d8d8;color:#fff;text-align:center;font-size:1.25rem;display:block}.carlist .bottom-car[data-v-155eee90]{position:relative}.bottom-fixed-button[data-v-155eee90]{position:fixed;bottom:0;width:100%;height:3.125rem;left:0;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;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;padding:0 1rem;z-index:100;background-color:#fff;-webkit-box-shadow:1px 1px 14px 0 hsla(0,0%,72.2%,.52);box-shadow:1px 1px 14px 0 hsla(0,0%,72.2%,.52)}.bottom-fixed-button .button[data-v-155eee90]{margin-left:.875rem;width:90px;height:32px;line-height:32px;background-color:#f15053;border-radius:16px;font-size:14px;color:#fff;position:relative}.bottom-fixed-button .carts-num[data-v-155eee90]{padding:0 .25rem;min-width:1.25rem;height:1.25rem;line-height:1.25rem;font-size:14px;position:absolute;top:-8px;right:-5px;background-color:#ff5d5c!important;color:#fff;border-radius:.875rem;-webkit-box-shadow:1px 1px 6px #b74444;box-shadow:1px 1px 6px #b74444}",""]),t.exports=o},cf57:function(t,o,e){var a=e("ceb8");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var i=e("499e").default;i("b0c1fa2e",a,!0,{sourceMap:!1,shadowMode:!1})}}]);