canyin-project/ybcy/views/mobile/static/js/yb_wm-shop-in-car.0185bf34.js
2024-11-01 16:07:54 +08:00

1 line
17 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["yb_wm-shop-in-car"],{1820:function(t,e,a){"use strict";a.r(e);var n=a("e0fa"),i=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},2496:function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".tgg[data-v-49b45802]{padding:%?10?% %?30?%;height:%?80?%;line-height:1.4;background:#fff3ea;z-index:99}.cfc[data-v-49b45802]{color:#ff7c1c}.dbbtnc[data-v-49b45802]{position:fixed;bottom:0;width:100%;z-index:998;padding:%?20?% %?30?%}.dbbtnc .dbbtn[data-v-49b45802]{-webkit-border-radius:%?80?%;border-radius:%?80?%;height:%?80?%}.dbbtnc .dbl[data-v-49b45802],\n.dbbtnc .dbr[data-v-49b45802]{width:%?180?%;color:#fff;font-size:%?30?%;-webkit-border-radius:%?80?%;border-radius:%?80?%}.dbbtnc .dbl[data-v-49b45802]{margin-right:%?40?%;background:-webkit-gradient(linear,left top,right top,from(#f8c10d),to(#ff9503));background:-webkit-linear-gradient(left,#f8c10d,#ff9503);background:linear-gradient(90deg,#f8c10d,#ff9503)}.dbbtnc .dbr[data-v-49b45802]{background:-webkit-gradient(linear,left top,right top,from(#ff7a01),to(#ff560a));background:-webkit-linear-gradient(left,#ff7a01,#ff560a);background:linear-gradient(90deg,#ff7a01,#ff560a)}.sdbg[data-v-49b45802]{position:fixed;background:#fff;opacity:.8;top:0;height:100%;width:100%;z-index:997;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-size:%?35?%;color:#000}.sdbg .sdimg[data-v-49b45802]{width:%?80?%;height:%?80?%;margin-bottom:%?30?%}.sdbg .sdbtn[data-v-49b45802]{margin-top:%?30?%;background:-webkit-gradient(linear,left top,right top,from(#ff7a01),to(#ff560a));background:-webkit-linear-gradient(left,#ff7a01,#ff560a);background:linear-gradient(90deg,#ff7a01,#ff560a);color:#fff;font-size:%?30?%}.hddb[data-v-49b45802]{bottom:%?300?%}.hddb .hddbimg[data-v-49b45802]{width:%?60?%;height:%?60?%;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cimg[data-v-49b45802]{width:%?70?%;height:%?70?%;position:relative;z-index:2}.cun[data-v-49b45802]{height:%?50?%;-webkit-border-radius:%?50?%;border-radius:%?50?%;padding:0 %?30?% 0 %?40?%;bottom:%?2?%;left:%?40?%;background:#f5f5f5}.ucarlc[data-v-49b45802]{-webkit-border-radius:%?25?%;border-radius:%?25?%}.sjx[data-v-49b45802]{top:0;left:%?0?%;padding:0 %?40?%;height:%?35?%;font-size:%?20?%;line-height:%?35?%;-webkit-border-radius:0 0 %?20?% 0;border-radius:0 0 %?20?% 0;background:-webkit-gradient(linear,left top,left bottom,from(#f75214),to(#f87d22));background:-webkit-linear-gradient(#f75214,#f87d22);background:linear-gradient(#f75214,#f87d22)}",""]),t.exports=e},3864:function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".page__bd[data-v-f2ef9ede]{background:#fff;font-size:%?28?%}.weui-loadmore[data-v-f2ef9ede]{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:%?20?%}.weui-loadmore__tips[data-v-f2ef9ede]{color:#999;margin:0 %?20?%}.hx[data-v-f2ef9ede]{width:%?100?%;height:%?2?%;background:#e5e5e5}.no-data-tip[data-v-f2ef9ede]{padding:0 0 %?30?%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;color:#999}.no-data-tipimg[data-v-f2ef9ede]{width:%?480?%;height:%?480?%\n /* margin-bottom: 0rpx; */}",""]),t.exports=e},"3c6c":function(t,e,a){"use strict";a.r(e);var n=a("95579"),i=a("1820");for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);a("913ab");var o,s=a("f0c5"),c=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,"49b45802",null,!1,n["a"],o);e["default"]=c.exports},"3caa":function(t,e,a){var n=a("2496");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("4f06").default;i("74856caa",n,!0,{sourceMap:!1,shadowMode:!1})},"3db1":function(t,e,a){"use strict";a.r(e);var n=a("7fd8"),i=a("493f");for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);a("5217");var o,s=a("f0c5"),c=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,"f2ef9ede",null,!1,n["a"],o);e["default"]=c.exports},"493f":function(t,e,a){"use strict";a.r(e);var n=a("91d5"),i=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},5217:function(t,e,a){"use strict";var n=a("ad46"),i=a.n(n);i.a},"7fd8":function(t,e,a){"use strict";var n;a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"page__bd",style:{background:t.bgcolor}},[t.nodata?[a("v-uni-view",{staticClass:"no-data-tip",style:[t.sname]},[a("v-uni-image",{staticClass:"no-data-tipimg",attrs:{src:t.onImgurl+t.imgn+".png"}}),a("v-uni-view",{style:{color:t.tcolor}},[t._v(t._s(t.otext||"暂无相关内容~"))]),t.ttext?a("v-uni-view",{style:{color:t.tcolor}},[t._v(t._s(t.ttext))]):t._e()],1)]:[t.mygd?t._e():a("v-uni-view",{staticClass:"weui-loadmore"},[a("v-uni-view",{staticClass:"weui-loading"}),a("v-uni-view",{staticClass:"weui-loadmore__tips",staticStyle:{margin:"0"},style:{color:t.tcolor}},[t._v("正在加载")])],1),t.mygd?a("v-uni-view",{staticClass:"weui-loadmore"},[a("v-uni-view",{staticClass:"hx"}),a("v-uni-view",{staticClass:"weui-loadmore__tips",style:{color:t.tcolor}},[t._v("加载完毕")]),a("v-uni-view",{staticClass:"hx"})],1):t._e()]],2)},r=[]},"913ab":function(t,e,a){"use strict";var n=a("3caa"),i=a.n(n);i.a},"91d5":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"mg-img",props:{sname:Object,imgn:{type:String,default:"zwdd"},bgcolor:"",mygd:{type:Boolean,default:!1},tcolor:{type:String,default:""},nodata:"",otext:{type:String,default:""},ttext:{type:String,default:""}},data:function(){return{}}};e.default=n},95579:function(t,e,a){"use strict";var n;a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"pb130"},[a("v-uni-view",{staticClass:"posi-f w100 t0 f-y-c tgg cfc"},[a("v-uni-text",{staticClass:"iconfont icongg mr30 cfc"}),a("v-uni-view",{staticClass:"f-1 f22"},[t._v("本页面会每5秒刷新一次页面保证其他人所点的商品能够实时同步订单支付后大厨就开始制作啦!")]),a("v-uni-view",{staticClass:"f-c ml20"},[a("v-uni-text",{staticClass:"iconfont icondd f48 c3",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.go({url:"/yb_wm/shop/in/indd"})}}})],1)],1),a("v-uni-view",{staticClass:"carlistc p02",style:{paddingTop:"80rpx"}},[a("mg-cell",{attrs:{bgc:"transparent",isl:"1",sname:{padding:"30rpx 10rpx"}}},[a("v-uni-view",{staticClass:"f-y-c",attrs:{slot:"bd"},slot:"bd"},[a("v-uni-text",{},[t._v("已选以下商品")])],1),a("v-uni-view",{staticClass:"f-y-c f24",attrs:{slot:"ft"},slot:"ft"},[a("v-uni-text",{staticClass:"iconfont iconsx f50 c0",staticStyle:{"margin-right":"40rpx"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.sxsj.apply(void 0,arguments)}}}),a("v-uni-text",{staticClass:"iconfont iconshanchu f42 c0",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.clearCar.apply(void 0,arguments)}}})],1)],1),t.tableInfo.orderInfo&&t.orderGoods.goodsArr?a("v-uni-view",{staticClass:"p20"},[t._v("当前桌位订单商品")]):t._e(),a("v-uni-view",{staticClass:"ucarlc o-h bf",staticStyle:{opacity:"0.5"}},[t._l(t.orderGoods.goodsArr,(function(e,n){return[a("mg-cell",{key:n+"_0",attrs:{w:"160",h:"160",img:e.icon,brs:"5rpx",cname:"f-sh",hdc:"f-s"}},[a("v-uni-view",{staticClass:"h100 f-y-bt",attrs:{slot:"bd"},slot:"bd"},[a("v-uni-view",{staticClass:"f-bt"},[a("v-uni-view",{staticClass:"t-o-e f32 c0"},[t._v(t._s(e.name))])],1),a("v-uni-view",{staticClass:"f-bt mt10"},[a("v-uni-view",{staticClass:"f-g-1 f24 c9"},[e.data?a("v-uni-text",{},[t._v(t._s(e.data))]):t._e(),e.attribute?a("v-uni-text",[t._v("("+t._s(e.attribute)+")")]):t._e(),e.material?a("v-uni-text",{staticClass:"ml10"},[t._v("+"+t._s(e.material))]):t._e()],1)],1),a("v-uni-view",{staticClass:"f-x-bt mt10"},[a("v-uni-view",{staticClass:"f-g-0",style:{color:t.tColor}},[t._v(t._s(t.sl)),a("v-uni-text",{staticClass:"f36 wei"},[t._v(t._s(t.itemTotal(e)))])],1),a("v-uni-view",{staticClass:"c9"},[t._v("x"+t._s(e.num))])],1)],1)],1)]}))],2),t._l(t.orderGoods.addGoods,(function(e,n){return a("v-uni-view",{key:n,staticClass:"ucarlc o-h bf mt20 p-r pt30",staticStyle:{opacity:"0.5"}},[t._l(e,(function(e,n){return[a("mg-cell",{key:n+"_0",attrs:{w:"160",h:"160",img:e.icon,brs:"5rpx",cname:"f-sh",hdc:"f-s"}},[a("v-uni-view",{staticClass:"h100 f-y-bt",attrs:{slot:"bd"},slot:"bd"},[a("v-uni-view",{staticClass:"f-bt"},[a("v-uni-view",{staticClass:"t-o-e f32 c0"},[t._v(t._s(e.name))])],1),a("v-uni-view",{staticClass:"f-bt mt10"},[a("v-uni-view",{staticClass:"f-g-1 f24 c9"},[e.data?a("v-uni-text",{},[t._v(t._s(e.data))]):t._e(),e.attribute?a("v-uni-text",[t._v("("+t._s(e.attribute)+")")]):t._e(),e.material?a("v-uni-text",{staticClass:"ml10"},[t._v("+"+t._s(e.material))]):t._e()],1)],1),a("v-uni-view",{staticClass:"f-x-bt mt10"},[a("v-uni-view",{staticClass:"f-g-0",style:{color:t.tColor}},[t._v(t._s(t.sl)),a("v-uni-text",{staticClass:"f36 wei"},[t._v(t._s(t.itemTotal(e)))])],1),a("v-uni-view",{staticClass:"c9"},[t._v("x"+t._s(e.num))])],1)],1)],1)]})),a("v-uni-view",{staticClass:"p-a sjx cf"},[t._v("加")])],2)})),t.tableInfo.orderInfo&&t.orderGoods.goodsArr?a("v-uni-view",{staticClass:"p20"},[t._v("新增商品")]):t._e(),a("v-uni-view",{staticClass:"p0"},[a("v-uni-view",{staticClass:"mb30 ucarlc o-h bf"},[a("goods",{attrs:{"d-list":t.carList,addtype:"2",outin:"2",type:"6"},on:{dec:function(e){arguments[0]=e=t.$handleEvent(e),t.dec.apply(void 0,arguments)},add:function(e){arguments[0]=e=t.$handleEvent(e),t.add.apply(void 0,arguments)}}})],1)],1)],2),0==t.carList.length?a("jzz",{attrs:{bgcolor:"transparent",nodata:!0,mygd:!0,otext:"暂未添加商品"}}):t._e(),t.tableInfo.userId?a("v-uni-view",{staticClass:"dbbtnc bf f-row",style:{bottom:t.isIpx?"40rpx":0}},[a("v-uni-view",{staticClass:"f-1 f-y-c"},[a("v-uni-view",{staticClass:"cf1 mr30"},[a("v-uni-text",{staticClass:"c3"},[t._v("合计:")]),t._v(t._s(t.sl)),a("v-uni-text",{staticClass:"f36 wei"},[t._v(t._s(t.scarList.ins.price))])],1)],1),a("v-uni-view",{staticClass:"dbbtn o-h f-row",attrs:{c:!0}},[a("v-uni-button",{staticClass:"dbl f-c",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.jxdc.apply(void 0,arguments)}}},[t._v("继续点单")]),t.tableInfo.orderInfo&&2==t.tableInfo.orderInfo.state?a("v-uni-button",{staticClass:"dbr f-c",attrs:{disabled:t.loading},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.tjsp.apply(void 0,arguments)}}},[t._v("提交商品")]):t._e(),t.tableInfo.orderInfo?t._e():a("v-uni-button",{staticClass:"dbr f-c f-1",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.ljxd.apply(void 0,arguments)}}},[t._v("去下单")])],1)],1):t._e(),t.isIpx?a("v-uni-view",{staticClass:"bgf"}):t._e(),a("load",{attrs:{type:"2"},model:{value:t.showjz,callback:function(e){t.showjz=e},expression:"showjz"}})],1)},r=[]},ad46:function(t,e,a){var n=a("3864");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("4f06").default;i("b489cde4",n,!0,{sourceMap:!1,shadowMode:!1})},e0fa:function(t,e,a){"use strict";var n=a("4ea4");a("b680"),a("d3b7"),a("3ca3"),a("ddb0"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(a("5530"));a("96cf");var r=n(a("1da1")),o=a("2f62"),s=n(a("0205")),c=n(a("f3fc")),d=n(a("2dc2")),l=n(a("3db1")),u=n(a("2d33")),f=(n(a("8bb1")),getApp().globalData,{name:"order-index",components:{goods:s.default,MgCell:c.default,MgImg:d.default,jzz:l.default,load:u.default},data:function(){return{tableInfo:{},otableInfo:{},orderGoods:{},loading:!1,showjz:!1}},onLoad:function(t){var e=this;return(0,r.default)(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return e.getSystem({nosetNB:1}),e.util.setNT("购物车"),e.tableInfo=JSON.parse(decodeURIComponent(t.tableInfo)),a.next=5,e.getLoginInfo();case 5:if(!e.tableInfo.storeId||!e.tableInfo.tableId){a.next=9;break}e.supdCarbp={storeId:e.tableInfo.storeId,tableId:e.tableInfo.tableId,item:2,key:"ins"},a.next=10;break;case 9:return a.abrupt("return",e.tips());case 10:e.dsq=setInterval((function(){e.sxsj()}),5e3),e.sxsj();case 12:case"end":return a.stop()}}),a)})))()},onShow:function(){var t=this;this.isload?(this.sxsj(),this.dsq=setInterval((function(){t.sxsj()}),5e3)):this.isload=!0},computed:(0,i.default)((0,i.default)({},(0,o.mapState)(["scarList"])),{},{carList:function(){return this.scarList.ins.data||[]}}),methods:(0,i.default)((0,i.default)({},(0,o.mapActions)(["supdCar","getMycar","clearMycar"])),{},{getTableInfo:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.util.request({url:t.api.tsczxq,method:"POST",data:{tableId:t.tableInfo.tableId}});case 2:a=e.sent,n=a.data,t.otableInfo=n;case 5:case"end":return e.stop()}}),e)})))()},clearCar:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.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(t.supdCarbp);case 5:t.getMycar(t.supdCarbp),e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])})))()},tips:function(){var t=this;uni.showModal({title:"提示",content:"未获取到桌位信息",showCancel:!1,success:function(e){t.go({t:6,url:"/yb_wm/index/index"})}})},updList:function(t){var e=this;return(0,r.default)(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,e.supdCar((0,i.default)((0,i.default)({},e.supdCarbp),{},{type:t.type,goodsId:t.e.g.goodsId,id:t.e.g.id}));case 3:e.showjz=!1,a.next=9;break;case 6:a.prev=6,a.t0=a["catch"](0),e.showjz=!1;case 9:case"end":return a.stop()}}),a,null,[[0,6]])})))()},dec:function(t){this.showjz=!0,this.updList({type:2,e:t})},add:function(t){this.showjz=!0,this.updList({type:1,e:t})},sxsj:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.util.showLoading("同步商品中"),e.next=3,Promise.all([t.getMycar(t.supdCarbp),t.getInfo()]);case 3:uni.hideLoading();case 4:case"end":return e.stop()}}),e)})))()},getInfo:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.util.request({url:t.api.tsczxq,method:"POST",data:{tableId:t.tableInfo.tableId}});case 2:if(a=e.sent,!a){e.next=9;break}if(!a.data.orderInfo){e.next=8;break}a.data.orderInfo.state<3?(t.tableInfo.orderInfo=a.data.orderInfo,t.orderGoods=a.data.orderInfo):(t.tableInfo.orderInfo=!1,t.orderGoods={}),e.next=9;break;case 8:return e.abrupt("return");case 9:case"end":return e.stop()}}),e)})))()},jxdc:function(){this.go({t:4})},tjsp:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.carList.length){e.next=2;break}return e.abrupt("return",t.util.message("请添加商品后提交",3));case 2:return t.loading=!0,e.next=5,t.util.request({url:t.api.tsjc,method:"POST",mask:1,data:{orderId:t.tableInfo.orderInfo.id}});case 5:a=e.sent,a?t.go({t:2,url:"/yb_wm/shop/in/order-dl?id="+t.tableInfo.orderInfo.id}):t.loading=!1;case 7:case"end":return e.stop()}}),e)})))()},jsdd:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.util.request({url:t.api.UpdCarState,method:"POST",data:{manyType:1,tableId:t.tableInfo.tableId}});case 2:return a=e.sent,a.data,e.next=6,t.sxsj();case 6:t.go({t:4});case 7:case"end":return e.stop()}}),e)})))()},ljxd:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.carList.length){e.next=2;break}return e.abrupt("return",t.util.message("请添加商品后下单",3));case 2:t.go({t:1,url:"pay-order?tableInfo="+encodeURIComponent(JSON.stringify(t.tableInfo))});case 3:case"end":return e.stop()}}),e)})))()},itemTotal:function(t){var e=+(t.vipMoney>0&&+t.vipMoney<+t.money&&t.vipMoney||t.money);return+(e*t.num).toFixed(2)}}),onUnload:function(){this.dsq&&clearInterval(this.dsq)},onHide:function(){clearInterval(this.dsq)}});e.default=f}}]);