yzms/touch_mz/dist/4.chunk.js

1 line
6.4 KiB
JavaScript

webpackJsonp([4],{45:function(t,e,a){a(62);var n=a(19)(a(50),a(67),null,null);n.options.__file="E:\\git_project\\backups_source\\标准版敏卓触摸版\\src\\views\\cancel.vue",n.esModule&&Object.keys(n.esModule).some(function(t){return"default"!==t&&"__esModule"!==t})&&console.error("named exports are not supported in *.vue files."),n.options.functional&&console.error("[vue-loader] cancel.vue: functional components are not supported with templates, they should use render functions."),t.exports=n.exports},50:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{copy:(new Date).getFullYear()+"© 中国电信佛山分公司版权",username:"-",account:"-",userid:"",iconSize:"13",menuIconColor:"#698aab",readCard:!1,canICancel:!1,dateData:""}},mounted:function(){this.autoSetLayoutMainHeight(),this.readCard=!1,this.getData()},updated:function(){},methods:{goBack:function(){this.$store.commit("setToken",null),this.$store.commit("setCount",0),this.$router.replace({path:"index"})},getData:function(){this.$store.commit("setLoading",!0);var t=this;this.$ajax.get("/api/order/cancel_list/",{params:{token:t.$store.state.token}}).then(function(e){t.$store.commit("setLoading",!1),1===e.data.status?(t.dateData=e.data.data.dateData,t.username=e.data.data.user.username,t.account=e.data.data.user.account):-1===e.data.status&&t.goBack()}).catch(function(e){t.$store.commit("setLoading",!1);var a="";a=e.response?"请求服务器失败":e.request?"等待回复失败":"系统解析出错",t.$Message.error({content:a,top:30,duration:3})})},autoSetLayoutMainHeight:function(){var t=document.querySelector(".layout-menu-left"),e=document.querySelector(".layout-content"),a=document.querySelector(".layout-header"),n=document.querySelector(".layout-copy");t.style.height="auto";var o=document.body.clientHeight;t.offsetHeight<o&&(t.style.height=o-3+"px"),e.style.height=o-n.offsetHeight-a.offsetHeight-parseInt(window.getComputedStyle(document.querySelector(".layout-content"),null).getPropertyValue("margin-bottom"))-parseInt(window.getComputedStyle(document.querySelector(".layout-content"),null).getPropertyValue("margin-top"))-3+"px"},clickDinner:function(t,e){if(0==e)return!1;t.currentTarget.classList.contains("choosen")?t.currentTarget.classList.remove("choosen"):t.currentTarget.classList.add("choosen"),this.canICancel=document.querySelectorAll(".choosen").length},handleCancelDinner:function(t){this.$store.commit("setLoading",!0);var e=this;this.$ajax.post("/api/order/multicancel/",{order_id:t,token:e.$store.state.token}).then(function(t){if(1===t.data.status)return e.$router.replace({path:"result",query:{result:"success",type:"cancel",message:""}}),0;if(-3===t.data.status){var a="";for(var n in t.data.data)a+=t.data.data[n].message+"<br>";return e.$router.replace({path:"result",query:{result:"fail",type:"cancel",message:a}}),0}if(-4===t.data.status){for(var o="",s=0;s<t.data.data.length;s++)o+="<p>"+t.data.data[s].message+"</p>";return e.$router.replace({path:"result",query:{result:"notice",type:"cancel",message:o}}),0}-1===t.data.status&&e.goBack(),e.$store.commit("setLoading",!1),this.$Message.success({content:t.data.message,top:30,duration:3})}).catch(function(t){e.$store.commit("setLoading",!1);var a="";a=t.response?"请求服务器失败":t.request?"等待回复失败":"系统解析出错",e.$Message.error({content:a,top:30,duration:3})})},cancelDinner:function(){for(var t=this,e=[],a="<p>是否确定退订</p>",n=0;n<document.querySelectorAll(".choosen").length;n++)a+="<p>"+document.querySelectorAll(".choosen")[n].getAttribute("data-date")+document.querySelectorAll(".choosen")[n].getAttribute("data-name")+"</p>",e.push(document.querySelectorAll(".choosen")[n].getAttribute("id"));if(!e)return!1;this.$Modal.confirm({title:"退餐提示",content:a,onOk:function(){t.handleCancelDinner(e.join(","))}})}}}},62:function(t,e){},67:function(t,e,a){t.exports={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"layout cancel"},[t.$store.state.loading?a("Spin",{attrs:{size:"large",fix:""}}):t._e(),t._v(" "),a("Row",{attrs:{type:"flex"}},[a("Col",{staticClass:"layout-menu-left",attrs:{span:"5"}},[a("Menu",{attrs:{width:"auto"}},[a("Row",[a("h2",[t._v("个人信息")])]),t._v(" "),a("Row",[a("Icon",{attrs:{type:"person",size:t.iconSize,color:t.menuIconColor}}),t._v(" "),a("span",{staticClass:"layout-text"},[t._v(t._s(t.username))])],1),t._v(" "),a("Row",[a("Icon",{attrs:{type:"cash",size:t.iconSize,color:t.menuIconColor}},[t._v("资产")]),t._v(" "),a("span",{staticClass:"layout-text"},[a("i",[t._v("¥")]),t._v(" "+t._s(t.account))])],1)],1),t._v(" "),a("div",{staticClass:"ivu-menu-botton-row"},[a("Button",{attrs:{type:"primary",long:""},on:{click:t.goBack}},[t._v("后退("+t._s(t.$store.state.count)+"s)")])],1)],1),t._v(" "),a("Col",{attrs:{span:"19"}},[a("div",{staticClass:"layout-header"},[a("Row",[a("Col",{attrs:{span:"16"}},[t._v("退餐——我的订单列表")]),t._v(" "),a("Col",{attrs:{span:"8"}},[t.canICancel?a("Button",{attrs:{type:"warning",loading:t.$store.state.loading,icon:"checkmark-round"},on:{click:t.cancelDinner}},[a("span",[t._v("确定退餐")])]):a("Button",{attrs:{type:"warning",disabled:""}},[a("span",[t._v("请选餐")])])],1)],1)],1),t._v(" "),a("div",{staticClass:"layout-content"},[a("div",{staticClass:"layout-content-main"},[a("Alert",{attrs:{"show-icon":""}},[t._v("提示:请点击需要退餐的项目,再按下退餐按钮 ")]),t._v(" "),t._l(t.dateData,function(e){return a("ul",{staticClass:"date-meal"},[a("li",[a("Row",[a("Col",{attrs:{span:"4"}},[a("div",{staticClass:"lb"},[a("div",{staticClass:"date"},[t._v(t._s(e.date))]),t._v(" "),a("div",{staticClass:"weekday"},[t._v(t._s(e.weekday))])])]),t._v(" "),a("Col",{attrs:{span:"20"}},t._l(e.data,function(n){return a("Col",{attrs:{span:"4"}},[a("div",{class:{dinner:1,refund_meal:!n.refund_meal},attrs:{id:n.id,"data-name":n.name,"data-date":e.date},on:{click:function(e){return t.clickDinner(e,n.refund_meal)}}},[a("div",{staticClass:"dinner-name"},[t._v("\n "+t._s(n.name)+"\n ")]),t._v(" "),a("div",{staticClass:"dinner-price"},[t._v("\n ¥"+t._s(n.price)+"\n ")])])])}),1)],1)],1)])})],2)]),t._v(" "),a("div",{staticClass:"layout-copy"},[t._v(t._s(t.copy))])])],1)],1)},staticRenderFns:[]},t.exports.render._withStripped=!0}});