2025-04-01 09:03:51 +08:00

1 line
7.1 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/center/orderDetail"],{"01fa":function(t,e,o){"use strict";(function(t,o){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={data:function(){return{show:!1,buyShow:!1,type:0,id:1,count:5,value:5,order_no:"",PayPirce:0,detail:{},people:{},virtual_people:0,popupStyle:{bottom:"122rpx",width:"100%",margin:"0 auto",display:"flex",justifyContent:"center",alignItems:"center"},timeList:[],selectedTime:null,status:!1,orderId:"",classes_lib_spec_id:"",order_no2:"",classes_lib_id:""}},onLoad:function(t){this.id=t.id,this.orderId=t.orderId,this.classes_lib_id=t.classes_lib_id,2==t.type&&(this.type=2,this.orderId=t.orderId),1==t.type&&(this.type=1,this.order_no=t.order_no),9==t.type&&(this.type=9),-3==t.type&&(this.type=-3),6==t.type&&(this.type=6),console.log(t.id),this.getDetail(),this.getTime()},filters:{formatDateTime:function(t){if(!t)return"";var e=new Date(1e3*t),o=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return"".concat(o,"-").concat(n,"-").concat(i," ").concat(a,":").concat(s,":").concat(c)}},methods:{getTime:function(){var e=this;t.$u.http.get("/api/school/classes/spec",{params:{id:this.classes_lib_id}}).then((function(o){1==o.code?e.timeList=o.data.spec:t.showToast({title:o.msg,icon:"none",duration:2e3})})).catch((function(e){t.showToast({title:"请求失败,请稍后再试",icon:"none",duration:2e3})}))},toService:function(){},getDetail:function(){var e=this;t.$u.http.get("/api/school/order/detail",{params:{id:this.orderId}}).then((function(o){1==o.code?(e.detail=o.data.detail,e.virtual_people=o.data.detail.views):t.showToast({title:o.msg,icon:"none",duration:2e3})})).catch((function(t){}))},sign:function(){this.buyShow=!0,this.type=3},toMap:function(e,o,n){t.openLocation({latitude:parseFloat(e),longitude:parseFloat(o),name:n,success:function(){console.log("success")}})},cancelOrder:function(){t.$u.http.post("/api/school/order/cancel",{order_no:this.order_no}).then((function(e){1==e.code?t.navigateBack({delta:1,success:function(t){var e=getCurrentPages(),o=e[e.length-1];o.onLoad(o.options)}}):t.showToast({title:e.msg,icon:"none",duration:2e3})})).catch((function(t){}))},buy:function(){this.pament()},buyOpen:function(){this.buyShow=!0,this.type=1},open:function(){this.show=!0,this.type=3},confimTime:function(){var e=this;t.$u.http.post("/api/school/hour_order/confirm",{classes_order_id:this.orderId,classes_lib_spec_id:this.classes_lib_spec_id,order_no:this.order_no2,is_compute:1}).then((function(o){1==o.code?(e.order_no2=o.data.order_no,e.timeCreat(o.data.order_no)):(e.type=2,t.showToast({title:o.msg,icon:"none",duration:2e3}))})).catch((function(t){})),this.show=!1,this.type=0},timeCreat:function(e){var o=this;t.$u.http.post("/api/school/hour_order/create",{order_no:e}).then((function(e){1==e.code?t.showToast({title:"提交成功",icon:"none",duration:2e3,complete:function(){setTimeout((function(){t.redirectTo({url:"/packageA/my/makeList?status=-1"})}),2e3)}}):(o.type=2,t.showToast({title:e.msg,icon:"none",duration:2e3}))})).catch((function(t){}))},toTeacher:function(e){t.navigateTo({url:"/pages/center/teacherDetail?id=".concat(e)})},toMeDetail:function(){var e=this.detail.shop.id;t.navigateTo({url:"/pages/center/MechanismDetail?id="+e})},close:function(){this.type=2,this.selectedTime=null,this.show=!1},buyClose:function(){this.type=1,this.selectedTime=null,this.buyShow=!1},Collect:function(){console.log(this.status),this.status=!this.status},cancel:function(){this.selectedTime=null},selectTime:function(t){this.selectedTime=t,this.classes_lib_spec_id=t.id},timeSelected:function(t){return this.selectedTime===t},getMoney:function(){var e=this;t.$u.http.post("/api/school/order/confirm",{classes_lib_id:this.id,order_no:this.order_no,is_compute:1}).then((function(o){1==o.code?(e.PayPirce=o.data.order_data.totalprice,e.order_no=o.data.order_no,e.create(e.order_no,e.PayPirce)):t.showToast({title:o.msg,icon:"none",duration:2e3})})).catch((function(t){}))},create:function(e,o){var n=this;t.$u.http.post("/api/school/order/create",{order_no:e}).then((function(e){1==e.code?0!=o?n.pament():t.showToast({title:"创建成功",icon:"success",duration:2e3,complete:function(){setTimeout((function(){t.reLaunch({url:"/packageA/my/orderList?status=3"})}),2e3)}}):t.showToast({title:e.msg,icon:"none",duration:2e3})})).catch((function(t){}))},pament:function(){t.$u.http.post("/api/school/pay/payment",{type:"wechat",order_no:this.order_no,platform:"miniapp"}).then((function(e){1==e.code?o.requestPayment({timeStamp:e.data.paydata.timeStamp,nonceStr:e.data.paydata.nonceStr,package:e.data.paydata.package,signType:e.data.paydata.signType,paySign:e.data.paydata.paySign,success:function(e){"requestPayment:ok"==e.errMsg?(this.order_no="",t.redirectTo({url:"/packageA/my/orderList?status=3"}),console.log("支付成功",e)):console.log("支付失败")},fail:function(t){console.log("支付失败",t)}}):t.showToast({title:e.msg,icon:"none",duration:2e3})})).catch((function(t){}))}}};e.default=n}).call(this,o("df3c")["default"],o("3223")["default"])},"0be0":function(t,e,o){"use strict";var n=o("76fb"),i=o.n(n);i.a},"0db6":function(t,e,o){"use strict";o.r(e);var n=o("01fa"),i=o.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(a);e["default"]=i.a},"3e97":function(t,e,o){"use strict";(function(t,e){var n=o("47a9");o("5e3a");n(o("3240"));var i=n(o("f659"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(i.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},"76fb":function(t,e,o){},ee7d:function(t,e,o){"use strict";o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){return n}));var n={uSwiper:function(){return Promise.all([o.e("common/vendor"),o.e("node-modules/uview-ui/components/u-swiper/u-swiper")]).then(o.bind(null,"351b"))},uParse:function(){return Promise.all([o.e("common/vendor"),o.e("node-modules/uview-ui/components/u-parse/u-parse")]).then(o.bind(null,"4e7a"))},uRate:function(){return Promise.all([o.e("common/vendor"),o.e("node-modules/uview-ui/components/u-rate/u-rate")]).then(o.bind(null,"664c"))},uPopup:function(){return Promise.all([o.e("common/vendor"),o.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(o.bind(null,"e6bd"))}},i=function(){var t=this,e=t.$createElement,o=(t._self._c,t._f("formatDateTime")(t.detail.detail.start_time)),n=t._f("formatDateTime")(t.detail.detail.end_time),i=t.__map(t.timeList,(function(e,o){var n=t.__get_orig(e),i=t.timeSelected(e);return{$orig:n,m0:i}})),a=t._f("formatDateTime")(t.detail.detail.start_time),s=t._f("formatDateTime")(t.detail.detail.end_time);t.$mp.data=Object.assign({},{$root:{f0:o,f1:n,l0:i,f2:a,f3:s}})},a=[]},f659:function(t,e,o){"use strict";o.r(e);var n=o("ee7d"),i=o("0db6");for(var a in i)["default"].indexOf(a)<0&&function(t){o.d(e,t,(function(){return i[t]}))}(a);o("0be0");var s=o("828b"),c=Object(s["a"])(i["default"],n["b"],n["c"],!1,null,"43cdaee6",null,!1,n["a"],void 0);e["default"]=c.exports}},[["3e97","common/runtime","common/vendor"]]]);