(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-nongKe-supply_chain-shopping_trolley"],{"1c91":function(t,i,e){"use strict";e.d(i,"b",(function(){return o})),e.d(i,"c",(function(){return a})),e.d(i,"a",(function(){}));var o=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("v-uni-view",{style:t.viewColor},[e("v-uni-view",{staticClass:"shoppingCart",class:t.newData.status&&t.newData.status.status?"showFoot":""},[e("v-uni-view",{staticClass:"labelNav acea-row row-around row-middle"},[e("v-uni-view",{staticClass:"item"},[e("v-uni-text",{staticClass:"iconfont icon-xuanzhong"}),t._v("100%正品保证")],1),e("v-uni-view",{staticClass:"item"},[e("v-uni-text",{staticClass:"iconfont icon-xuanzhong"}),t._v("所有商品精挑细选")],1),e("v-uni-view",{staticClass:"item"},[e("v-uni-text",{staticClass:"iconfont icon-xuanzhong"}),t._v("售后无忧")],1)],1),e("v-uni-view",{staticClass:"nav acea-row row-between-wrapper"},[e("v-uni-view",[t._v("购物数量"),e("v-uni-text",{staticClass:"num t-color"},[t._v(t._s(t.cartTotalCount))])],1),t.cartList.valid.length>0||t.cartList.invalid.length>0?e("v-uni-view",{staticClass:"administrate acea-row row-center-wrapper",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.manage.apply(void 0,arguments)}}},[t._v(t._s(t.footerswitch?"管理":"取消"))]):t._e()],1),t.cartList.valid.length>0||t.cartList.invalid.length>0?e("v-uni-view",[e("v-uni-view",{staticClass:"list"},[t._l(t.cartList.valid,(function(i,o){return[e("v-uni-view",{key:o+"_0",staticClass:"item acea-row row-between-wrapper"},[e("v-uni-view",{staticClass:"store-title"},[e("v-uni-view",{staticClass:"checkbox",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.storeAllCheck(i,o)}}},[i.allCheck?e("v-uni-text",{staticClass:"iconfont icon-xuanzhong1"}):e("v-uni-text",{staticClass:"iconfont icon-weixuanzhong"})],1),e("v-uni-navigator",{staticClass:"info",attrs:{url:0==t.hide_mer_status?"/pages/store/home/index?id="+i.mer_id:"#"}},[e("v-uni-text",{staticClass:"iconfont icon-shangjiadingdan"}),e("v-uni-view",{staticClass:"name"},[t._v(t._s(i.mer_name))]),e("v-uni-text",{staticClass:"iconfont icon-xiangyou"})],1),i.hasCoupon>0?e("v-uni-view",{staticClass:"coupon-btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.giveCoupon(i)}}},[t._v("优惠券")]):t._e()],1),t._l(i.list,(function(i){return e("v-uni-navigator",{key:i.cart_id,staticClass:"picTxt acea-row",attrs:{url:"","hover-class":"none"}},[e("v-uni-view",{staticClass:"checkbox",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.goodsCheck(i,o)}}},[i.check?e("v-uni-text",{staticClass:"iconfont icon-xuanzhong1"}):e("v-uni-text",{staticClass:"iconfont icon-weixuanzhong"})],1),e("v-uni-view",{staticClass:"pictrue"},[e("v-uni-image",{attrs:{src:i.productAttr&&i.productAttr.image||i.product.image}})],1),e("v-uni-view",{staticClass:"text"},[e("v-uni-view",{staticClass:"line1"},[t._v(t._s(i.product.store_name))]),i.productAttr.sku?e("v-uni-view",{staticClass:"infor line1",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.changeCart(i,i.cart_id)}}},[t._v(t._s(i.productAttr.sku)),e("v-uni-text",{staticClass:"iconfont icon-xiala1"})],1):t._e(),i.product.once_max_count>0&&i.product.once_min_count>0?e("v-uni-view",{staticClass:"buy_limit"},[i.product.once_min_count>0?e("v-uni-text",[t._v(t._s(i.product.once_min_count)+"件起购,")]):t._e(),i.product.once_max_count>0?e("v-uni-text",[t._v("最多"+t._s(i.product.once_max_count)+"件")]):t._e()],1):t._e(),e("v-uni-view",{staticClass:"money acea-row row-middle"},[e("v-uni-text",[t._v("¥"+t._s(i.productAttr.price))]),i.productAttr.show_svip_price?e("v-uni-view",{staticClass:"vipImg"},[e("v-uni-image",{attrs:{src:"/static/images/svip.png"}})],1):t._e()],1)],1),e("v-uni-view",{staticClass:"carnum acea-row row-center-wrapper"},[e("v-uni-view",{staticClass:"reduce",class:i.numSub?"on":"",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.subCart(i)}}},[t._v("-")]),e("v-uni-view",{staticClass:"num"},[t._v(t._s(i.cart_num))]),e("v-uni-view",{staticClass:"plus",class:i.numAdd?"on":"",on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.addCart(i)}}},[t._v("+")])],1)],1)}))],2)]}))],2),t.cartList.invalid.length>0?e("v-uni-view",{staticClass:"invalidGoods"},[e("v-uni-view",{staticClass:"goodsNav acea-row row-between-wrapper"},[e("v-uni-view",{on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.goodsOpen.apply(void 0,arguments)}}},[e("v-uni-text",{staticClass:"iconfont",class:1==t.goodsHidden?"icon-xiangxia":"icon-xiangshang"}),t._v("失效商品")],1),e("v-uni-view",{staticClass:"del",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.unsetCart.apply(void 0,arguments)}}},[e("v-uni-text",{staticClass:"iconfont icon-shanchu1"}),t._v("清空")],1)],1),e("v-uni-view",{staticClass:"goodsList",attrs:{hidden:t.goodsHidden}},[t._l(t.cartList.invalid,(function(i,o){return[e("v-uni-navigator",{key:o+"_0",staticClass:"item acea-row row-between-wrapper",attrs:{url:"/pages/goods_details/index?id="+i.product_id,"hover-class":"none"}},[e("v-uni-view",{staticClass:"invalid"},[t._v("失效")]),e("v-uni-view",{staticClass:"pictrue"},[e("v-uni-image",{attrs:{src:i.productAttr&&i.productAttr.image||i.product.image}})],1),e("v-uni-view",{staticClass:"text acea-row row-column-between"},[e("v-uni-view",{staticClass:"line1 name"},[t._v(t._s(i.product.store_name))]),e("v-uni-view",{staticClass:"acea-row row-between-wrapper"},[e("v-uni-view",{staticClass:"end"},[t._v("该商品已失效")])],1)],1)],1)]}))],2)],1):t._e()],1):t._e(),t.recommend?e("v-uni-view",{staticClass:"noCart",style:{marginTop:0==t.cartList.invalid.length&&0==t.cartList.invalid.length?"170rpx":""}},[e("v-uni-view",{staticClass:"pictrue"},[e("v-uni-image",{attrs:{src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/noCart.png"}}),e("v-uni-view",[t._v("暂无商品,去添加点什么吧")])],1)],1):t._e(),t.cartList.valid.length>0?e("v-uni-view",{staticClass:"footer acea-row row-between-wrapper",class:t.isFooter?"":"on"},[e("v-uni-view",[e("v-uni-view",{staticClass:"allcheckbox",on:{click:function(i){i.stopPropagation(),arguments[0]=i=t.$handleEvent(i),t.checkboxAllChange.apply(void 0,arguments)}}},[t.isAllSelect?e("v-uni-text",{staticClass:"iconfont icon-xuanzhong1"}):e("v-uni-text",{staticClass:"iconfont icon-weixuanzhong"}),t._v("全选 ("+t._s(t.cartCount)+")")],1)],1),1==t.footerswitch?e("v-uni-view",{staticClass:"money acea-row row-middle settlement"},[e("v-uni-text",{staticClass:"t-color"},[t._v("¥"+t._s(t.selectCountPrice))]),e("v-uni-form",{attrs:{"report-submit":"true"},on:{submit:function(i){arguments[0]=i=t.$handleEvent(i),t.subOrder.apply(void 0,arguments)}}},[e("v-uni-button",{staticClass:"placeOrder",attrs:{formType:"submit"}},[t._v("去结算")])],1)],1):e("v-uni-view",{staticClass:"button acea-row row-middle"},[e("v-uni-form",{attrs:{"report-submit":"true"},on:{submit:function(i){arguments[0]=i=t.$handleEvent(i),t.subCollect.apply(void 0,arguments)}}},[e("v-uni-button",{staticClass:"bnt bt-color",attrs:{formType:"submit"}},[t._v("收藏")])],1),e("v-uni-form",{attrs:{"report-submit":"true"},on:{submit:function(i){arguments[0]=i=t.$handleEvent(i),t.subDel.apply(void 0,arguments)}}},[e("v-uni-button",{staticClass:"bnt",attrs:{formType:"submit"}},[t._v("删除")])],1)],1)],1):t._e()],1),t.coupon.coupon?[e("couponListWindow",{attrs:{coupon:t.coupon},on:{ChangCouponsClone:function(i){arguments[0]=i=t.$handleEvent(i),t.ChangCouponsClone.apply(void 0,arguments)},ChangCouponsUseState:function(i){arguments[0]=i=t.$handleEvent(i),t.ChangCouponsUseState.apply(void 0,arguments)}}})]:t._e(),e("addcartWindow",{attrs:{attr:t.attr,isShow:1,iSplus:1,destri:1,id:"product-window"},on:{myevent:function(i){arguments[0]=i=t.$handleEvent(i),t.onMyEvent.apply(void 0,arguments)},ChangeAttr:function(i){arguments[0]=i=t.$handleEvent(i),t.ChangeAttr.apply(void 0,arguments)},goCat:function(i){arguments[0]=i=t.$handleEvent(i),t.goCat.apply(void 0,arguments)},attrVal:function(i){arguments[0]=i=t.$handleEvent(i),t.attrVal.apply(void 0,arguments)}}}),e("authorize",{attrs:{isAuto:t.isAuto,isShowAuth:t.isShowAuth},on:{authColse:function(i){arguments[0]=i=t.$handleEvent(i),t.authColse.apply(void 0,arguments)},onLoadFun:function(i){arguments[0]=i=t.$handleEvent(i),t.onLoadFun.apply(void 0,arguments)}}}),t.newData.status&&t.newData.status.status?e("v-uni-view",{staticClass:"foot"},[e("v-uni-view",{staticClass:"page-footer",style:{"background-color":t.newData.bgColor.color[0].item},attrs:{id:"target"}},t._l(t.newData.menuList,(function(i,o){return e("v-uni-view",{key:o,staticClass:"foot-item",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goRouter(i)}}},[i.link==t.activeRouter?[e("v-uni-image",{attrs:{src:i.imgList[0]}}),e("v-uni-view",{staticClass:"txt",style:{color:t.newData.activeTxtColor.color[0].item}},[t._v(t._s(i.name))])]:[e("v-uni-image",{attrs:{src:i.imgList[1]}}),e("v-uni-view",{staticClass:"txt",style:{color:t.newData.txtColor.color[0].item}},[t._v(t._s(i.name))])]],2)})),1)],1):t._e()],2)},a=[]},"2be0":function(t,i,e){"use strict";e.r(i);var o=e("583e"),a=e.n(o);for(var n in o)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return o[t]}))}(n);i["default"]=a.a},"4e0d":function(t,i,e){"use strict";e.r(i);var o=e("1c91"),a=e("2be0");for(var n in a)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return a[t]}))}(n);e("db73");var s=e("f0c5"),r=Object(s["a"])(a["default"],o["b"],o["c"],!1,null,"74fb5438",null,!1,o["a"],void 0);i["default"]=r.exports},"583e":function(t,i,e){"use strict";e("7a82");var o=e("4ea4").default;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,e("d3b7"),e("159b"),e("14d9"),e("e9c4"),e("a9e3"),e("4de4"),e("99af"),e("d81d");e("f89e");var a=o(e("17b5")),n=o(e("6dd1")),s=e("736a"),r=e("ece0"),c=e("a126"),u=e("26cb"),l=o(e("fb7b")),d=o(e("104c")),h=e("5315"),p=(getApp(),{props:{image:{type:String,default:""}},components:{recommend:l.default,couponListWindow:a.default,addcartWindow:n.default,authorize:d.default},data:function(){return{loading:!1,loadend:!1,loadTitle:"加载更多",isFooter:!1,cartCount:0,goodsHidden:!0,footerswitch:!0,hostProduct:[],cartList:{valid:[],invalid:[]},isAllSelect:!1,selectValue:[],selectCountPrice:0,isAuto:!1,isShowAuth:!1,hotScroll:!1,hotPage:1,hotLimit:10,coupon:{coupon:!1,list:[]},cartTotalCount:0,recommend:!1,productValue:[],attr:{cartAttr:!1,productAttr:[],productSelect:{}},isOpen:!1,source:"",attrImage:"",isCart:!0,cart_id:"",attrValue:"",uniqueValue:"",newVal:{},goods:{},currSku:"",newData:{},activeRouter:"",type_id:""}},computed:(0,h.configMap)({hide_mer_status:1,recommend_switch:0,navigation:{}},(0,u.mapGetters)(["isLogin","viewColor"])),onReady:function(){},mounted:function(){},onLoad:function(t){},onShow:function(){var t=this,i=getCurrentPages(),e=i[i.length-1].route;this.activeRouter="/"+e,this.getNav(),1==this.isLogin?(this.getCartList(),this.getCartNum(),this.goodsHidden=!0,this.footerswitch=!0,this.isAllSelect=!1,this.selectValue=[],this.isShowAuth=!1,uni.setStorage({key:"invoice_Data",data:{},success:function(){}})):setTimeout((function(){t.isAuto=!0,t.isShowAuth=!0}),300)},methods:{authColse:function(t){this.isShowAuth=t},onLoadFun:function(){this.isShowAuth=!1},goRouter:function(t){var i=getCurrentPages(),e=i[i.length-1].$page.fullPath;t.link!=e&&uni.switchTab({url:t.link,fail:function(i){uni.redirectTo({url:t.link})}})},getNav:function(){this.newData=this.navigation,this.newData.status&&this.newData.status.status?(uni.hideTabBar(),this.isFooter=!0):(uni.showTabBar(),this.isFooter=!1)},subDel:function(t){var i=this,e=this,o=[];if(this.cartList.valid.forEach((function(t){t.list.forEach((function(t){t.check&&o.push(t.cart_id)}))})),0==o.length)return e.$util.Tips({title:"请选择产品"});(0,s.cartDel)({cart_id:o}).then((function(t){return i.getCartList(),i.getCartNum(),e.$util.Tips({title:t.message,icon:"success"})})).catch((function(t){return e.$util.Tips({title:t})}))},subCollect:function(t){var i=this,e=[];if(this.cartList.valid.forEach((function(t){t.list.forEach((function(t){t.check&&e.push(t.product_id)}))})),0==e.length)return i.$util.Tips({title:"请选择产品"});(0,c.collectAll)({type_id:e,type:1}).then((function(t){return i.$util.Tips({title:t.message,icon:"success"})})).catch((function(t){return i.$util.Tips({title:t})}))},onMyEvent:function(){this.$set(this.attr,"cartAttr",!1),this.$set(this,"isOpen",!1)},changeCart:function(t,i){if(this.goods!=t){this.goods=JSON.parse(JSON.stringify(t)),this.currSku=t.productAttr.sku.split(","),this.$set(this.attr,"productAttr",t.attr);var e={};this.attrValue=t.productAttr.sku,this.attrImage=t.product.image,t.attrValue.forEach((function(t){e[t.sku]=t})),this.$set(this,"productValue",e);e[this.attrValue];this.isOpen=this.attr.cartAttr=!0,this.DefaultSelect(t)}else this.isOpen=this.attr.cartAttr=!0},DefaultSelect:function(t){var i=this.attr.productAttr,e=[];if(this.currSku)e=this.currSku;else for(var o in this.productValue)if(this.productValue[o].stock>0){e=this.attr.productAttr.length?o.split(","):[];break}for(var a=0;a0?(this.$set(this.attr.productSelect,"image",i.image?i.image:this.attrImage),this.$set(this.attr.productSelect,"price",i.price),this.$set(this.attr.productSelect,"stock",i.stock),this.$set(this.attr.productSelect,"unique",i.unique),this.$set(this,"uniqueValue",i.unique),this.$set(this.attr.productSelect,"cart_num",1),this.$set(this,"attrValue",t)):(this.$set(this.attr.productSelect,"image",i.image?i.image:this.attrImage),this.$set(this.attr.productSelect,"price",i.price),this.$set(this.attr.productSelect,"stock",0),this.$set(this.attr.productSelect,"unique",""),this.$set(this.attr.productSelect,"cart_num",0),this.$set(this,"attrValue",""))},scanCode:function(){},subOrder:function(t){var i=[];if(this.cartList.valid.forEach((function(t){t.list.forEach((function(t){t.check&&i.push(t.cart_id)}))})),!(i.length>0))return this.$util.Tips({title:"请选择产品"});uni.navigateTo({url:"/pages/users/order_confirm/index?product_type=98&cartId=".concat(i.join(","),"&type_id=12")})},addCart:function(t,i){var e=this,o=this;(0,s.changeCartNum)(t.cart_id,{cart_num:t.cart_num+1}).then((function(i){if(t.cart_num=Number(t.cart_num)+1,t.hasOwnProperty("productAttr")&&t.cart_num>t.productAttr.stock)return t.cart_num=t.productAttr.stock,t.numAdd=!0,void(t.numSub=!1);t.numAdd=!1,t.numSub=!1,e.cartAllCheck("goodsCheck")})).catch((function(t){o.$util.Tips({title:t})}))},goCat:function(){var t=this;(0,s.changeCartNum)(t.goods.cart_id,{cart_num:t.goods.cart_num,product_attr_unique:t.newVal.unique}).then((function(i){if(t.goods.hasOwnProperty("productAttr")&&t.goods.cart_num>t.goods.productAttr.stock)return t.goods.cart_num=t.goods.productAttr.stock,t.goods.numAdd=!0,void(t.goods.numSub=!1);t.goods.numAdd=!1,t.goods.numSub=!1,t.onMyEvent(),t.getCartList(!0),t.isAllSelect=!1})).catch((function(i){t.$util.Tips({title:i})}))},subCart:function(t){var i=this,e=!1;t.cart_num<1&&(e=!0),t.cart_num<=1?(t.cart_num=1,t.numSub=!0,e=!0):0==e&&(0,s.changeCartNum)(t.cart_id,{cart_num:Number(t.cart_num)-1}).then((function(e){t.numSub=!1,t.numAdd=!1,t.cart_num<=1&&(t.numSub=!0),t.cart_num=Number(t.cart_num)-1,i.cartAllCheck("goodsCheck")})).catch((function(t){i.$util.Tips({title:t})}))},getCartNum:function(){var t=this;(0,s.getCartCounts)({product_type:98}).then((function(i){t.cartTotalCount=i.data[0].count||0}))},getCartList:function(t){var i=this;(0,s.getCartList)({product_type:98}).then((function(t){i.type_id=t.data.list[0].type_id,t.data.list.forEach((function(t,i){t.allCheck=!0,t.list.forEach((function(t,i){t.check=!0,1==t.cart_num?t.numSub=!0:t.numSub=!1,t.cart_num==t.productAttr.stock?t.numAdd=!0:t.numAdd=!1}))})),i.cartList.valid=t.data.list,i.cartList.invalid=t.data.fail,0==t.data.list.length&&0==t.data.list.length?(i.recommend=!0,i.hostProduct.length||i.getHostProduct()):i.recommend=!1;i.checkboxAllChange()}))},storeAllCheck:function(t,i){t.allCheck?(t.allCheck=!1,t.list.forEach((function(t,i){t.check=!1}))):(t.allCheck=!0,t.list.forEach((function(t,i){t.check=!0}))),this.cartAllCheck("goodsCheck")},goodsCheck:function(t){t.check=!t.check,this.cartAllCheck("goodsCheck")},cartAllCheck:function(t){var i=this,e=[],o=0,a=0;this.cartList.valid.forEach((function(n,s){if("goodsCheck"==t){var r=n.list.filter((function(t){return 1==t.check}));n.list.length==r.length?(n.allCheck=!0,e.push(n)):n.allCheck=!1}else n.list.forEach((function(t){t.check=i.isAllSelect})),n.allCheck=i.isAllSelect,n.allCheck&&e.push(n);n.list.forEach((function(t){t.check&&(o=i.$util.$h.Add(o,i.$util.$h.Mul(t.productAttr.price,t.cart_num)),a+=t.cart_num)}))})),this.cartCount=a,this.selectCountPrice=o,this.isAllSelect=e.length==this.cartList.valid.length},checkboxAllChange:function(){this.isAllSelect=!this.isAllSelect,this.cartAllCheck("cartCheck")},getHostProduct:function(){var t=this;t.loadend||t.hotScroll||(t.loading=!0,t.loadTitle="加载更多",(0,c.getProductHot)(t.hotPage,t.hotLimit).then((function(i){i.data.list;t.hotPage++,t.hotScroll=i.data.list.length