canyin-project/yb_wm/unpackage/dist/build/mp-weixin/components/goods/goods-car.js
2024-11-01 16:07:54 +08:00

11 lines
13 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/goods/goods-car"],{1364:function(t,e,n){"use strict";(function(t){var o=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n("7eb4")),i=o(n("3b2d")),s=o(n("ee10")),a=o(n("7ca3")),c=n("8f59"),u=o(n("2ef8")),l=n("b8f7");function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,a.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h={name:"goods-car",components:{addGoods:function(){n.e("components/goods/add-goods").then(function(){return resolve(n("cc0e"))}.bind(null,n)).catch(n.oe)},mgPopup:function(){n.e("components/common/popup").then(function(){return resolve(n("7fc3"))}.bind(null,n)).catch(n.oe)},sqBtn:function(){n.e("components/common/sq-btn").then(function(){return resolve(n("cd85"))}.bind(null,n)).catch(n.oe)}},props:{type:{type:String,default:"1"},cName:{type:String,default:""},sname:"",carBtm:{type:[String,Number],default:""},carlistPab:{type:[String,Number],default:""},zIndex:{type:Number,default:999},ingopay:{type:String,default:"1"},buytype:{type:Number,default:2},sjxx:{type:Object,default:function(){return{}}},goodsList:{type:Array,default:function(){return[]}},startmoney:{type:[String,Number],default:""},show:Boolean,outin:{type:String,default:"1"},tableinfo:""},data:function(){return{showCar:!1,ydshow:!0,showSqtel:!1}},watch:{showCar:function(t){this.$emit("update:show",t)},show:function(t){t&&(this.showCar=t)},mjInfo:{handler:function(t){t.discount.length>0&&this.$emit("hasmj",!0)},immediate:!0}},mixins:[l.utilMixins],computed:y(y({},(0,c.mapState)({vscarList:function(t){return t.scarList}})),{},{scarList:function(){return 1==this.outin?this.vscarList.out:3==this.outin?this.vscarList.fast:2==this.outin?this.vscarList.ins:void 0},carList:function(){return this.scarList.data||[]},yysj:function(){var t="",e=this.sjxx.moreSet;return console.log("info:",e),1==e.timeType?t="24小时营业":2==e.timeType&&e.timeArr&&(t="".concat(e.timeArr[0].startTime,"-").concat(e.timeArr[0].ciri?"次日":"").concat(e.timeArr[0].endTime),e.timeArr[1]&&(t+=" "+"".concat(e.timeArr[1].startTime,"-").concat(e.timeArr[1].ciri?"次日":"").concat(e.timeArr[1].endTime)),e.timeArr[2]&&(t+=" "+"".concat(e.timeArr[2].startTime,"-").concat(e.timeArr[2].ciri?"次日":"").concat(e.timeArr[2].endTime))),t},cshow:function(){return 0==this.carList.length&&(this.showCar=!1),2==this.type||3==this.type?this.addgb:(1==this.sjxx.shopData.storeOpen||2==this.sjxx.shopData.storeOpen&&1==this.sjxx.moreSet.status)&&this.carList.length>0},addgb:function(){return 1==this.sjxx.shopData.storeOpen||2==this.sjxx.shopData.storeOpen&&1==this.sjxx.moreSet.status},xxshow:function(){return 1!=this.sjxx.shopData.storeOpen&&this.ydshow},havezq:function(){return this.sjxx.moreSet.distributionSupport&&this.sjxx.moreSet.distributionSupport.find((function(t){return 2==t}))},getTotal:function(){var t=0;return this.carList.forEach((function(e){t+=+e.num})),{total:+this.scarList.oldPrice||0,price:+this.scarList.price,spzj:+(this.scarList.oldPrice-this.scarList.boxMoney).toFixed(2),bzf:+this.scarList.boxMoney||0,num:t,hyzk:this.blxs(this.scarList.vipDiscount)}},carPrice:function(){var t=this.mjInfo.mjMoney;return{reduceMoney:t,nowPrice:this.getTotal.price}},mjInfo:function(){var t=this.getTotal.spzj,e=[],n="",o=this.scarList.reduce,r=-1,i="";return this.sjxx.discount.reduce.type?(e=[].concat(this.sjxx.discount.reduce.moneyArr),n=this.sjxx.discount.reduce.type,e.length&&(1==n?i=Math.floor(t/e[0].fullMoney)<=0?"每满".concat(this.sl+e[0].fullMoney,"减").concat(e[0].money):"已减".concat(this.sl+o):(r=e.findIndex((function(e){return t>=e.fullMoney})),-1==r?i="满".concat(this.sl).concat(e[e.length-1].fullMoney,"减").concat(this.sl).concat(e[e.length-1].money,",还差").concat(this.sl).concat((e[e.length-1].fullMoney-t).toFixed(2)):0==r?i="已减".concat(this.sl+o):r>0&&(i="已减".concat(this.sl+o,",再满").concat(this.sl+e[r-1].fullMoney,"减").concat(this.sl+e[r-1].money))))):o=0,1==this.buytype&&+this.startMoney>this.getTotal.total&&(i="还差".concat(this.sl).concat((+this.startMoney-this.getTotal.total).toFixed(2),"起送")),{mjMoney:o,text:i,discount:[].concat(e).reverse()}},startMoney:function(){return this.startmoney||this.sjxx.shopData.distribution.startMoney},qsText:function(){var t=this.getTotal.total,e=+this.startMoney,n="",o=!1;if(this.type<=2||4==this.type)if(t<=0||!this.carList.length)n=1==this.buytype?this.sl+e+"起送":"去下单";else if(t<e&&1==this.buytype){var r=+(e-t).toFixed(2);n="差".concat(this.sl)+r+"起送"}else n="去结算",o=!0;else 3==this.type&&(o=!0,n=t<=0||!this.carList.length?"查看购物车":"选好了");return{text:n,reach:o}}}),methods:y(y(y({},(0,c.mapMutations)(["setCarList"])),(0,c.mapActions)(["clearMycar"])),{},{openCar:function(){console.log("565"),this.showCar=!0},closeCar:function(){this.showCar=!1},qsTextt:function(){return this.qsText},dec:function(t,e){this.$emit("dec",{addwz:t.addwz,g:e})},add:function(t,e){this.$emit("add",{addwz:t.addwz,g:e})},clearCar:function(){var t=this;return(0,s.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.util.modal("确认清空购物车吗?");case 3:return e.next=5,t.clearMycar({storeId:t.sjxx.shopData.id,item:t.outin,key:1==t.outin?"out":2==t.outin?"ins":"fast"});case 5:t.$emit("celar"),t.showCar=!1,e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,null,[[0,9]])})))()},goPay:function(e){var n=this;return(0,s.default)(r.default.mark((function o(){var s;return r.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(console.log("点击结算",n.user),n.qsText.reach){o.next=3;break}return o.abrupt("return");case 3:return o.next=5,n.checkLogin();case 5:if(o.sent){o.next=7;break}return o.abrupt("return");case 7:if(1!=n.ingopay){o.next=22;break}if(1!=n.buytype||getApp().globalData.xzdzInfo){o.next=11;break}return n.go({t:1,url:"/yb_wm/my/address/index?from=3&storeId=".concat(n.sjxx.shopData.id)}),o.abrupt("return");case 11:if(!n.havebxp||3==n.type){o.next=15;break}if(s=function(){for(var t=n.goodsList.filter((function(t){return 1==t.isRequire})),e=0,o=n.carList.map((function(t){return t.goodsId})),r=0;r<t.length;r++)t[r].goods.find((function(t){return o.includes(t.id)}))&&(e+=1);if(e<t.length)return{v:n.util.message("请选择必选品",3,1500)}}(),"object"!==(0,i.default)(s)){o.next=15;break}return o.abrupt("return",s.v);case 15:n.util.showLoading(),2!=n.outin&&t.setStorageSync("carInfo",{carList:n.carList,getTotal:n.getTotal,mjInfo:n.mjInfo,carPrice:n.carPrice,sjxx:{discount:n.sjxx.discount,moreSet:n.sjxx.moreSet,outSet:n.sjxx.moreSet.distributionSupport,shopData:n.sjxx.shopData},buyType:n.buytype}),1==n.outin?n.go({t:e||1,url:"/yb_wm/shop/out/pay-order"}):3==n.outin?n.go({url:"/yb_wm/shop/ffmode/pay-order"}):2==n.outin&&(t.setStorageSync("carInfo",{sjxx:{discount:n.sjxx.discount,moreSet:n.sjxx.moreSet,outSet:n.sjxx.moreSet.distributionSupport,shopData:n.sjxx.shopData}}),n.go({url:"/yb_wm/shop/in/car?tableInfo="+encodeURIComponent(JSON.stringify(n.tableinfo))})),n.showCar=!1,t.hideLoading(),o.next=23;break;case 22:n.$emit("gopay");case 23:case"end":return o.stop()}}),o)})))()},itemTotal:function(t){return+(t.money*t.num).toFixed(2)},colorToRGB:function(t){return u.default.colorToRGB(t)}}),created:function(){console.log("this.sjxx",this.sjxx),this.havebxp=this.sjxx.data.findIndex((function(t){return 1==t.isRequire}))>-1}};e.default=h}).call(this,n("df3c")["default"])},5690:function(t,e,n){"use strict";n.r(e);var o=n("e2da"),r=n("ef94");for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n("77fb");var s=n("828b"),a=Object(s["a"])(r["default"],o["b"],o["c"],!1,null,"34c7d126",null,!1,o["a"],void 0);e["default"]=a.exports},"77fb":function(t,e,n){"use strict";var o=n("b94e"),r=n.n(o);r.a},b94e:function(t,e,n){},e2da:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,1==t.type||2==t.type?t.__get_style([{bottom:t.carBtm+"rpx"},t.sname]):null),o=1==t.type||2==t.type?!t.showCar&&t.mjInfo.discount.length:null,r=1==t.type||2==t.type?t.carList.length||!t.mjInfo.discount.length:null,i=1!=t.type&&2!=t.type||r?null:t.__map(t.mjInfo.discount,(function(e,n){var o=t.__get_orig(e),r=t.mjInfo.discount.length;return{$orig:o,g2:r}})),s=1==t.type||2==t.type?t.carList.length:null,a=1==t.type||2==t.type?t.carList.length:null,c=1==t.type||2==t.type?t.carList.length:null,u=1!=t.type&&2!=t.type||1!=t.buytype?null:Number(Number(t.sjxx.shopData.distribution.money).toFixed(2)),l=1==t.type||2==t.type?t.mjInfo.discount.length:null,p=1==t.type||2==t.type?t.carList.length||!t.mjInfo.discount.length:null,y=1!=t.type&&2!=t.type||p?null:t.__map(t.mjInfo.discount,(function(e,n){var o=t.__get_orig(e),r=t.mjInfo.discount.length;return{$orig:o,g8:r}})),h=1==t.type||2==t.type?t.__map(t.carList,(function(e,n){var o=t.__get_orig(e),r=t.carList.length,i=e.discountNum>0?t.blxs(e.num*e.money):null;return{$orig:o,g9:r,m1:i}})):null,f=1!=t.type&&2!=t.type&&3==t.type?t.__get_style([{bottom:t.carBtm+"rpx"},t.sname]):null,d=1!=t.type&&2!=t.type&&3==t.type?!t.showCar&&t.mjInfo.discount.length:null,g=1!=t.type&&2!=t.type&&3==t.type?t.carList.length||!t.mjInfo.discount.length:null,m=1==t.type||2==t.type||3!=t.type||g?null:t.__map(t.mjInfo.discount,(function(e,n){var o=t.__get_orig(e),r=t.mjInfo.discount.length;return{$orig:o,g12:r}})),x=1!=t.type&&2!=t.type&&3==t.type?t.carList.length:null,b=1!=t.type&&2!=t.type&&3==t.type?t.carList.length:null,j=1!=t.type&&2!=t.type&&3==t.type?t.carList.length:null,_=1!=t.type&&2!=t.type&&3==t.type?t.mjInfo.discount.length:null,v=1!=t.type&&2!=t.type&&3==t.type?t.carList.length||!t.mjInfo.discount.length:null,L=1==t.type||2==t.type||3!=t.type||v?null:t.__map(t.mjInfo.discount,(function(e,n){var o=t.__get_orig(e),r=t.mjInfo.discount.length;return{$orig:o,g18:r}})),w=1!=t.type&&2!=t.type&&3==t.type?t.__map(t.carList,(function(e,n){var o=t.__get_orig(e),r=t.carList.length,i=t.itemTotal(e);return{$orig:o,g19:r,m2:i}})):null,I=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.__get_style([{bottom:t.carBtm+"rpx"},t.sname]):null,S=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?!t.showCar&&t.mjInfo.discount.length:null,O=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.carList.length||!t.mjInfo.discount.length:null,T=1==t.type||2==t.type||3==t.type||4!=t.type||O?null:t.__map(t.mjInfo.discount,(function(e,n){var o=t.__get_orig(e),r=t.mjInfo.discount.length;return{$orig:o,g22:r}})),M=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.carList.length:null,D=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.carList.length:null,P=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.carList.length:null,$=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type&&1==t.buytype?Number(Number(t.sjxx.shopData.distribution.money).toFixed(2)):null,k=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.mjInfo.discount.length:null,A=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.carList.length||!t.mjInfo.discount.length:null,C=1==t.type||2==t.type||3==t.type||4!=t.type||A?null:t.__map(t.mjInfo.discount,(function(e,n){var o=t.__get_orig(e),r=t.mjInfo.discount.length;return{$orig:o,g28:r}})),N=1!=t.type&&2!=t.type&&3!=t.type&&4==t.type?t.__map(t.carList,(function(e,n){var o=t.__get_orig(e),r=t.carList.length,i=e.discountNum>0?t.blxs(e.num*e.money):null;return{$orig:o,g29:r,m4:i}})):null;t._isMounted||(t.e0=function(e){t.ydshow=!1},t.e1=function(e){t.ydshow=!1}),t.$mp.data=Object.assign({},{$root:{s0:n,g0:o,g1:r,l0:i,g3:s,g4:a,g5:c,m0:u,g6:l,g7:p,l1:y,l2:h,s1:f,g10:d,g11:g,l3:m,g13:x,g14:b,g15:j,g16:_,g17:v,l4:L,l5:w,s2:I,g20:S,g21:O,l6:T,g23:M,g24:D,g25:P,m3:$,g26:k,g27:A,l7:C,l8:N}})},r=[]},ef94:function(t,e,n){"use strict";n.r(e);var o=n("1364"),r=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e["default"]=r.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/goods/goods-car-create-component',
{
'components/goods/goods-car-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("5690"))
})
},
[['components/goods/goods-car-create-component']]
]);