1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/store/table_code/index"],{2691:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){}));var o=function(){var e=this.$createElement;this._self._c},i=[]},"475f":function(e,t,n){"use strict";(function(e,t){var o=n("4ea4");n("59a4");o(n("66fd"));var i=o(n("7058"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},4785:function(e,t,n){"use strict";var o=n("dc02"),i=n.n(o);i.a},"5d41":function(e,t,n){"use strict";n.r(t);var o=n("6f43"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=i.a},"6f43":function(e,t,n){"use strict";(function(e){var o=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n("2eee")),r=o(n("c973")),a=o(n("9523")),c=n("26cb"),s=o(n("5c3b")),u=(n("3c98"),n("f8b7")),d=n("8e8a"),f=o(n("180b"));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h={computed:(0,c.mapGetters)(["isLogin","uid"]),components:{storeCate1:function(){Promise.all([n.e("common/vendor"),n.e("pages/store/table_code/cart")]).then(function(){return resolve(n("e4ea"))}.bind(null,n)).catch(n.oe)},pageFooter:function(){Promise.all([n.e("common/vendor"),n.e("components/pageFooter/index")]).then(function(){return resolve(n("a225"))}.bind(null,n)).catch(n.oe)}},mixins:[s.default],data:function(){return{info:{},id:0,isFooter:!1,category:"",customerType:1,cart_num:0,number:1,popupVisible:!1,pageVisible:!0,isShowAuth:!1}},onLoad:function(e){e.scene&&(e=f.default.getUrlParams(decodeURIComponent(e.scene)));var t=e,n=t.store_id,o=t.qrcode_id;this.info=b(b({},this.info),{},{store_id:n,qrcode_id:o})},onShow:function(){this.info.tableId=0,this.isLogin?this.getTableData():(0,d.toLogin)()},onHide:function(){this.pageVisible=!1},methods:{authColse:function(e){this.isShowAuth=e},onLoadFun:function(){this.isShowAuth=!1,this.getTableData()},getTableData:function(){var e=this;(0,u.getTableData)({store_id:this.info.store_id}).then((function(t){var n=t.data;Array.isArray(n)&&(n={});var o=n,i=o.store_code_switch,r=o.store_number_diners_window;1==i?e.isTableCode(r):e.$util.Tips({title:"当前门店未开启桌码"})}))},changeNumber:function(e){this.number+=e},addTableCode:function(e){var t=this,n=this.info,o=n.store_id,i=n.qrcode_id,r=n.tableId,a={store_id:o,qrcode_id:i};return e&&(a.number=e),new Promise((function(n,o){(0,u.addTableCode)(a).then((function(o){t.info=b(b({},t.info),{},{tableId:o.data.tableId}),t.getStore(),n(r),e&&(t.popupVisible=!1)})).catch((function(e){o(r),t.$util.Tips({title:e})}))}))},isTableCode:function(t){var n=this,o=this.info,i=o.store_id,r=o.qrcode_id;(0,u.isTableCode)({store_id:i,qrcode_id:r}).then((function(o){var i=o.data,r=i.code,a=i.tableId;if(n.info=b(b({},n.info),{},{tableId:a}),!r)return e.showModal({title:"确定要换桌吗?",content:"换桌后,您已点的商品会自动转移到新桌",success:function(e){e.confirm?n.changeTable():n.getStore()}});a?n.getStore():(n.popupVisible=1==t,n.popupVisible||n.addTableCode())}))},changeTable:function(){var e=this;return(0,r.default)(i.default.mark((function t(){var n;return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.addTableCode();case 2:if(n=t.sent,n){t.next=5;break}return t.abrupt("return");case 5:(0,u.changeTable)({tableId:e.info.tableId,y_tableId:n}).then((function(){e.$util.Tips({title:"换桌完成",success:e.getStore})})).catch((function(t){e.$util.Tips({title:t})}));case 6:case"end":return t.stop()}}),t)})))()},getStore:function(){var e=this;(0,u.getStoreData)({store_id:this.info.store_id}).then((function(t){e.info=b(b({},e.info),t.data),e.$refs.refresh2.getMarTop(),e.$refs.refresh2.getAllCategory()}))},newDataStatus:function(e){this.isFooter=e}},onReachBottom:function(){var e=this;setTimeout((function(){e.$refs.refresh2.getProducts()}),10)}};t.default=h}).call(this,n("543d")["default"])},7058:function(e,t,n){"use strict";n.r(t);var o=n("2691"),i=n("5d41");for(var r in i)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(r);n("4785");var a=n("f0c5"),c=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,"4aea328e",null,!1,o["a"],void 0);t["default"]=c.exports},dc02:function(e,t,n){}},[["475f","common/runtime","common/vendor"]]]);
|